change the name of the contact in the treeview when we change its name in the info window

This commit is contained in:
Yann Leboulanger 2004-05-25 17:24:48 +00:00
parent f66843d833
commit 1ae38e7568
1 changed files with 4 additions and 3 deletions

View File

@ -69,10 +69,11 @@ class infoUser_Window:
#update user.name if it's not "" #update user.name if it's not ""
entry_name = self.xml.get_widget('entry_name') entry_name = self.xml.get_widget('entry_name')
newName = entry_name.get_text() newName = entry_name.get_text()
if newName != self.user.name: if newName != self.user.name and newName != '':
update = 1 update = 1
if newName != '': self.user.name = newName
self.user.name = newName for i in self.plugin.roster.get_user_iter(self.user.jid, self.account):
self.plugin.roster.tree.get_model().set_value(i, 1, newName)
if update: if update:
self.plugin.send('UPDUSER', self.account, (self.user.jid, \ self.plugin.send('UPDUSER', self.account, (self.user.jid, \
self.user.name, self.user.groups)) self.user.name, self.user.groups))