~singpolyma/cheogram

89e1a3ba8d3dd7621be13bc7c6a72cdc6845ceeb — Stephen Paul Weber 2 months ago 13b6fbf
Indicate what jid to reply to
1 files changed, 3 insertions(+), 1 deletions(-)

M Main.hs
M Main.hs => Main.hs +3 -1
@@ 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' :