Skip to content

Commit acd71c3

Browse files
author
Sebastian Kippe
committed
Fix exception on room presence stanza
Our XMPP server sends presence stanzas for the room itself, in addition to normal user presence ones. Which resulted in an exception, when the code tried to access the non-existent "resource" part of the JID, which would usually contain the username/nickname.
1 parent 486265e commit acd71c3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/xmpp.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,11 @@ class XmppBot extends Adapter
346346
room = fromJID.bare().toString()
347347
return if not @messageFromRoom room
348348

349+
# Some servers send presence for the room itself, which needs to be
350+
# ignored
351+
if room is fromJID.toString()
352+
return
353+
349354
# Try to resolve the private JID
350355
privateChatJID = @resolvePrivateJID(stanza)
351356

0 commit comments

Comments
 (0)