Skip to content

Commit

Permalink
Only fetch unread messages when connecting
Browse files Browse the repository at this point in the history
When `show_unread` is true, unread messages will only be fetched when
connecting and not when changing to/from away.
  • Loading branch information
mhalden committed Mar 19, 2016
1 parent 205d2ed commit 42def57
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion facebook/facebook.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,17 @@ fb_cb_api_connect(FbApi *api, gpointer data)
account_t *acct;
FbData *fata = data;
struct im_connection *ic;
gint logged_in;

ic = fb_data_get_connection(fata);
acct = ic->acc;

logged_in = (ic->flags & OPT_LOGGED_IN);

fb_data_save(fata);
imcb_connected(ic);

if (set_getbool(&acct->set, "show_unread")) {
if (set_getbool(&acct->set, "show_unread") && !logged_in) {
fb_api_unread(api);
}
}
Expand Down

0 comments on commit 42def57

Please sign in to comment.