From 3e26364579d49aae70fa54addbd271b3aee3d968 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Tue, 8 Dec 2020 12:26:36 +0100 Subject: Fix chatlogs for outgoing carbons Doesn't make sense to log if plain is not set in all cases. Regards https://github.com/profanity-im/profanity/issues/1439 --- src/event/server_events.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/event/server_events.c b/src/event/server_events.c index 27f142eb..3e51d969 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -448,16 +448,6 @@ sv_ev_outgoing_carbon(ProfMessage* message) chat_state_active(chatwin->state); - if (message->plain) { - if (message->type == PROF_MSG_TYPE_MUCPM) { - // MUC PM, should have resource (nick) in filename - chat_log_msg_out(message->to_jid->barejid, message->plain, message->from_jid->resourcepart); - } else { - chat_log_msg_out(message->to_jid->barejid, message->plain, NULL); - } - log_database_add_incoming(message); - } - if (message->enc == PROF_MSG_ENC_OMEMO) { chatwin_outgoing_carbon(chatwin, message); } else if (message->encrypted) { @@ -481,6 +471,16 @@ sv_ev_outgoing_carbon(ProfMessage* message) message->plain = strdup(message->body); chatwin_outgoing_carbon(chatwin, message); } + + if (message->plain) { + if (message->type == PROF_MSG_TYPE_MUCPM) { + // MUC PM, should have resource (nick) in filename + chat_log_msg_out(message->to_jid->barejid, message->plain, message->from_jid->resourcepart); + } else { + chat_log_msg_out(message->to_jid->barejid, message->plain, NULL); + } + log_database_add_incoming(message); + } return; } -- cgit 1.4.1-2-gfad0 rm class='right' method='get' action='/akspecs/aerc/log/commands/msg/archive.go'>
path: root/commands/msg/archive.go
blob: 6bf231d6ff16590fd270844c03c97d065a80c364 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80