feat(xep): Checked for the occupant-id directly.
Signed-off-by: Ikjot Singh Dhody <ikjotsd@gmail.com>
This commit is contained in:
parent
ac5bb9e461
commit
fa11a3a384
@ -39,6 +39,8 @@ class OccupantIdManager extends XmppManagerBase {
|
||||
List<StanzaHandler> getIncomingStanzaHandlers() => [
|
||||
StanzaHandler(
|
||||
stanzaTag: 'message',
|
||||
tagName: 'occupant-id',
|
||||
tagXmlns: occupantIdXmlns,
|
||||
callback: _onMessage,
|
||||
// Before the MessageManager
|
||||
priority: -99,
|
||||
@ -52,15 +54,7 @@ class OccupantIdManager extends XmppManagerBase {
|
||||
Stanza stanza,
|
||||
StanzaHandlerData state,
|
||||
) async {
|
||||
OccupantIdData? occupantId;
|
||||
final occupantIdElement =
|
||||
stanza.firstTag('occupant-id', xmlns: occupantIdXmlns);
|
||||
// Process the occupant id
|
||||
if (occupantIdElement != null) {
|
||||
occupantId =
|
||||
OccupantIdData(occupantIdElement.attributes['id']! as String);
|
||||
state.extensions.set(occupantId);
|
||||
}
|
||||
state.extensions.set(OccupantIdData(stanza.attributes['id']! as String));
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user