Fix fallback for bookmark name

This commit is contained in:
Philipp Hörist 2018-09-08 23:53:12 +02:00
parent 27dd36cca3
commit 0a20cb5997
1 changed files with 3 additions and 2 deletions

View File

@ -305,10 +305,11 @@ class Bookmarks:
None, account=self._account))
def get_name_from_bookmark(self, jid):
fallback = jid.split('@')[0]
try:
return self.bookmarks[jid]['name']
return self.bookmarks[jid]['name'] or fallback
except KeyError:
return jid.split('@')[0]
return fallback
def purge_pubsub_bookmarks(self):
log.info('Purge/Delete Bookmarks on PubSub, '