diff options
author | Joey Hess <joey@kitenet.net> | 2012-11-03 16:00:38 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-11-03 16:01:09 -0400 |
commit | efa88a0f1589a82a91a06ed3a3cbd5f4106aabb4 (patch) | |
tree | 013133783caef5e5f693b2734024935fd494551b /Assistant/XMPP/Buddies.hs | |
parent | 2798e659c701a3c6122930ece994411b3ec8b266 (diff) |
XMPP pairing notifications are now sent
Rest of pairing process still to do.
Diffstat (limited to 'Assistant/XMPP/Buddies.hs')
-rw-r--r-- | Assistant/XMPP/Buddies.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Assistant/XMPP/Buddies.hs b/Assistant/XMPP/Buddies.hs index 217870dc6..d784f316d 100644 --- a/Assistant/XMPP/Buddies.hs +++ b/Assistant/XMPP/Buddies.hs @@ -23,15 +23,17 @@ genBuddyID j = BuddyID $ formatJID j genKey :: JID -> BuddyKey genKey j = BuddyKey $ formatJID $ JID (jidNode j) (jidDomain j) Nothing +buddyName :: JID -> Text +buddyName j = maybe (T.pack "") strNode (jidNode j) + {- Summary of info about a buddy. - - If the buddy has no clients at all anymore, returns Nothing. -} buddySummary :: Buddy -> Maybe (Text, Bool, Bool, BuddyID) buddySummary b = case clients of - ((Client j):_) -> Just (buddyname j, away, canpair, genBuddyID j) + ((Client j):_) -> Just (buddyName j, away, canpair, genBuddyID j) [] -> Nothing where - buddyname j = maybe (T.pack "") strNode (jidNode j) away = S.null (buddyPresent b) && S.null (buddyAssistants b) canpair = not $ S.null (buddyAssistants b) clients = S.toList $ buddyPresent b `S.union` buddyAway b `S.union` buddyAssistants b |