- if (query_auto_close <= 0)
- return;
-
- /* reset the window's last_line timestamp so that query doesn't get
- closed immediately after switched to the window, or after changed
- to some other window from it */
- if (window != NULL && window_has_query(window))
- window->last_line = time(NULL);
- if (old_window != NULL && window_has_query(old_window))
- old_window->last_line = time(NULL);
+ /* reset the queries last_unread_msg so query doesn't get closed
+ immediately after switched to the window, or after changed to
+ some other window from it */
+ window_reset_query_timestamps(window);
+ window_reset_query_timestamps(old_window);