diff options
author | Michael Vetter <jubalh@iodoru.org> | 2023-03-23 18:47:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-23 18:47:09 +0100 |
commit | 2093fe417f6a1d7f8741613a83ed81e18ae272c9 (patch) | |
tree | 545177f774356337b8b8a6388f2bd77393d2df55 /src/ui/mucwin.c | |
parent | b393363bd513bbea5d7ed5a0fccbef61aff07daa (diff) | |
parent | 732cbbfefc3536d4ce4e16f4eca0a5470f5c18b0 (diff) | |
download | profani-tty-2093fe417f6a1d7f8741613a83ed81e18ae272c9.tar.gz |
Merge pull request #1800 from profanity-im/switch
Improve some UI functions
Diffstat (limited to 'src/ui/mucwin.c')
-rw-r--r-- | src/ui/mucwin.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index a3d154e0..a4bcc191 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -943,17 +943,11 @@ mucwin_get_string(ProfMucWin* mucwin) { assert(mucwin != NULL); - GString* res = g_string_new("Room "); - g_string_append(res, mucwin->roomjid); - if (mucwin->unread > 0) { - g_string_append_printf(res, ", %d unread", mucwin->unread); + return g_strdup_printf("Room %s, %d unread", mucwin->roomjid, mucwin->unread); + } else { + return g_strdup_printf("Room %s", mucwin->roomjid); } - - char* resstr = res->str; - g_string_free(res, FALSE); - - return resstr; } void |