1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Show nick for title

This commit is contained in:
James Booth 2014-12-21 22:39:00 +00:00
parent 0c1bbb63c0
commit eef7f9cfd4

View File

@ -238,8 +238,14 @@ win_get_title(ProfWin *window)
if (window->type == WIN_CHAT) { if (window->type == WIN_CHAT) {
ProfChatWin *chatwin = (ProfChatWin*) window; ProfChatWin *chatwin = (ProfChatWin*) window;
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK); assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
PContact contact = roster_get_contact(chatwin->barejid);
if (contact) {
const char *name = p_contact_name_or_jid(contact);
return strdup(name);
} else {
return strdup(chatwin->barejid); return strdup(chatwin->barejid);
} }
}
if (window->type == WIN_MUC) { if (window->type == WIN_MUC) {
ProfMucWin *mucwin = (ProfMucWin*) window; ProfMucWin *mucwin = (ProfMucWin*) window;
assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK); assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);