mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
move titlebar code in correct function
This commit is contained in:
parent
3c56b289ed
commit
fd090d384d
@ -191,25 +191,7 @@ _title_bar_draw(void)
|
|||||||
waddch(win, ' ');
|
waddch(win, ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
char *title = NULL;
|
char *title = win_get_title(current);
|
||||||
if (current && current->type == WIN_MUC) {
|
|
||||||
char *use_as_name = prefs_get_string(PREF_TITLEBAR_MUC_TITLE);
|
|
||||||
|
|
||||||
if ((g_strcmp0(use_as_name, "name") == 0)) {
|
|
||||||
ProfMucWin *mucwin = (ProfMucWin*) current;
|
|
||||||
assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);
|
|
||||||
|
|
||||||
if (mucwin->room_name) {
|
|
||||||
title = strdup(mucwin->room_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
prefs_free_string(use_as_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (title == NULL) {
|
|
||||||
title = win_get_title(current);
|
|
||||||
}
|
|
||||||
|
|
||||||
mvwprintw(win, 0, 0, " %s", title);
|
mvwprintw(win, 0, 0, " %s", title);
|
||||||
free(title);
|
free(title);
|
||||||
|
@ -299,7 +299,15 @@ win_get_title(ProfWin *window)
|
|||||||
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);
|
||||||
return strdup(mucwin->roomjid);
|
|
||||||
|
char *use_as_name = prefs_get_string(PREF_TITLEBAR_MUC_TITLE);
|
||||||
|
if ((g_strcmp0(use_as_name, "name") == 0) && mucwin->room_name) {
|
||||||
|
prefs_free_string(use_as_name);
|
||||||
|
return strdup(mucwin->room_name);
|
||||||
|
} else {
|
||||||
|
prefs_free_string(use_as_name);
|
||||||
|
return strdup(mucwin->roomjid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (window->type == WIN_CONFIG) {
|
if (window->type == WIN_CONFIG) {
|
||||||
ProfConfWin *confwin = (ProfConfWin*) window;
|
ProfConfWin *confwin = (ProfConfWin*) window;
|
||||||
|
Loading…
Reference in New Issue
Block a user