From 8045a32c4a123d541c9a44d64a8ff35dca27474e Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 19 Mar 2020 12:10:54 +0100 Subject: database: log incoming messages First trial. Not covering all cases yet. --- src/event/server_events.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/event') diff --git a/src/event/server_events.c b/src/event/server_events.c index ea4277b2..6c7d0430 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -42,6 +42,7 @@ #include "profanity.h" #include "log.h" +#include "database.h" #include "config/preferences.h" #include "config/tlscerts.h" #include "config/account.h" @@ -324,6 +325,7 @@ sv_ev_room_message(ProfMessage *message) GList *triggers = prefs_message_get_triggers(message->plain); _clean_incoming_message(message); + log_database_add(message); mucwin_incoming_msg(mucwin, message, mentions, triggers, TRUE); g_slist_free(mentions); @@ -397,6 +399,7 @@ sv_ev_incoming_private_message(ProfMessage *message) } _clean_incoming_message(message); + log_database_add(message); privwin_incoming_msg(privatewin, message); chat_log_msg_in(message); @@ -420,6 +423,7 @@ sv_ev_delayed_private_message(ProfMessage *message) } _clean_incoming_message(message); + log_database_add(message); privwin_incoming_msg(privatewin, message); chat_log_msg_in(message); @@ -532,6 +536,7 @@ _sv_ev_incoming_pgp(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message if (message->plain) { message->enc = PROF_MSG_ENC_PGP; _clean_incoming_message(message); + log_database_add(message); chatwin_incoming_msg(chatwin, message, new_win); if (logit) { chat_log_pgp_msg_in(message); @@ -547,6 +552,7 @@ _sv_ev_incoming_pgp(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message message->enc = PROF_MSG_ENC_PLAIN; message->plain = strdup(message->body); _clean_incoming_message(message); + log_database_add(message); chatwin_incoming_msg(chatwin, message, new_win); chat_log_msg_in(message); chatwin->pgp_recv = FALSE; @@ -569,6 +575,7 @@ _sv_ev_incoming_otr(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message } _clean_incoming_message(message); + log_database_add(message); chatwin_incoming_msg(chatwin, message, new_win); chat_log_otr_msg_in(message); @@ -584,6 +591,7 @@ static void _sv_ev_incoming_omemo(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message, gboolean logit) { _clean_incoming_message(message); + log_database_add(message); chatwin_incoming_msg(chatwin, message, new_win); if (logit) { chat_log_omemo_msg_in(message); @@ -599,6 +607,7 @@ _sv_ev_incoming_plain(ProfChatWin *chatwin, gboolean new_win, ProfMessage *messa message->enc = PROF_MSG_ENC_PLAIN; message->plain = strdup(message->body); _clean_incoming_message(message); + log_database_add(message); chatwin_incoming_msg(chatwin, message, new_win); if (logit) { chat_log_msg_in(message); -- cgit 1.4.1-2-gfad0