summaryrefslogtreecommitdiff
path: root/Presence
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-05-29 18:26:25 -0400
committerjoe <joe@jerkface.net>2018-05-29 18:26:25 -0400
commit71f7ca88339f1793f21fecbd36e84f6e18e915bd (patch)
tree506d1f2528d0271a55e64ef546edecb540fe6816 /Presence
parent620fdb0a2a6a80427895e4a40b9de3ec792c8d7c (diff)
WIP: Deliver friend-request to xmpp client.
Diffstat (limited to 'Presence')
-rw-r--r--Presence/Presence.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/Presence/Presence.hs b/Presence/Presence.hs
index 41204818..adae567a 100644
--- a/Presence/Presence.hs
+++ b/Presence/Presence.hs
@@ -109,7 +109,7 @@ data PresenceState = forall status. PresenceState
109 109
110 110
111newPresenceState :: Maybe ConsoleWriter 111newPresenceState :: Maybe ConsoleWriter
112 -> Maybe (ToxManager ConnectionKey) 112 -> Maybe (PresenceState -> ToxManager ConnectionKey)
113 -> TMVar (XMPPServer, Connection.Manager status Text) 113 -> TMVar (XMPPServer, Connection.Manager status Text)
114 -> IO PresenceState 114 -> IO PresenceState
115newPresenceState cw toxman xmpp = atomically $ do 115newPresenceState cw toxman xmpp = atomically $ do
@@ -117,15 +117,16 @@ newPresenceState cw toxman xmpp = atomically $ do
117 clientsByUser <- newTVar Map.empty 117 clientsByUser <- newTVar Map.empty
118 remotesByPeer <- newTVar Map.empty 118 remotesByPeer <- newTVar Map.empty
119 keyToChan <- newTVar Map.empty 119 keyToChan <- newTVar Map.empty
120 return PresenceState 120 let st = PresenceState
121 { clients = clients 121 { clients = clients
122 , clientsByUser = clientsByUser 122 , clientsByUser = clientsByUser
123 , remotesByPeer = remotesByPeer 123 , remotesByPeer = remotesByPeer
124 , keyToChan = keyToChan 124 , keyToChan = keyToChan
125 , server = xmpp 125 , server = xmpp
126 , consoleWriter = cw 126 , consoleWriter = cw
127 , toxManager = toxman 127 , toxManager = Nothing
128 } 128 }
129 return $ st { toxManager = fmap ($ st) toxman }
129 130
130 131
131nameForClient :: PresenceState -> ConnectionKey -> IO Text 132nameForClient :: PresenceState -> ConnectionKey -> IO Text