about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/command/cmd_funcs.c28
-rw-r--r--src/event/server_events.c3
2 files changed, 12 insertions, 19 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 4a5c7fa1..507a8ccd 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -6516,12 +6516,17 @@ cmd_log(ProfWin* window, const char* const command, gchar** args)
     char* subcmd = args[0];
     char* value = args[1];
 
-    if (strcmp(subcmd, "maxsize") == 0) {
-        if (value == NULL) {
-            cons_bad_cmd_usage(command);
-            return TRUE;
-        }
+    if (strcmp(subcmd, "where") == 0) {
+        cons_show("Log file: %s", get_log_file_location());
+        return TRUE;
+    }
 
+    if (value == NULL) {
+        cons_bad_cmd_usage(command);
+        return TRUE;
+    }
+
+    if (strcmp(subcmd, "maxsize") == 0) {
         int intval = 0;
         char* err_msg = NULL;
         gboolean res = strtoi_range(value, &intval, PREFS_MIN_LOG_SIZE, INT_MAX, &err_msg);
@@ -6536,29 +6541,16 @@ cmd_log(ProfWin* window, const char* const command, gchar** args)
     }
 
     if (strcmp(subcmd, "rotate") == 0) {
-        if (value == NULL) {
-            cons_bad_cmd_usage(command);
-            return TRUE;
-        }
         _cmd_set_boolean_preference(value, command, "Log rotate", PREF_LOG_ROTATE);
         return TRUE;
     }
 
     if (strcmp(subcmd, "shared") == 0) {
-        if (value == NULL) {
-            cons_bad_cmd_usage(command);
-            return TRUE;
-        }
         _cmd_set_boolean_preference(value, command, "Shared log", PREF_LOG_SHARED);
         cons_show("Setting only takes effect after saving and restarting Profanity.");
         return TRUE;
     }
 
-    if (strcmp(subcmd, "where") == 0) {
-        cons_show("Log file: %s", get_log_file_location());
-        return TRUE;
-    }
-
     if (strcmp(subcmd, "level") == 0) {
         log_level_t prof_log_level;
         if (log_level_from_string(value, &prof_log_level) == 0) {
diff --git a/src/event/server_events.c b/src/event/server_events.c
index c1f11332..0f6df2ac 100644
--- a/src/event/server_events.c
+++ b/src/event/server_events.c
@@ -433,7 +433,7 @@ sv_ev_incoming_private_message(ProfMessage* message)
 
     _clean_incoming_message(message);
     privwin_incoming_msg(privatewin, message);
-    log_database_add_incoming(message);
+    // Intentionally skipping log to DB because we can't authenticate the sender
     chat_log_msg_in(message);
 
     plugins_post_priv_message_display(message->from_jid->fulljid, message->plain);
@@ -457,6 +457,7 @@ sv_ev_delayed_private_message(ProfMessage* message)
 
     _clean_incoming_message(message);
     privwin_incoming_msg(privatewin, message);
+    // Intentionally skipping log to DB because we can't authenticate the sender
     chat_log_msg_in(message);
 
     plugins_post_priv_message_display(message->from_jid->fulljid, message->plain);
i.widgets.browserview.html?h=v1.7.0&id=4c13e1f2d85483e026d79ab05da9f1e8e4b45293'>4c13e1f2 ^
34a60763 ^
4c13e1f2 ^




34a60763 ^
4c13e1f2 ^


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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138