From 89e1a3ba8d3dd7621be13bc7c6a72cdc6845ceeb Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 3 Jul 2024 11:25:51 -0500 Subject: [PATCH] Indicate what jid to reply to --- Main.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Main.hs b/Main.hs index 39ea787..b26c145 100644 --- a/Main.hs +++ b/Main.hs @@ -1675,8 +1675,10 @@ groupTextPorcelein host m@(Message { messagePayloads = p, messageFrom = Just fro Just fromTel <- strNode <$> jidNode from, Just tels <- fmap (textToString fromTel:) $ mapM (fmap uriPath . parseURI . textToString <=< attributeText (s"uri")) uris = let + fromTxt = fromString (intercalate "," (sort tels)) ++ (s"@") ++ host addresses' = addresses { elementNodes = (XML.NodeElement (XML.Element (s"{http://jabber.org/protocol/address}address") [(s"type", [s"ofrom"]), (s"jid", [XML.ContentText $ fromTel ++ s"@" ++ host])] [])) : + (XML.NodeElement (XML.Element (s"{http://jabber.org/protocol/address}address") [(s"type", [s"replyto"]), (s"jid", [XML.ContentText $ fromTxt])] [])) : concatMap (\el -> if null $ isNamed (s"{http://jabber.org/protocol/address}address") el then [XML.NodeElement el] else maybe [] (\attrs -> [XML.NodeElement $ el { elementAttributes = attrs }]) $ sequence $ map (\(attr, content) -> @@ -1691,7 +1693,7 @@ groupTextPorcelein host m@(Message { messagePayloads = p, messageFrom = Just fro in Just $ m { messageTo = Just to, - messageFrom = parseJID (fromString (intercalate "," (sort tels)) ++ (s"@") ++ host), + messageFrom = parseJID fromTxt, messagePayloads = body' : addresses' : -- 2.45.2