summaryrefslogtreecommitdiff
path: root/Assistant/Types
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-03 17:34:19 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-03 17:46:22 -0400
commitbc94dde8f6c5d7ca213fa81a6c03a4c9e22e16d5 (patch)
tree9a5384d53b222577004ce2cbe8b1540a5e3f2e90 /Assistant/Types
parentefa88a0f1589a82a91a06ed3a3cbd5f4106aabb4 (diff)
XMPP pair requests are now received, and an alert displayed
Diffstat (limited to 'Assistant/Types')
-rw-r--r--Assistant/Types/Buddies.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Assistant/Types/Buddies.hs b/Assistant/Types/Buddies.hs
index 9c070aa6a..3e7ecec62 100644
--- a/Assistant/Types/Buddies.hs
+++ b/Assistant/Types/Buddies.hs
@@ -38,11 +38,11 @@ data Buddy
#endif
deriving (Eq, Show)
-data BuddyID = BuddyID T.Text
+data BuddyKey = BuddyKey T.Text
deriving (Eq, Ord, Show, Read)
-data BuddyKey = BuddyKey T.Text
- deriving (Eq, Ord, Show)
+data PairKey = PairKey UUID T.Text
+ deriving (Eq, Ord, Show, Read)
type Buddies = M.Map BuddyKey Buddy
@@ -60,6 +60,9 @@ newBuddyList = (,)
getBuddyList :: BuddyList -> IO [Buddy]
getBuddyList (v, _) = M.elems <$> atomically (readTMVar v)
+getBuddy :: BuddyKey -> BuddyList -> IO (Maybe Buddy)
+getBuddy k (v, _) = M.lookup k <$> atomically (readTMVar v)
+
getBuddyBroadcaster :: BuddyList -> NotificationBroadcaster
getBuddyBroadcaster (_, h) = h