Compare commits
1 Commits
d8ce4ca80e
...
df5b39fa7c
| Author | SHA1 | Date | |
|---|---|---|---|
|
df5b39fa7c
|
@@ -384,29 +384,16 @@ _sqlite_get_previous_chat(const gchar* const contact_barejid, const gchar* start
|
||||
const gchar* sort2 = !flip ? "ASC" : "DESC";
|
||||
GDateTime* now = g_date_time_new_now_local();
|
||||
auto_gchar gchar* end_date_fmt = end_time ? g_strdup(end_time) : g_date_time_format_iso8601(now);
|
||||
|
||||
// When LMC is disabled, return original and correction rows as separate
|
||||
// messages instead of merging the correction text into the original.
|
||||
// Otherwise the user sees corrected text in history even with
|
||||
// /correction off.
|
||||
const gboolean lmc_allowed = prefs_get_boolean(PREF_CORRECTION_ALLOW);
|
||||
const char* msg_expr = lmc_allowed ? "COALESCE(B.`message`, A.`message`)" : "A.`message`";
|
||||
const char* join_clause = lmc_allowed
|
||||
? "LEFT JOIN `ChatLogs` AS B ON (A.`replaced_by_db_id` = B.`id` AND A.`from_jid` = B.`from_jid`) "
|
||||
: "";
|
||||
const char* replaces_filter = lmc_allowed ? "(A.`replaces_db_id` IS NULL) AND " : "";
|
||||
|
||||
auto_sqlite gchar* query = sqlite3_mprintf("SELECT * FROM ("
|
||||
"SELECT %s AS message, "
|
||||
"SELECT COALESCE(B.`message`, A.`message`) AS message, "
|
||||
"A.`timestamp`, A.`from_jid`, A.`from_resource`, A.`to_jid`, A.`to_resource`, A.`type`, A.`encryption`, A.`stanza_id` FROM `ChatLogs` AS A "
|
||||
"%s"
|
||||
"WHERE %s"
|
||||
"((A.`from_jid` = %Q AND A.`to_jid` = %Q) OR (A.`from_jid` = %Q AND A.`to_jid` = %Q)) "
|
||||
"LEFT JOIN `ChatLogs` AS B ON (A.`replaced_by_db_id` = B.`id` AND A.`from_jid` = B.`from_jid`) "
|
||||
"WHERE (A.`replaces_db_id` IS NULL) "
|
||||
"AND ((A.`from_jid` = %Q AND A.`to_jid` = %Q) OR (A.`from_jid` = %Q AND A.`to_jid` = %Q)) "
|
||||
"AND A.`timestamp` < %Q "
|
||||
"AND (%Q IS NULL OR A.`timestamp` > %Q) "
|
||||
"ORDER BY A.`timestamp` %s LIMIT %d) "
|
||||
"ORDER BY `timestamp` %s;",
|
||||
msg_expr, join_clause, replaces_filter,
|
||||
contact_barejid, myjid->barejid, myjid->barejid, contact_barejid, end_date_fmt, start_time, start_time, sort1, MESSAGES_TO_RETRIEVE, sort2);
|
||||
|
||||
g_date_time_unref(now);
|
||||
|
||||
@@ -1948,22 +1948,12 @@ cons_log_setting(void)
|
||||
cons_show("Log level (/log level) : %s", level);
|
||||
}
|
||||
|
||||
void
|
||||
cons_logging_setting(void)
|
||||
{
|
||||
if (prefs_get_boolean(PREF_GRLOG))
|
||||
cons_show("Groupchat logging (/logging group) : ON");
|
||||
else
|
||||
cons_show("Groupchat logging (/logging group) : OFF");
|
||||
}
|
||||
|
||||
void
|
||||
cons_show_log_prefs(void)
|
||||
{
|
||||
cons_show("Logging preferences:");
|
||||
cons_show("");
|
||||
cons_log_setting();
|
||||
cons_logging_setting();
|
||||
|
||||
cons_alert(NULL);
|
||||
}
|
||||
|
||||
@@ -330,7 +330,6 @@ void cons_history_setting(void);
|
||||
void cons_carbons_setting(void);
|
||||
void cons_receipts_setting(void);
|
||||
void cons_log_setting(void);
|
||||
void cons_logging_setting(void);
|
||||
void cons_autoaway_setting(void);
|
||||
void cons_reconnect_setting(void);
|
||||
void cons_autoping_setting(void);
|
||||
|
||||
Reference in New Issue
Block a user