1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

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
This commit is contained in:
Michael Vetter 2020-04-13 21:57:28 +02:00
parent a800bfcbf8
commit a42c2a1134

View File

@ -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);
}