Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
709c0ea0 by wurstsalat at 2021-09-04T00:35:03+02:00
RosterItemExchange: Fix roster actions
- - - - -
1 changed file:
- gajim/gtk/roster_item_exchange.py
Changes:
=====================================
gajim/gtk/roster_item_exchange.py
=====================================
@@ -201,10 +201,13 @@ def _on_accept_button_clicked(self, _widget):
if app.jid_is_transport(self._jid_from):
self._client.get_module('Presence').automatically_added.append(
jid)
- # TODO:
- app.interface.roster.req_sub(
- self, jid, message, self.account, groups=groups,
- nickname=model[iter_][2], auto_auth=True)
+
+ self._client.get_module('Presence').subscribe(
+ jid,
+ msg=message,
+ name=model[iter_][2],
+ groups=groups,
+ auto_auth=True)
iter_ = model.iter_next(iter_)
InformationDialog(i18n.ngettext('Added %d contact',
'Added %d contacts',
@@ -220,15 +223,10 @@ def _on_accept_button_clicked(self, _widget):
groups = model[iter_][3].split(', ')
if groups == ['']:
groups = []
- # TODO:
- for contact in app.contacts.get_contact(self.account, jid):
- contact.name = model[iter_][2]
- self._client.get_module('Roster').update_contact(
+ self._client.get_module('Roster').set_item(
jid, model[iter_][2], groups)
- self._client.get_module('Roster').draw_contact(
- jid, self.account)
+
# Update opened chats
- # TODO:
ctrl = app.window.get_control(self.account, jid)
if ctrl:
ctrl.update_ui()
@@ -242,9 +240,7 @@ def _on_accept_button_clicked(self, _widget):
# It is selected
jid = model[iter_][1]
self._client.get_module('Presence').unsubscribe(jid)
- # TODO:
- app.interface.roster.remove_contact(jid, self.account)
- app.contacts.remove_jid(self.account, jid)
+ self._client.get_module('Roster').delete_item(jid)
iter_ = model.iter_next(iter_)
InformationDialog(i18n.ngettext('Removed %d contact',
'Removed %d contacts',
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/709c0ea0a95267f96cebc80ad147df75eddc923c
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/709c0ea0a95267f96cebc80ad147df75eddc923c
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits