Fech data from mam when all history gets displayed

Fetch from mam without displaying when all mam messages get received
display new messages from db.
Unstable, initial mam doesn't get displayed unless we start scrolling.
This commit is contained in:
MarcoPolo-PasTonMolo
2022-07-03 21:30:02 +03:00
parent ea83165a35
commit 97a610e915
3 changed files with 52 additions and 1 deletions

View File

@@ -602,8 +602,14 @@ win_page_up(ProfWin* window)
if (*page_start == -page_space && prefs_get_boolean(PREF_MAM) && window->type == WIN_CHAT) {
ProfChatWin* chatwin = (ProfChatWin*) window;
chatwin_old_history(chatwin);
if (!chatwin_old_history(chatwin)) {
cons_show("Fetched mam");
iq_mam_request_older(chatwin);
} else {
cons_show("Showed history");
}
}
// went past beginning, show first page
if (*page_start < 0)
*page_start = 0;