diff --git a/src/ui/window.c b/src/ui/window.c index bf84294f..51f36872 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -813,9 +813,7 @@ win_page_down(ProfWin* window, int scroll_size) auto_gchar gchar* start = g_date_time_format_iso8601(last_entry->time); auto_gchar gchar* end_date = g_date_time_format_iso8601(now); db_history_result_t db_response = chatwin_db_history((ProfChatWin*)window, start, end_date, FALSE); - // Treat transient DB error (e.g. no active backend) the same - // as EMPTY: no rows can be fetched, so stop indicating [SCROLLED]. - if (db_response == DB_RESPONSE_EMPTY || db_response == DB_RESPONSE_ERROR) + if (db_response == DB_RESPONSE_EMPTY) *scroll_state = WIN_SCROLL_REACHED_BOTTOM; // similar to page_up (see explanation there) @@ -1811,13 +1809,9 @@ static void _win_printf(ProfWin* window, const char* show_char, int pad_indent, GDateTime* timestamp, int flags, theme_item_t theme_item, const char* const display_from, const char* const from_jid, const char* const message_id, const char* const message, ...) { - /* While the user is scrolled, bump the unread indicator. WIN_CHAT - * skips the buffer/render only when the DB will preserve the message - * verbatim — chatwin_db_history on scroll-down will replay it. When - * the DB is off/redact/dead we cannot recover, so fall through and - * append to the buffer just like non-chat windows. */ if (window->layout->paged && wins_is_current(window)) { window->layout->unread_msg++; + // Skip buffer only when DB can replay the message on scroll-down. if (window->type == WIN_CHAT && log_database_can_recover_messages()) { return; }