diff options
author | Joe Crayne <joe@jerkface.net> | 2018-11-26 02:13:32 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2018-12-16 14:08:26 -0500 |
commit | 7e1dff874444dcc4e1e15adb2ef5bd0946526519 (patch) | |
tree | 7eec596fd7cf471c6948f270dada7ebc1c038e21 | |
parent | ede92a91a5fec26072b1f98e3a8fe13e322caaf5 (diff) |
Add groupname to xmpp <reason> field.
-rw-r--r-- | ToxToXMPP.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ToxToXMPP.hs b/ToxToXMPP.hs index 65faff9d..4814553d 100644 --- a/ToxToXMPP.hs +++ b/ToxToXMPP.hs | |||
@@ -74,7 +74,9 @@ toxToXmpp laddr me theirhost = do | |||
74 | xmppInstantMessage "jabber:server" im_from im_to | 74 | xmppInstantMessage "jabber:server" im_from im_to |
75 | [ attr "style" "font-weight:bold; color:red" ] | 75 | [ attr "style" "font-weight:bold; color:red" ] |
76 | ("INVITE(todo)" <> (T.pack $ show ginv)) | 76 | ("INVITE(todo)" <> (T.pack $ show ginv)) |
77 | xmppInvite "jabber:server" me_h (fromJust im_from) (fromJust im_to) ginv | 77 | case invite ginv of |
78 | GroupInvite {} -> xmppInvite "jabber:server" me_h (fromJust im_from) (fromJust im_to) ginv | ||
79 | _ -> return () | ||
78 | 80 | ||
79 | toxmsg -> do | 81 | toxmsg -> do |
80 | xmppInstantMessage "jabber:server" im_from im_to | 82 | xmppInstantMessage "jabber:server" im_from im_to |
@@ -145,6 +147,9 @@ xmppInvite namespace me them to inv = | |||
145 | , EventBeginElement "{http://jabber.org/protocol/muc#user}x" [] | 147 | , EventBeginElement "{http://jabber.org/protocol/muc#user}x" [] |
146 | , EventBeginElement "{http://jabber.org/protocol/muc#user}invite" | 148 | , EventBeginElement "{http://jabber.org/protocol/muc#user}invite" |
147 | [ attr "from" them ] | 149 | [ attr "from" them ] |
150 | , EventBeginElement "{http://jabber.org/protocol/muc#user}reason" [] | ||
151 | , EventContent (ContentText $ groupName $ invite inv) | ||
152 | , EventEndElement "{http://jabber.org/protocol/muc#user}reason" | ||
148 | , EventEndElement "{http://jabber.org/protocol/muc#user}invite" | 153 | , EventEndElement "{http://jabber.org/protocol/muc#user}invite" |
149 | , EventEndElement "{http://jabber.org/protocol/muc#user}x" | 154 | , EventEndElement "{http://jabber.org/protocol/muc#user}x" |
150 | , EventEndElement (ns "message") | 155 | , EventEndElement (ns "message") |