diff options
Diffstat (limited to 'src/ui/privwin.c')
-rw-r--r-- | src/ui/privwin.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ui/privwin.c b/src/ui/privwin.c index 204335bd..77a0a92d 100644 --- a/src/ui/privwin.c +++ b/src/ui/privwin.c @@ -107,3 +107,21 @@ privwin_outgoing_msg(ProfPrivateWin *privwin, const char *const message) win_print((ProfWin*)privwin, '-', 0, NULL, 0, THEME_TEXT_ME, "me", message); } + +char* +privwin_get_string(ProfPrivateWin *privwin) +{ + assert(privwin != NULL); + + GString *res = g_string_new("Private "); + g_string_append(res, privwin->fulljid); + + if (privwin->unread > 0) { + g_string_append_printf(res, ", %d unread", privwin->unread); + } + + char *resstr = res->str; + g_string_free(res, FALSE); + + return resstr; +} |