diff options
author | James Booth <boothj5@gmail.com> | 2014-05-24 21:13:33 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-05-24 21:13:33 +0100 |
commit | b25b3f318036e6b14d52fef5a4f418a36d9b5a64 (patch) | |
tree | 64390020af43f1435e2bd214a2870c07db8b3168 /src/ui | |
parent | eb0f0dd96b368424a1f2344d23c67c1e8934aae4 (diff) | |
download | profani-tty-b25b3f318036e6b14d52fef5a4f418a36d9b5a64.tar.gz |
Added notification setting for typing in current window
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/console.c | 5 | ||||
-rw-r--r-- | src/ui/core.c | 17 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/ui/console.c b/src/ui/console.c index 1afd0a49..e7ca07a1 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -1181,6 +1181,11 @@ _cons_notify_setting(void) else cons_show("Composing (/notify typing) : OFF"); + if (prefs_get_boolean(PREF_NOTIFY_TYPING_CURRENT)) + cons_show("Composing current (/notify typing) : ON"); + else + cons_show("Composing current (/notify typing) : OFF"); + if (prefs_get_boolean(PREF_NOTIFY_INVITE)) cons_show("Room invites (/notify invite) : ON"); else diff --git a/src/ui/core.c b/src/ui/core.c index 8f554f5b..7b3190ed 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -277,14 +277,17 @@ _ui_contact_typing(const char * const barejid) } if (prefs_get_boolean(PREF_NOTIFY_TYPING)) { - PContact contact = roster_get_contact(barejid); - char const *display_usr = NULL; - if (p_contact_name(contact) != NULL) { - display_usr = p_contact_name(contact); - } else { - display_usr = barejid; + gboolean is_current = wins_is_current(window); + if ( !is_current || (is_current && prefs_get_boolean(PREF_NOTIFY_TYPING_CURRENT)) ) { + PContact contact = roster_get_contact(barejid); + char const *display_usr = NULL; + if (p_contact_name(contact) != NULL) { + display_usr = p_contact_name(contact); + } else { + display_usr = barejid; + } + notify_typing(display_usr); } - notify_typing(display_usr); } } |