Skip to content

Commit 42def57

Browse files
committed
Only fetch unread messages when connecting
When `show_unread` is true, unread messages will only be fetched when connecting and not when changing to/from away.
1 parent 205d2ed commit 42def57

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

facebook/facebook.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,17 @@ fb_cb_api_connect(FbApi *api, gpointer data)
142142
account_t *acct;
143143
FbData *fata = data;
144144
struct im_connection *ic;
145+
gint logged_in;
145146

146147
ic = fb_data_get_connection(fata);
147148
acct = ic->acc;
148149

150+
logged_in = (ic->flags & OPT_LOGGED_IN);
151+
149152
fb_data_save(fata);
150153
imcb_connected(ic);
151154

152-
if (set_getbool(&acct->set, "show_unread")) {
155+
if (set_getbool(&acct->set, "show_unread") && !logged_in) {
153156
fb_api_unread(api);
154157
}
155158
}

0 commit comments

Comments
 (0)