~singpolyma/cheogram

6205bbb45319677c7a231a4857993d640d8adb4a — Stephen Paul Weber 1 year, 13 days ago a08cca4
If asked for all avatar items, do that too
1 files changed, 2 insertions(+), 2 deletions(-)

M Main.hs
M Main.hs => Main.hs +2 -2
@@ 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")