From 6205bbb45319677c7a231a4857993d640d8adb4a Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 15 Nov 2022 15:02:28 -0500 Subject: [PATCH] If asked for all avatar items, do that too --- Main.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main.hs b/Main.hs index 3db6405..ecb2b73 100644 --- a/Main.hs +++ b/Main.hs @@ -866,9 +866,9 @@ componentStanza (ComponentContext { maybeAvatar = Just (Avatar hash _ b64) }) (R elementChildren =<< isNamed (s"{http://jabber.org/protocol/pubsub}pubsub") p, attributeText (s"node") items == Just (s"urn:xmpp:avatar:data"), - [item] <- isNamed (s"{http://jabber.org/protocol/pubsub}item") =<< + item <- headZ $ isNamed (s"{http://jabber.org/protocol/pubsub}item") =<< elementChildren items, - attributeText (s"id") item == Just hash = + isNothing item || (attributeText (s"id") =<< item) == Just hash = return [mkStanzaRec $ iqReply (Just $ XML.Element (s"{http://jabber.org/protocol/pubsub}pubsub") [] [ XML.NodeElement $ XML.Element (s"{http://jabber.org/protocol/pubsub}items") -- 2.45.2