diff --git a/projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.ts b/projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.ts index 4cb5e87a..952749d7 100644 --- a/projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.ts +++ b/projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.ts @@ -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 { diff --git a/projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/roster.plugin.ts b/projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/roster.plugin.ts index 3551c597..7a551497 100644 --- a/projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/roster.plugin.ts +++ b/projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/roster.plugin.ts @@ -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) {