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

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(); ProfWin *old_current = wins_get_current();
if (old_current->type == WIN_CONFIG) { if (old_current->type == WIN_CONFIG) {
ProfConfWin *confwin = (ProfConfWin*)old_current; ProfConfWin *confwin = (ProfConfWin*)old_current;
cmd_ac_remove_form_fields(confwin->form); 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) { if (window->type == WIN_CONFIG) {
ProfConfWin *confwin = (ProfConfWin*)window; ProfConfWin *confwin = (ProfConfWin*)window;
cmd_ac_add_form_fields(confwin->form); 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); int i = wins_get_num(window);
wins_set_current_by_num(i); wins_set_current_by_num(i);

View File

@ -551,6 +551,8 @@ mucwin_incoming_msg(ProfMucWin *mucwin, ProfMessage *message, GSList *mentions,
ch = prefs_get_omemo_char(); ch = prefs_get_omemo_char();
} }
win_insert_last_read_position_marker((ProfWin*)mucwin, mucwin->roomjid);
if (g_slist_length(mentions) > 0) { if (g_slist_length(mentions) > 0) {
_mucwin_print_mention(window, message->plain, message->jid->resourcepart, mynick, mentions, &ch, flags); _mucwin_print_mention(window, message->plain, message->jid->resourcepart, mynick, mentions, &ch, flags);
} else if (triggers) { } else if (triggers) {

View File

@ -69,6 +69,7 @@ privwin_incoming_msg(ProfPrivateWin *privatewin, ProfMessage *message)
} else { } else {
status_bar_new(num, WIN_PRIVATE, privatewin->fulljid); status_bar_new(num, WIN_PRIVATE, privatewin->fulljid);
cons_show_incoming_private_message(jidp->resourcepart, jidp->barejid, num, privatewin->unread); cons_show_incoming_private_message(jidp->resourcepart, jidp->barejid, num, privatewin->unread);
win_insert_last_read_position_marker((ProfWin*)privatewin, privatewin->fulljid);
win_print_incoming(window, jidp->resourcepart, message); win_print_incoming(window, jidp->resourcepart, message);
privatewin->unread++; privatewin->unread++;