diff options
author | James Booth <boothj5@gmail.com> | 2013-10-06 23:39:27 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-10-06 23:39:27 +0100 |
commit | 7eb5bb6c3d340bd15339962a6b646481c046d69a (patch) | |
tree | ba8ecaa26e384029901d3ca5ac376c10d20fb146 /src/ui | |
parent | 4c64169d5b56e94185a8722563a52b55fe4b754f (diff) | |
download | profani-tty-7eb5bb6c3d340bd15339962a6b646481c046d69a.tar.gz |
Moved check for PREF_STATUSES
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/core.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/ui/core.c b/src/ui/core.c index eaca033f..af71bb00 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -400,13 +400,15 @@ ui_contact_online(const char * const barejid, const char * const resource, } ProfWin *console = wins_get_console(); - _show_status_string(console, display_str->str, show, status, last_activity, - "++", "online"); - ProfWin *window = wins_get_by_recipient(barejid); - if (window != NULL) { - _show_status_string(window, display_str->str, show, status, - last_activity, "++", "online"); + + if (prefs_get_boolean(PREF_STATUSES)) { + _show_status_string(console, display_str->str, show, status, last_activity, + "++", "online"); + if (window != NULL) { + _show_status_string(window, display_str->str, show, status, + last_activity, "++", "online"); + } } jid_destroy(jid); @@ -442,13 +444,15 @@ ui_contact_offline(const char * const from, const char * const show, } ProfWin *console = wins_get_console(); - _show_status_string(console, display_str->str, show, status, NULL, "--", - "offline"); - ProfWin *window = wins_get_by_recipient(jidp->barejid); - if (window != NULL) { - _show_status_string(window, display_str->str, show, status, NULL, "--", + + if (prefs_get_boolean(PREF_STATUSES)) { + _show_status_string(console, display_str->str, show, status, NULL, "--", "offline"); + if (window != NULL) { + _show_status_string(window, display_str->str, show, status, NULL, "--", + "offline"); + } } jid_destroy(jidp); @@ -922,7 +926,9 @@ ui_new_chat_win(const char * const to) if (strcmp(p_contact_presence(contact), "offline") == 0) { const char const *show = p_contact_presence(contact); const char const *status = p_contact_status(contact); - _show_status_string(window, to, show, status, NULL, "--", "offline"); + if (prefs_get_boolean(PREF_STATUSES)) { + _show_status_string(window, to, show, status, NULL, "--", "offline"); + } } } } else { @@ -1030,7 +1036,9 @@ ui_outgoing_msg(const char * const from, const char * const to, if (strcmp(p_contact_presence(contact), "offline") == 0) { const char const *show = p_contact_presence(contact); const char const *status = p_contact_status(contact); - _show_status_string(window, to, show, status, NULL, "--", "offline"); + if (prefs_get_boolean(PREF_STATUSES)) { + _show_status_string(window, to, show, status, NULL, "--", "offline"); + } } } @@ -1161,7 +1169,9 @@ ui_room_member_presence(const char * const room, const char * const nick, ProfWin *window = wins_get_by_recipient(room); if (window != NULL) { - _show_status_string(window, nick, show, status, NULL, "++", "online"); + if (prefs_get_boolean(PREF_STATUSES)) { + _show_status_string(window, nick, show, status, NULL, "++", "online"); + } } if (wins_is_current(window)) { @@ -1490,9 +1500,6 @@ _show_status_string(ProfWin *window, const char * const from, { WINDOW *win = window->win; - if (!prefs_get_boolean(PREF_STATUSES)) - return; - win_print_time(window, '-'); if (show != NULL) { |