Skip to content
Snippets Groups Projects
Commit eb229303 authored by jimpp's avatar jimpp
Browse files

do a little less loops

parent 06fdc836
No related branches found
No related tags found
No related merge requests found
......@@ -1733,21 +1733,20 @@ class GroupchatControl(ChatControlBase):
'nick': self.nick
}
place_found = False
index = 0
# check for duplicate entry and espect alpha order
for bookmark in gajim.connections[self.account].bookmarks:
if bookmark['jid'] == bm['jid']:
dialogs.ErrorDialog(
_('Bookmark already set'),
_('Group Chat "%s" is already in your bookmarks.') % bm['jid'])
return
place_found = False
index = 0
# Respect alpha order
for bookmark in gajim.connections[self.account].bookmarks:
if bookmark['name'] > bm['name']:
place_found = True
break
index += 1
if place_found:
gajim.connections[self.account].bookmarks.insert(index, bm)
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment