diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-04-06 14:42:52 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-04-06 14:42:52 +0200 |
commit | 0942d98c6116dc4b9b608e7483f1d6a8f62c84d7 (patch) | |
tree | d8a95379d8ae95f8bedfae740c9cb6cba01ed924 /src/ui/chatwin.c | |
parent | 5d54bb228f4ef750edefdd9423f8f672d045ff6c (diff) | |
download | profani-tty-0942d98c6116dc4b9b608e7483f1d6a8f62c84d7.tar.gz |
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.
Diffstat (limited to 'src/ui/chatwin.c')
-rw-r--r-- | src/ui/chatwin.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index 41e70b40..93cc9525 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -57,7 +57,7 @@ #include "omemo/omemo.h" #endif -static void _chatwin_history(ProfChatWin *chatwin, const char *const contact); +static void _chatwin_history(ProfChatWin *chatwin, const char *const contact_barejid); static void _chatwin_set_last_message(ProfChatWin *chatwin, const char *const id, const char *const message); ProfChatWin* @@ -478,14 +478,10 @@ chatwin_unset_outgoing_char(ProfChatWin *chatwin) } static void -_chatwin_history(ProfChatWin *chatwin, const char *const contact) +_chatwin_history(ProfChatWin *chatwin, const char *const contact_barejid) { if (!chatwin->history_shown) { - Jid *jid = jid_create(connection_get_fulljid()); - //GSList *history = chat_log_get_previous(jid->barejid, contact); - // TODO: jid not needed - GSList *history = log_database_get_previous_chat(jid->barejid, contact); - jid_destroy(jid); + GSList *history = log_database_get_previous_chat(contact_barejid); GSList *curr = history; while (curr) { |