diff options
author | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-12-03 14:37:04 -0500 |
---|---|---|
committer | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-12-03 15:51:12 -0500 |
commit | 59fc36b800ebcd9c1b1ace3cb2876a38c9b64614 (patch) | |
tree | 37e5084dc862ddad56f7ff654af425abfe141885 | |
parent | 7bb061f6408b43fd29a75d6b2536a0ec92045094 (diff) |
bugfix: don't delete Group if it isn't empty
-rw-r--r-- | butterfly/channel/group.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/butterfly/channel/group.py b/butterfly/channel/group.py index 848c099..08f2bf2 100644 --- a/butterfly/channel/group.py +++ b/butterfly/channel/group.py @@ -107,6 +107,8 @@ class ButterflyGroupChannel(ButterflyListChannel, logger.debug("Deleting group %s" % self._handle.name) ab = self._conn.msn_client.address_book group = self._handle.group + if len(ab.contacts.search_by_groups(group)) == 0: + raise telepathy.NotAvailable("Can't delete non-empty group") ab.delete_group(group) def _filter_contact(self, contact): |