Skip to content

Commit

Permalink
Workaround fix for #526 - ignore presences from people with malformed…
Browse files Browse the repository at this point in the history
… JIDs
  • Loading branch information
olabini committed Mar 22, 2019
1 parent 17d726f commit e64ebeb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,13 @@ func (s *session) receivedClientPresence(stanza *data.ClientPresence) bool {
Gone: true,
})
case "":
if jj.NoResource().String() == jj.String() {
// This happens if a malfunctioning client/server is
// sending presence information without a resource.
// This is likely a bug
s.warn(fmt.Sprintf("Got a presence without resource in 'from' - this is likely an error: %s - %#v\n", stanza.From, stanza))
return true
}
if !s.r.PeerPresenceUpdate(jj.(jid.WithResource), stanza.Show, stanza.Status, s.GetConfig().ID()) {
return true
}
Expand Down

0 comments on commit e64ebeb

Please sign in to comment.