about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/ui/rosterwin.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c
index b19f9858..3073c85b 100644
--- a/src/ui/rosterwin.c
+++ b/src/ui/rosterwin.c
@@ -122,31 +122,9 @@ _rosterwin_resource(ProfLayoutSplit *layout, PContact contact)
         }
     } else if (prefs_get_boolean(PREF_ROSTER_PRESENCE)) {
         const char *presence = p_contact_presence(contact);
+        const char *status = p_contact_status(contact);
         theme_item_t presence_colour = theme_main_presence_attrs(presence);
-        char *by = prefs_get_string(PREF_ROSTER_BY);
-        gboolean by_presence = g_strcmp0(by, "presence") == 0;
-        gboolean has_status = p_contact_status(contact) != NULL;
-        gboolean show_status = prefs_get_boolean(PREF_ROSTER_STATUS);
-        if (!by_presence || (has_status && show_status)) {
-            wattron(layout->subwin, theme_attrs(presence_colour));
-            GString *msg = g_string_new("     ");
-            if (!by_presence) {
-                g_string_append(msg, presence);
-            }
-            if (has_status && show_status) {
-                if (!by_presence) {
-                    g_string_append(msg, ", \"");
-                } else {
-                    g_string_append(msg, "\"");
-                }
-                const char *status = p_contact_status(contact);
-                g_string_append(msg, status);
-                g_string_append(msg, "\"");
-            }
-            win_printline_nowrap(layout->subwin, msg->str);
-            g_string_free(msg, TRUE);
-            wattroff(layout->subwin, theme_attrs(presence_colour));
-        }
+        _rosterwin_presence(layout, 4, presence_colour, presence, status);
     }
     g_list_free(resources);
 
the previous revision' href='/danisanti/profani-tty/blame/CONTRIBUTING.md?id=d1bf922b1ab5608ed425339cfe41039d3ab75dc7'>^
d1bf922b ^











25922160 ^
















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56