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_0280.dart';
|
||||||
export 'package:moxxmpp/src/xeps/xep_0297.dart';
|
export 'package:moxxmpp/src/xeps/xep_0297.dart';
|
||||||
export 'package:moxxmpp/src/xeps/xep_0300.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_0333.dart';
|
||||||
export 'package:moxxmpp/src/xeps/xep_0334.dart';
|
export 'package:moxxmpp/src/xeps/xep_0334.dart';
|
||||||
export 'package:moxxmpp/src/xeps/xep_0352.dart';
|
export 'package:moxxmpp/src/xeps/xep_0352.dart';
|
||||||
|
@ -30,8 +30,8 @@ class LastMessageCorrectionManager extends XmppManagerBase {
|
|||||||
List<StanzaHandler> getIncomingStanzaHandlers() => [
|
List<StanzaHandler> getIncomingStanzaHandlers() => [
|
||||||
StanzaHandler(
|
StanzaHandler(
|
||||||
stanzaTag: 'message',
|
stanzaTag: 'message',
|
||||||
tagName: 'reply',
|
tagName: 'replace',
|
||||||
tagXmlns: replyXmlns,
|
tagXmlns: lmcXmlns,
|
||||||
callback: _onMessage,
|
callback: _onMessage,
|
||||||
// Before the message handler
|
// Before the message handler
|
||||||
priority: -99,
|
priority: -99,
|
||||||
@ -42,9 +42,7 @@ class LastMessageCorrectionManager extends XmppManagerBase {
|
|||||||
Future<bool> isSupported() async => true;
|
Future<bool> isSupported() async => true;
|
||||||
|
|
||||||
Future<StanzaHandlerData> _onMessage(Stanza stanza, StanzaHandlerData state) async {
|
Future<StanzaHandlerData> _onMessage(Stanza stanza, StanzaHandlerData state) async {
|
||||||
final edit = stanza.firstTag('replace', xmlns: lmcXmlns);
|
final edit = stanza.firstTag('replace', xmlns: lmcXmlns)!;
|
||||||
if (edit == null) return state;
|
|
||||||
|
|
||||||
return state.copyWith(
|
return state.copyWith(
|
||||||
lastMessageCorrectionSid: edit.attributes['id']! as String,
|
lastMessageCorrectionSid: edit.attributes['id']! as String,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user