From a42c2a113425959076557a69e129b210c9fd64c8 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 13 Apr 2020 21:57:28 +0200 Subject: [PATCH] Only print chathistory if regular chat message MUCPMs and regular chat messages get printed with the same code. But we don't save MUC PMs in the sqldb, because another jid could use the same nick the next time. And if we would take the log out we would need a different routine, checking for resourcepart too. Fix https://github.com/profanity-im/profanity/issues/1312 --- src/ui/chatwin.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index 22992ecd..ffffb2e1 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -292,7 +292,10 @@ chatwin_incoming_msg(ProfChatWin *chatwin, ProfMessage *message, gboolean win_cr //1) only send IQ once //2) sort incoming messages on timestamp //for now if experimental MAM is enabled we dont show no history from sql either - if (!prefs_get_boolean(PREF_MAM) && prefs_get_boolean(PREF_CHLOG) && prefs_get_boolean(PREF_HISTORY)) { + + // MUCPMs also get printed here. In their case we don't save any logs (because nick owners can change) and thus we shouldn't read logs + // (and if we do we need to check the resourcepart) + if (!prefs_get_boolean(PREF_MAM) && prefs_get_boolean(PREF_CHLOG) && prefs_get_boolean(PREF_HISTORY) && message->type == PROF_MSG_TYPE_CHAT) { _chatwin_history(chatwin, chatwin->barejid); }