separator: Enable for MUC and PRIVWIN too

Fix https://github.com/profanity-im/profanity/issues/1238
This commit is contained in:
Michael Vetter
2019-12-13 13:13:02 +01:00
parent e2b44a69bd
commit 3036834ec8
3 changed files with 29 additions and 9 deletions

View File

@@ -651,24 +651,41 @@ ui_focus_win(ProfWin *window)
}
ProfWin *old_current = wins_get_current();
if (old_current->type == WIN_CONFIG) {
ProfConfWin *confwin = (ProfConfWin*)old_current;
cmd_ac_remove_form_fields(confwin->form);
}
// TODO: if old win is chatwin; and has lastreadline; then remove that line
if (old_current->type == WIN_CHAT) {
ProfChatWin *chatwin = (ProfChatWin*)old_current;
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
//win_update_entry_message_real(old_current, chatwin->barejid, "$$$");
win_remove_entry_message(old_current, chatwin->barejid);
}
if (window->type == WIN_CONFIG) {
ProfConfWin *confwin = (ProfConfWin*)window;
cmd_ac_add_form_fields(confwin->form);
}
// check for trackbar last position separator
switch (old_current->type)
{
case WIN_CHAT:
{
ProfChatWin *chatwin = (ProfChatWin*)old_current;
win_remove_entry_message(old_current, chatwin->barejid);
break;
}
case WIN_MUC:
{
ProfMucWin *mucwin = (ProfMucWin*)old_current;
win_remove_entry_message(old_current, mucwin->roomjid);
break;
}
case WIN_PRIVATE:
{
ProfPrivateWin *privwin = (ProfPrivateWin*)old_current;
win_remove_entry_message(old_current, privwin->fulljid);
break;
}
default:
break;
}
int i = wins_get_num(window);
wins_set_current_by_num(i);