[Campey] handle optional muc bookmark tags. Fixes #1438
This commit is contained in:
parent
647e033c2d
commit
8458730327
2 changed files with 26 additions and 13 deletions
|
|
@ -2315,7 +2315,12 @@ class Connection:
|
|||
iq4.setAttr('jid', bm['jid'])
|
||||
iq4.setAttr('autojoin', bm['autojoin'])
|
||||
iq4.setAttr('name', bm['name'])
|
||||
# Only add optional elements if not empty
|
||||
# Note: need to handle both None and '' as empty
|
||||
# thus shouldn't use "is not None"
|
||||
if bm['nick']:
|
||||
iq5 = iq4.setTagData('nick', bm['nick'])
|
||||
if bm['password']:
|
||||
iq5 = iq4.setTagData('password', bm['password'])
|
||||
self.to_be_sent.append(iq)
|
||||
|
||||
|
|
|
|||
|
|
@ -2509,8 +2509,16 @@ _('Please be sure to fill out server and room fields or remove this bookmark.'))
|
|||
self.server_entry.set_text(server)
|
||||
|
||||
self.autojoin_checkbutton.set_active(model[iter][3])
|
||||
self.pass_entry.set_text(model[iter][4])
|
||||
self.nick_entry.set_text(model[iter][5])
|
||||
password = model[iter][4].decode('utf-8')
|
||||
if password:
|
||||
self.pass_entry.set_text(password)
|
||||
else:
|
||||
self.pass_entry.set_text('')
|
||||
nick = model[iter][5].decode('utf-8')
|
||||
if nick:
|
||||
self.nick_entry.set_text(nick)
|
||||
else:
|
||||
self.nick_entry.set_text('')
|
||||
|
||||
def on_title_entry_changed(self, widget):
|
||||
(model, iter) = self.selection.get_selected()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue