From d383fa31ae88d3f021b0156ed4ea5cc12711aafe Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Sat, 26 Nov 2022 15:48:29 +0100 Subject: [PATCH] fix: Fix LMC not working --- packages/moxxmpp/lib/moxxmpp.dart | 1 + packages/moxxmpp/lib/src/xeps/xep_0308.dart | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/moxxmpp/lib/moxxmpp.dart b/packages/moxxmpp/lib/moxxmpp.dart index c57e057..9096101 100644 --- a/packages/moxxmpp/lib/moxxmpp.dart +++ b/packages/moxxmpp/lib/moxxmpp.dart @@ -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'; diff --git a/packages/moxxmpp/lib/src/xeps/xep_0308.dart b/packages/moxxmpp/lib/src/xeps/xep_0308.dart index d58bddd..3418698 100644 --- a/packages/moxxmpp/lib/src/xeps/xep_0308.dart +++ b/packages/moxxmpp/lib/src/xeps/xep_0308.dart @@ -30,8 +30,8 @@ class LastMessageCorrectionManager extends XmppManagerBase { List 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 isSupported() async => true; Future _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, );