summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-01-02 21:19:30 -0500
committerjoe <joe@jerkface.net>2014-01-02 21:19:30 -0500
commit9fb56130da969267a7f002e1b1db64a482a3b746 (patch)
treece230913e3f25acdd082cfea2ec1d6257505df00
parent945898c49a741636a60dbe859a6f4f1259b3543d (diff)
Debug prints when a console message should be written.
-rw-r--r--Presence/main.hs27
1 files changed, 13 insertions, 14 deletions
diff --git a/Presence/main.hs b/Presence/main.hs
index f0dfc9bd..9d359292 100644
--- a/Presence/main.hs
+++ b/Presence/main.hs
@@ -541,20 +541,19 @@ instance JabberPeerSession PeerSession where
541 (good_rs,other_rs) = partition (\((_,r),_)->r==rsc') goodtos 541 (good_rs,other_rs) = partition (\((_,r),_)->r==rsc') goodtos
542 542
543 -- new behavior that sends to all available resources 543 -- new behavior that sends to all available resources
544 mapM_ send good_rs 544 mapM_ send good_rs -- prefered destination (exact resource match)
545 mapM_ send other_rs 545 mapM_ send other_rs -- other clients
546 -- TODO: test good_rs and other_rs for null and handle appropriately 546 let msgHere = localizedBody msg
547 {- 547 msgElsewhere = "you have chat on "++show (snd . fst . head $ other_rs)
548 -- Old behavior that only sends to a single resource 548 localizedBody msg = "TODO"
549 case Map.lookup (nto,rsc') cmap of 549 case (good_rs,other_rs) of
550 Just (ttypid,clients) -> 550 ([],[]) -> consoleMessage rsc' msgHere -- dump message to console
551 forM_ (Map.toList clients) $ \(pid,client) -> do 551 ([],_) -> consoleMessage rsc' msgElsewhere -- notify: was sent to other tty
552 atomically $ writeTChan (clientChan client) (Chat msg) 552 _ -> return ()
553 Nothing -> 553
554 -- todo: fallback 554consoleMessage tty str = do
555 return () 555 debugStr $ L.unpack tty ++ ": "++ str
556 -} 556 return ()
557
558 557
559type RefCount = Int 558type RefCount = Int
560 559