about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-10-06 23:39:27 +0100
committerJames Booth <boothj5@gmail.com>2013-10-06 23:39:27 +0100
commit7eb5bb6c3d340bd15339962a6b646481c046d69a (patch)
treeba8ecaa26e384029901d3ca5ac376c10d20fb146
parent4c64169d5b56e94185a8722563a52b55fe4b754f (diff)
downloadprofani-tty-7eb5bb6c3d340bd15339962a6b646481c046d69a.tar.gz
Moved check for PREF_STATUSES
-rw-r--r--src/ui/core.c41
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) {
n272'>272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381