diff options
author | Michael Vetter <jubalh@iodoru.org> | 2021-10-22 16:29:08 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2021-10-22 16:54:02 +0200 |
commit | 83ee4a27cb04f1fc314536e72993476d59bd42a2 (patch) | |
tree | 2b0bb2e3592dda7ae9e1914ff068e6ab301d9b9f /src/ui | |
parent | a668ca45b78bf9653f93c0380e58101da3c3bced (diff) | |
download | profani-tty-83ee4a27cb04f1fc314536e72993476d59bd42a2.tar.gz |
Allow utf8 in roster resource char
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/console.c | 10 | ||||
-rw-r--r-- | src/ui/rosterwin.c | 12 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/ui/console.c b/src/ui/console.c index d6306dcc..d86fb158 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -1491,11 +1491,13 @@ cons_roster_setting(void) cons_show("Roster contact char (/roster) : none"); } - char resource_ch = prefs_get_roster_resource_char(); - if (resource_ch) - cons_show("Roster resource char (/roster) : %c", resource_ch); - else + char* resource_ch = prefs_get_roster_resource_char(); + if (resource_ch) { + cons_show("Roster resource char (/roster) : %s", resource_ch); + free(resource_ch); + } else { cons_show("Roster resource char (/roster) : none"); + } char room_ch = prefs_get_roster_room_char(); if (room_ch) diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c index a3dfffba..91b8e7cc 100644 --- a/src/ui/rosterwin.c +++ b/src/ui/rosterwin.c @@ -317,6 +317,7 @@ _rosterwin_unsubscribed_item(ProfLayoutSplit* layout, ProfChatWin* chatwin) char *ch = prefs_get_roster_contact_char(); if (ch) { g_string_append_printf(msg, "%s", ch); + free(ch); } char* unreadpos = prefs_get_string(PREF_ROSTER_UNREAD); @@ -379,6 +380,7 @@ _rosterwin_contact(ProfLayoutSplit* layout, PContact contact) char *ch = prefs_get_roster_contact_char(); if (ch) { g_string_append_printf(msg, "%s", ch); + free(ch); } char* unreadpos = prefs_get_string(PREF_ROSTER_UNREAD); @@ -527,9 +529,10 @@ _rosterwin_resources(ProfLayoutSplit* layout, PContact contact, int current_inde wattron(layout->subwin, theme_attrs(resource_presence_colour)); GString* msg = g_string_new(""); - char ch = prefs_get_roster_resource_char(); + char* ch = prefs_get_roster_resource_char(); if (ch) { - g_string_append_printf(msg, "%c", ch); + g_string_append_printf(msg, "%s", ch); + free(ch); } else { g_string_append(msg, " "); } @@ -590,9 +593,10 @@ _rosterwin_resources(ProfLayoutSplit* layout, PContact contact, int current_inde g_string_append(msg, " "); this_indent--; } - char ch = prefs_get_roster_resource_char(); + char* ch = prefs_get_roster_resource_char(); if (ch) { - g_string_append_printf(msg, "%c", ch); + g_string_append_printf(msg, "%s", ch); + free(ch); } g_string_append(msg, resource->name); if (prefs_get_boolean(PREF_ROSTER_PRIORITY)) { |