Skip to content

Commit

Permalink
fix secure chat?
Browse files Browse the repository at this point in the history
  • Loading branch information
oq-x committed Aug 13, 2024
1 parent 651e65b commit 242b015
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/session/std/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ func (session *StandardSession) AppendMessage(sig [256]byte) {
defer session.prev_msgs_mu.Unlock()
session.bumpChatIndex()

session.previousMessages = append([]play.PreviousMessage{{MessageID: int32(len(session.previousMessages))}}, session.previousMessages...)

if len(session.previousMessages) > 20 {
session.previousMessages = session.previousMessages[:20]
if len(session.previousMessages) != 20 {
session.previousMessages = append([]play.PreviousMessage{{MessageID: int32(len(session.previousMessages))}}, session.previousMessages...)
}
}

Expand Down

0 comments on commit 242b015

Please sign in to comment.