comparison mcabber/mcabber/xmpp.c @ 2291:0d350e979bde

Don't rebuild the buddylist multiple times before a screen refresh
author franky
date Tue, 01 Nov 2016 08:39:07 +0100
parents dc1b123d63d5
children f181418db215
comparison
equal deleted inserted replaced
2290:71ec41732035 2291:0d350e979bde
140 140
141 xmpp_send_s10n(cleanjid, LM_MESSAGE_SUB_TYPE_SUBSCRIBE); 141 xmpp_send_s10n(cleanjid, LM_MESSAGE_SUB_TYPE_SUBSCRIBE);
142 142
143 roster_add_user(cleanjid, name, group, ROSTER_TYPE_USER, sub_pending, -1); 143 roster_add_user(cleanjid, name, group, ROSTER_TYPE_USER, sub_pending, -1);
144 g_free(cleanjid); 144 g_free(cleanjid);
145 buddylist_build(); 145 buddylist_defer_build();
146 146
147 update_roster = TRUE; 147 update_roster = TRUE;
148 } 148 }
149 149
150 void xmpp_updatebuddy(const char *bjid, const char *name, const char *group) 150 void xmpp_updatebuddy(const char *bjid, const char *name, const char *group)
227 lm_message_handler_unref(handler); 227 lm_message_handler_unref(handler);
228 lm_message_unref(iq); 228 lm_message_unref(iq);
229 229
230 roster_del_user(cleanjid); 230 roster_del_user(cleanjid);
231 g_free(cleanjid); 231 g_free(cleanjid);
232 buddylist_build(); 232 buddylist_defer_build();
233 233
234 update_roster = TRUE; 234 update_roster = TRUE;
235 } 235 }
236 236
237 void xmpp_request(const char *fjid, enum iqreq_type reqtype) 237 void xmpp_request(const char *fjid, enum iqreq_type reqtype)
984 roster_add_user(bjid, NULL, NULL, ROSTER_TYPE_ROOM, sub_none, -1); 984 roster_add_user(bjid, NULL, NULL, ROSTER_TYPE_ROOM, sub_none, -1);
985 } else { 985 } else {
986 buddy_settype(room_elt->data, ROSTER_TYPE_ROOM); 986 buddy_settype(room_elt->data, ROSTER_TYPE_ROOM);
987 } 987 }
988 988
989 buddylist_build(); 989 buddylist_defer_build();
990 scr_draw_roster(); 990 scr_draw_roster();
991 goto gotmessage_return; 991 goto gotmessage_return;
992 } 992 }
993 993
994 // We don't call the message_in hook if 'block_unsubscribed' is true and 994 // We don't call the message_in hook if 'block_unsubscribed' is true and