summaryrefslogtreecommitdiff
path: root/XMPPToTox.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-06-26 19:25:43 -0400
committerjoe <joe@jerkface.net>2018-06-26 19:25:43 -0400
commitf5ba0d8785440d048ec3622a09ce421e702b3bc1 (patch)
tree961fed26d121a5e5362d02d1a131ba7adcfe0a0d /XMPPToTox.hs
parent2b2627f11e4f7544d86c78a474872f02665ef109 (diff)
xmpp-to-tox: Improved "typing" state notifications.
Diffstat (limited to 'XMPPToTox.hs')
-rw-r--r--XMPPToTox.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/XMPPToTox.hs b/XMPPToTox.hs
index 7ca4330e..ae9a774b 100644
--- a/XMPPToTox.hs
+++ b/XMPPToTox.hs
@@ -23,7 +23,9 @@ funnyMessage :: MonadThrow m => Text -> ConduitM i CryptoMessage m ()
23funnyMessage txt = yield $ UpToN Padding (T.encodeUtf8 txt) 23funnyMessage txt = yield $ UpToN Padding (T.encodeUtf8 txt)
24 24
25sendMsg :: MonadThrow m => Text -> ConduitM i CryptoMessage m () 25sendMsg :: MonadThrow m => Text -> ConduitM i CryptoMessage m ()
26sendMsg txt = yield $ UpToN MESSAGE (T.encodeUtf8 txt) 26sendMsg txt = do
27 yield $ UpToN MESSAGE (T.encodeUtf8 txt)
28 yield $ TwoByte TYPING 0 -- Message send implies not typing.
27 29
28 30
29eom :: MonadThrow m => ConduitM Event o m () 31eom :: MonadThrow m => ConduitM Event o m ()
@@ -42,6 +44,9 @@ msgToTox = tag' "{jabber:server}message"
42 , tagIgnoreAttrs "{http://jabber.org/protocol/chatstates}composing" 44 , tagIgnoreAttrs "{http://jabber.org/protocol/chatstates}composing"
43 $ do yield $ TwoByte TYPING 1 45 $ do yield $ TwoByte TYPING 1
44 eom 46 eom
47 , tagIgnoreAttrs "{http://jabber.org/protocol/chatstates}active"
48 $ do yield $ TwoByte TYPING 0
49 eom
45 , tagIgnoreAttrs "{http://jabber.org/protocol/chatstates}paused" 50 , tagIgnoreAttrs "{http://jabber.org/protocol/chatstates}paused"
46 $ do yield $ TwoByte TYPING 0 51 $ do yield $ TwoByte TYPING 0
47 eom 52 eom