Skip to content

Commit

Permalink
fix for tinode#579
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Dec 12, 2020
1 parent af8d7ba commit 1ab545c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/init_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ func initTopicP2P(t *Topic, sreg *sessionJoin) error {
userID1 := types.ParseUserId(sreg.pkt.AsUser)
// The other user.
userID2 := types.ParseUserId(t.xoriginal)
// User index: u1 - requester, u2 - responder, the other user

// User index: u1 - requester, u2 - responder, the other user
var u1, u2 int
users, err := store.Users.GetAll(userID1, userID2)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions server/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ func (s *Session) dispatch(msg *ClientComMessage) {
s.queueOut(ErrMalformed("", "", msg.Timestamp))
log.Println("s.dispatch: malformed msg.from: ", msg.AsUser, s.sid)
return
} else if auth.Level(msg.AuthLvl) == auth.LevelNone {
// AuthLvl is not set by caller, assign default LevelAuth.
msg.AuthLvl = int(auth.LevelAuth)
}

var resp *ServerComMessage
Expand Down

0 comments on commit 1ab545c

Please sign in to comment.