diff options
author | mathieui <mathieui@mathieui.net> | 2012-04-27 22:53:58 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-04-27 22:53:58 +0200 |
commit | 3bd893e6b446db9c6fa16bf8cbf9b1f03ae78bcd (patch) | |
tree | b1fe25aa136942fe658784ab392174bc6b436c65 /src | |
parent | f71e2a9cb13446b27239023a1e7c796e15c8fc47 (diff) | |
download | poezio-3bd893e6b446db9c6fa16bf8cbf9b1f03ae78bcd.tar.gz poezio-3bd893e6b446db9c6fa16bf8cbf9b1f03ae78bcd.tar.bz2 poezio-3bd893e6b446db9c6fa16bf8cbf9b1f03ae78bcd.tar.xz poezio-3bd893e6b446db9c6fa16bf8cbf9b1f03ae78bcd.zip |
Update group commands
Diffstat (limited to 'src')
-rw-r--r-- | src/tabs.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tabs.py b/src/tabs.py index 1f44da88..8683add1 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1811,15 +1811,15 @@ class RosterInfoTab(Tab): jid = JID(args[0]).bare name = args[1] if len(args) == 2 else '' - contact = roster.get_contact_by_jid(jid) - if not contact: + contact = roster[jid] + if contact is None: self.core.information(_('No such JID in roster'), 'Error') return groups = set(contact.groups) subscription = contact.subscription - if self.core.xmpp.update_roster(jid, name=name, groups=groups, subscription=subscription): - contact.name = name + if not self.core.xmpp.update_roster(jid, name=name, groups=groups, subscription=subscription): + self.core.information('The name could not be set.', 'Error') def command_groupadd(self, args): """ @@ -1831,8 +1831,8 @@ class RosterInfoTab(Tab): jid = JID(args[0]).bare group = args[1] - contact = roster.get_contact_by_jid(jid) - if not contact: + contact = roster[jid] + if contact is None: self.core.information(_('No such JID in roster'), 'Error') return @@ -1850,7 +1850,7 @@ class RosterInfoTab(Tab): name = contact.name subscription = contact.subscription if self.core.xmpp.update_roster(jid, name=name, groups=new_groups, subscription=subscription): - roster.edit_groups_of_contact(contact, new_groups) + roster.update_contact_groups(jid) def command_groupremove(self, args): """ @@ -1862,8 +1862,8 @@ class RosterInfoTab(Tab): jid = JID(args[0]).bare group = args[1] - contact = roster.get_contact_by_jid(jid) - if not contact: + contact = roster[jid] + if contact is None: self.core.information(_('No such JID in roster'), 'Error') return @@ -1880,7 +1880,7 @@ class RosterInfoTab(Tab): name = contact.name subscription = contact.subscription if self.core.xmpp.update_roster(jid, name=name, groups=new_groups, subscription=subscription): - roster.edit_groups_of_contact(contact, new_groups) + roster.update_contact_groups(jid) def command_remove(self, args): """ |