Skip to content

Commit 787124e

Browse files
Delete mam loading message on lost connection
see #660
1 parent 5acd29e commit 787124e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ui/window_list.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "config/theme.h"
4848
#include "plugins/plugins.h"
4949
#include "ui/ui.h"
50+
#include "ui/window.h"
5051
#include "ui/window_list.h"
5152
#include "xmpp/xmpp.h"
5253
#include "xmpp/roster_list.h"
@@ -885,6 +886,12 @@ wins_lost_connection(void)
885886
ProfWin* window = curr->data;
886887
if (window->type != WIN_CONSOLE) {
887888
win_println(window, THEME_ERROR, "-", "Lost connection.");
889+
ProfBuffEntry* first_message = buffer_size(window->layout->buffer) != 0 ? buffer_get_entry(window->layout->buffer, 0) : NULL;
890+
gboolean is_fetching_mam = first_message && (first_message->theme_item == THEME_ROOMINFO && g_strcmp0(first_message->message, LOADING_MESSAGE) == 0);
891+
892+
if (is_fetching_mam) {
893+
buffer_remove_entry(window->layout->buffer, 0);
894+
}
888895

889896
// if current win, set current_win_dirty
890897
if (wins_is_current(window)) {

0 commit comments

Comments
 (0)