mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-23 20:36:21 +00:00
Remove chat_log_get_previous()
We now dont get the log files from the text files via chat_log_get_previous() anymore. We use the sql backend via log_database_get_previous_chat(). So far it just has the same behaviour like chat_log_get_previous(), except that in _chatwin_history() we don't pass the sender to win_print_history() which should be fixed in a commit soon. And log_database_get_previous_chat() can later easily be expanded to fix https://github.com/profanity-im/profanity/issues/205.
This commit is contained in:
@@ -283,12 +283,12 @@ _add_to_db(ProfMessage *message, const char * const type, const Jid * const from
|
||||
}
|
||||
|
||||
GSList*
|
||||
log_database_get_previous_chat(const gchar *const login, const gchar *const recipient)
|
||||
log_database_get_previous_chat(const gchar *const contact_barejid)
|
||||
{
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
char *query;
|
||||
|
||||
if (asprintf(&query, "SELECT `message`, `timestamp`, `from_jid` from `ChatLogs` WHERE `from_jid` = '%s' OR `to_jid` = '%s' ORDER BY `id` ASC LIMIT 10", recipient, recipient) == -1) {
|
||||
if (asprintf(&query, "SELECT `message`, `timestamp`, `from_jid` from `ChatLogs` WHERE `from_jid` = '%s' OR `to_jid` = '%s' ORDER BY `id` ASC LIMIT 10", contact_barejid, contact_barejid) == -1) {
|
||||
log_error("log_database_get_previous_chat(): could not allocate memory");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user