feat(xep): Use cascading operation to return state
Signed-off-by: Ikjot Singh Dhody <ikjotsd@gmail.com>
This commit is contained in:
parent
fa11a3a384
commit
255d0f88e0
@ -3,6 +3,7 @@ import 'package:moxxmpp/src/managers/base.dart';
|
|||||||
import 'package:moxxmpp/src/managers/data.dart';
|
import 'package:moxxmpp/src/managers/data.dart';
|
||||||
import 'package:moxxmpp/src/managers/handlers.dart';
|
import 'package:moxxmpp/src/managers/handlers.dart';
|
||||||
import 'package:moxxmpp/src/managers/namespaces.dart';
|
import 'package:moxxmpp/src/managers/namespaces.dart';
|
||||||
|
import 'package:moxxmpp/src/message.dart';
|
||||||
import 'package:moxxmpp/src/namespaces.dart';
|
import 'package:moxxmpp/src/namespaces.dart';
|
||||||
import 'package:moxxmpp/src/stanza.dart';
|
import 'package:moxxmpp/src/stanza.dart';
|
||||||
import 'package:moxxmpp/src/stringxml.dart';
|
import 'package:moxxmpp/src/stringxml.dart';
|
||||||
@ -43,7 +44,7 @@ class OccupantIdManager extends XmppManagerBase {
|
|||||||
tagXmlns: occupantIdXmlns,
|
tagXmlns: occupantIdXmlns,
|
||||||
callback: _onMessage,
|
callback: _onMessage,
|
||||||
// Before the MessageManager
|
// Before the MessageManager
|
||||||
priority: -99,
|
priority: MessageManager.messageHandlerPriority + 1,
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -54,7 +55,7 @@ class OccupantIdManager extends XmppManagerBase {
|
|||||||
Stanza stanza,
|
Stanza stanza,
|
||||||
StanzaHandlerData state,
|
StanzaHandlerData state,
|
||||||
) async {
|
) async {
|
||||||
state.extensions.set(OccupantIdData(stanza.attributes['id']! as String));
|
return state
|
||||||
return state;
|
..extensions.set(OccupantIdData(stanza.attributes['id']! as String));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user