diff options
author | Joey Hess <joey@kitenet.net> | 2012-11-05 17:54:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-11-05 17:54:21 -0400 |
commit | b3d1a85c2068d42d5399fa659dc94735664da579 (patch) | |
tree | b85a58747abf3060d081f4c0fd248dcbff97942c /Assistant/Threads/XMPPClient.hs | |
parent | 8ce7c0d0dc4b95a28c6f4fb4e770522bdd2524e2 (diff) |
ignore Messages from our client's own jid
shouldn't ever happen, but hey
Diffstat (limited to 'Assistant/Threads/XMPPClient.hs')
-rw-r--r-- | Assistant/Threads/XMPPClient.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Assistant/Threads/XMPPClient.hs b/Assistant/Threads/XMPPClient.hs index 3ef701851..3d454d9c8 100644 --- a/Assistant/Threads/XMPPClient.hs +++ b/Assistant/Threads/XMPPClient.hs @@ -105,7 +105,7 @@ xmppClientThread urlrenderer = NamedThread "XMPPClient" $ do data XMPPEvent = GotNetMessage NetMessage | PresenceMessage Presence - | Ignorable Presence + | Ignorable ReceivedStanza | Unknown ReceivedStanza | ProtocolError ReceivedStanza deriving Show @@ -114,8 +114,8 @@ data XMPPEvent decodeStanza :: JID -> ReceivedStanza -> [XMPPEvent] decodeStanza selfjid s@(ReceivedPresence p) | presenceType p == PresenceError = [ProtocolError s] - | presenceFrom p == Nothing = [Ignorable p] - | presenceFrom p == Just selfjid = [Ignorable p] + | presenceFrom p == Nothing = [Ignorable s] + | presenceFrom p == Just selfjid = [Ignorable s] | otherwise = maybe [PresenceMessage p] decode (getGitAnnexAttrValue p) where decode (attr, v) @@ -126,7 +126,9 @@ decodeStanza selfjid s@(ReceivedPresence p) {- Things sent via presence imply a presence message, - along with their real meaning. -} impliedp v = [PresenceMessage p, v] -decodeStanza _ s@(ReceivedMessage m) +decodeStanza selfjid s@(ReceivedMessage m) + | messageFrom m == Nothing = [Ignorable s] + | messageFrom m == Just selfjid = [Ignorable s] | messageType m == MessageError = [ProtocolError s] | otherwise = maybe [Unknown s] decode (getGitAnnexAttrValue m) where |