From 925a46c0da7f548a68d0a93eef97ca93125c6021 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Fri, 9 Jun 2023 00:07:05 +0200 Subject: [PATCH] feat(xep): Move to JID --- packages/moxxmpp/lib/src/xeps/xep_0054.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/moxxmpp/lib/src/xeps/xep_0054.dart b/packages/moxxmpp/lib/src/xeps/xep_0054.dart index 19d0717..e38d3d0 100644 --- a/packages/moxxmpp/lib/src/xeps/xep_0054.dart +++ b/packages/moxxmpp/lib/src/xeps/xep_0054.dart @@ -56,17 +56,17 @@ class VCardManager extends XmppManagerBase { final x = presence.firstTag('x', xmlns: vCardTempUpdate)!; final hash = x.firstTag('photo')!.innerText(); - final from = JID.fromString(presence.from!).toBare().toString(); + final from = JID.fromString(presence.from!).toBare(); final lastHash = _lastHash[from]; if (lastHash != hash) { - _lastHash[from] = hash; + _lastHash[from.toString()] = hash; final vcardResult = await requestVCard(from); if (vcardResult.isType()) { final binval = vcardResult.get().photo?.binval; if (binval != null) { getAttributes().sendEvent( - VCardAvatarUpdatedEvent(JID.fromString(from), binval, hash), + VCardAvatarUpdatedEvent(from, binval, hash), ); } else { logger.warning('No avatar data found'); @@ -98,11 +98,11 @@ class VCardManager extends XmppManagerBase { ); } - Future> requestVCard(String jid) async { + Future> requestVCard(JID jid) async { final result = (await getAttributes().sendStanza( StanzaDetails( Stanza.iq( - to: jid, + to: jid.toString(), type: 'get', children: [ XMLNode.xmlns(