Skip to content

Commit

Permalink
fix: muc compatibility when mod_vcard module in ejabberd is enabled
Browse files Browse the repository at this point in the history
also changed roster query to prevent (theoretical) similar issues there.
  • Loading branch information
trampi committed May 31, 2019
1 parent f9f6975 commit 6873ba6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ export class MultiUserChatPlugin extends AbstractXmppPlugin {
}

private isRoomPresenceStanza(stanza: Stanza) {
return stanza.name === 'presence'
&& stanza.getChild('x')
&& stanza.getChild('x').attrs.xmlns
&& stanza.getChild('x').attrs.xmlns.startsWith('http://jabber.org/protocol/muc');
return stanza.name === 'presence' && (
stanza.getChild('x', 'http://jabber.org/protocol/muc')
|| stanza.getChild('x', 'http://jabber.org/protocol/muc#user')
);
}

private handleRoomPresenceStanza(stanza: Stanza): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ export class RosterPlugin extends AbstractXmppPlugin {
}

private isRosterPushStanza(stanza: Stanza) {
const queryChild = stanza.getChild('query');
return stanza.name === 'iq'
&& stanza.attrs.type === 'set'
&& queryChild && queryChild.attrs.xmlns === 'jabber:iq:roster';
&& stanza.getChild('query', 'jabber:iq:roster');
}

private handleRosterPushStanza(stanza: Stanza) {
Expand Down

0 comments on commit 6873ba6

Please sign in to comment.