From da591a552d045739bbd3359c1d286ac080c1bffb Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Tue, 16 May 2023 19:06:50 +0200 Subject: [PATCH] fix(xep): Fix discovery of XEP-0191 and XEP-0280 --- packages/moxxmpp/lib/src/settings.dart | 3 +++ packages/moxxmpp/lib/src/xeps/xep_0191.dart | 2 +- packages/moxxmpp/lib/src/xeps/xep_0280.dart | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/moxxmpp/lib/src/settings.dart b/packages/moxxmpp/lib/src/settings.dart index 22bd7f3..b76c041 100644 --- a/packages/moxxmpp/lib/src/settings.dart +++ b/packages/moxxmpp/lib/src/settings.dart @@ -19,4 +19,7 @@ class ConnectionSettings { /// The port to connect to. Skips DNS resolution if specified. final int? port; + + /// The JID of the server we're connected to. + JID get serverJid => JID('', jid.domain, ''); } diff --git a/packages/moxxmpp/lib/src/xeps/xep_0191.dart b/packages/moxxmpp/lib/src/xeps/xep_0191.dart index e8a96e5..3c310b7 100644 --- a/packages/moxxmpp/lib/src/xeps/xep_0191.dart +++ b/packages/moxxmpp/lib/src/xeps/xep_0191.dart @@ -37,7 +37,7 @@ class BlockingManager extends XmppManagerBase { // Query the server final disco = getAttributes().getManagerById(discoManager)!; _supported = await disco.supportsFeature( - getAttributes().getConnectionSettings().jid.toBare(), + getAttributes().getConnectionSettings().serverJid, blockingXmlns, ); _gotSupported = true; diff --git a/packages/moxxmpp/lib/src/xeps/xep_0280.dart b/packages/moxxmpp/lib/src/xeps/xep_0280.dart index 3153dd1..f767f8b 100644 --- a/packages/moxxmpp/lib/src/xeps/xep_0280.dart +++ b/packages/moxxmpp/lib/src/xeps/xep_0280.dart @@ -53,7 +53,7 @@ class CarbonsManager extends XmppManagerBase { // Query the server final disco = getAttributes().getManagerById(discoManager)!; _supported = await disco.supportsFeature( - getAttributes().getConnectionSettings().jid.toBare(), + getAttributes().getConnectionSettings().serverJid, carbonsXmlns, ); _gotSupported = true;