about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-11-08 21:04:07 +0000
committerJames Booth <boothj5@gmail.com>2012-11-08 21:04:07 +0000
commitca40405d2adc868ec1cdf9746e6b0580010e28f4 (patch)
tree490c363c57568b0d76ef6bae55a652798c5f52c3 /src
parent3dd15755490ea6a6e99e965bbc791e9269fbd368 (diff)
downloadprofani-tty-ca40405d2adc868ec1cdf9746e6b0580010e28f4.tar.gz
Do not show chat state notifications when <delay/> present
Diffstat (limited to 'src')
-rw-r--r--src/jabber.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/jabber.c b/src/jabber.c
index 24dd2915..6c513f91 100644
--- a/src/jabber.c
+++ b/src/jabber.c
@@ -489,8 +489,14 @@ _chat_message_handler(xmpp_stanza_t * const stanza)
         chat_session_set_recipient_supports(short_from, recipient_supports);
     }
 
+    gboolean historic_notification = FALSE;
+    // determine if the notifications happened whilst offline
+    if (xmpp_stanza_get_child_by_name(stanza, "delay") != NULL) {
+        historic_notification = TRUE;
+    }
+
     // deal with chat states if recipient supports them
-    if (recipient_supports) {
+    if (recipient_supports && !historic_notification) {
         if (xmpp_stanza_get_child_by_name(stanza, "composing") != NULL) {
             if (prefs_get_notify_typing() || prefs_get_intype()) {
                 prof_handle_typing(short_from);