diff --git a/plugins/gtkgui/dialogs.py b/plugins/gtkgui/dialogs.py index da3ecd530a88cd45ada324db84bb68de84cf7d2d..36dbe40f7f793ec3feec64b9f88c92895be37b9a 100644 --- a/plugins/gtkgui/dialogs.py +++ b/plugins/gtkgui/dialogs.py @@ -227,12 +227,12 @@ class Edit_groups_dialog: def run(self): self.dialog.run() self.dialog.destroy() - #TODO: send to the core + #TODO: do not send if unnecesary + self.plugin.send('UPDUSER', self.account, (self.user.jid, \ + self.user.name, self.user.groups)) def update_user(self): - luser = self.plugin.roster.contacts[self.account][self.user.jid] - for u in luser: - self.plugin.roster.remove_user(u, self.account) + self.plugin.roster.remove_user(self.user, self.account) self.plugin.roster.add_user_to_roster(self.user.jid, self.account) def on_add_button_clicked(self, widget): @@ -255,7 +255,6 @@ class Edit_groups_dialog: if model[path][1] and len(self.user.groups) == 1: # we try to remove # the latest group Error_dialog(_('There must be at least one group for each contact')) - #TODO: re-set the checkbutton return model[path][1] = not model[path][1] if model[path][1]: diff --git a/plugins/gtkgui/roster_window.py b/plugins/gtkgui/roster_window.py index af8988df06971f7990a59819de89cda7b32f9957..54a59a39fe3203b39f7e90a0b442de5ce4dbcf34 100644 --- a/plugins/gtkgui/roster_window.py +++ b/plugins/gtkgui/roster_window.py @@ -163,9 +163,18 @@ class roster_window: model = self.tree.get_model() for i in self.get_user_iter(user.jid, account): parent_i = model.iter_parent(i) + group = model.get_value(parent_i, 3) model.remove(i) if model.iter_n_children(parent_i) == 0: model.remove(parent_i) + # We need to check all contacts, even offline contacts + group_empty = True + for jid in self.contacts[account]: + if group in self.contacts[account][jid][0].groups: + group_empty = False + break + if group_empty: + del self.groups[account][group] def redraw_jid(self, jid, account): """draw the correct pixbuf and name"""