about summary refs log tree commit diff stats
path: root/src/ui/window_list.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-10-31 12:56:48 +0100
committerMichael Vetter <jubalh@iodoru.org>2019-10-31 12:56:48 +0100
commit4ecd4dea6a0a4c216a57d039dc7dc01d5e41d68a (patch)
tree95a0cc0bfa2712f6931c2cc76805d05aa0708071 /src/ui/window_list.c
parent725cf3e47a6841c2b6e9c27f125f69953cf39f81 (diff)
downloadprofani-tty-4ecd4dea6a0a4c216a57d039dc7dc01d5e41d68a.tar.gz
Replace sent_messages list with algo
For OMEMO we had a list with our sent messages.
It was used so that we don't decrypt our own messages in MUCs that come
in via reflection.

Recently for https://github.com/profanity-im/profanity/pull/1209 we
started to use origin-id and use an algorithm so we can detect our own
sent messages via checking origin-id.

Profanity uses the same id for the message ID and origin-id.

With 06f300a42c4c627b6f1817bd48d92f083ffd9883 we added the
message_is_sent_by_us() function.

We implemented XEP-0359 this way to fix
https://github.com/profanity-im/profanity/issues/1201 so that we don't
log our own messages in MUCs twice.

We can now check whether the message was sent by us using this function
and can get rid of the list.

Probably we could also put many parts of the sv_ev_room_message()
function inside (else) part of `if (!(g_strcmp0(mynick,
message->jid->resourcepart) == 0 && message_is_sent_by_us(message))) {`.

Have to look more closely whether any of this needs to be run in case
the message actually comes from us.
Diffstat (limited to 'src/ui/window_list.c')
-rw-r--r--src/ui/window_list.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/ui/window_list.c b/src/ui/window_list.c
index 36e63477..ce414c2e 100644
--- a/src/ui/window_list.c
+++ b/src/ui/window_list.c
@@ -561,7 +561,6 @@ wins_close_by_num(int i)
                 ProfMucWin *mucwin = (ProfMucWin*)window;
                 autocomplete_remove(wins_ac, mucwin->roomjid);
                 autocomplete_remove(wins_close_ac, mucwin->roomjid);
-                g_hash_table_remove_all(mucwin->sent_messages);
 
                 if (mucwin->last_msg_timestamp) {
                     g_date_time_unref(mucwin->last_msg_timestamp);