fix: Fix LMC not working
This commit is contained in:
parent
d1de394cd9
commit
d383fa31ae
@ -59,6 +59,7 @@ export 'package:moxxmpp/src/xeps/xep_0203.dart';
|
||||
export 'package:moxxmpp/src/xeps/xep_0280.dart';
|
||||
export 'package:moxxmpp/src/xeps/xep_0297.dart';
|
||||
export 'package:moxxmpp/src/xeps/xep_0300.dart';
|
||||
export 'package:moxxmpp/src/xeps/xep_0308.dart';
|
||||
export 'package:moxxmpp/src/xeps/xep_0333.dart';
|
||||
export 'package:moxxmpp/src/xeps/xep_0334.dart';
|
||||
export 'package:moxxmpp/src/xeps/xep_0352.dart';
|
||||
|
@ -30,8 +30,8 @@ class LastMessageCorrectionManager extends XmppManagerBase {
|
||||
List<StanzaHandler> getIncomingStanzaHandlers() => [
|
||||
StanzaHandler(
|
||||
stanzaTag: 'message',
|
||||
tagName: 'reply',
|
||||
tagXmlns: replyXmlns,
|
||||
tagName: 'replace',
|
||||
tagXmlns: lmcXmlns,
|
||||
callback: _onMessage,
|
||||
// Before the message handler
|
||||
priority: -99,
|
||||
@ -42,9 +42,7 @@ class LastMessageCorrectionManager extends XmppManagerBase {
|
||||
Future<bool> isSupported() async => true;
|
||||
|
||||
Future<StanzaHandlerData> _onMessage(Stanza stanza, StanzaHandlerData state) async {
|
||||
final edit = stanza.firstTag('replace', xmlns: lmcXmlns);
|
||||
if (edit == null) return state;
|
||||
|
||||
final edit = stanza.firstTag('replace', xmlns: lmcXmlns)!;
|
||||
return state.copyWith(
|
||||
lastMessageCorrectionSid: edit.attributes['id']! as String,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user