update_user => update_contact

This commit is contained in:
Nikos Kouremenos 2005-07-18 14:52:28 +00:00
parent 6615a51a3a
commit 4ec2eea678
4 changed files with 11 additions and 11 deletions

View File

@ -59,10 +59,10 @@ class EditGroupsDialog:
self.dialog.run() self.dialog.run()
self.dialog.destroy() self.dialog.destroy()
if self.changes_made: if self.changes_made:
gajim.connections[self.account].update_user(self.user.jid, gajim.connections[self.account].update_contact(self.user.jid,
self.user.name, self.user.groups) self.user.name, self.user.groups)
def update_user(self): def update_contact(self):
self.plugin.roster.remove_user(self.user, self.account) self.plugin.roster.remove_user(self.user, self.account)
self.plugin.roster.add_contact_to_roster(self.user.jid, self.account) self.plugin.roster.add_contact_to_roster(self.user.jid, self.account)
@ -80,7 +80,7 @@ class EditGroupsDialog:
self.changes_made = True self.changes_made = True
model.append((group, True)) model.append((group, True))
self.user.groups.append(group) self.user.groups.append(group)
self.update_user() self.update_contact()
def group_toggled_cb(self, cell, path): def group_toggled_cb(self, cell, path):
self.changes_made = True self.changes_made = True
@ -95,7 +95,7 @@ class EditGroupsDialog:
self.user.groups.append(model[path][0]) self.user.groups.append(model[path][0])
else: else:
self.user.groups.remove(model[path][0]) self.user.groups.remove(model[path][0])
self.update_user() self.update_contact()
def init_list(self): def init_list(self):
store = gtk.ListStore(str, bool) store = gtk.ListStore(str, bool)

View File

@ -465,7 +465,7 @@ class Interface:
if len(u.groups) == 0: if len(u.groups) == 0:
u.groups = [_('General')] u.groups = [_('General')]
self.roster.add_contact_to_roster(u.jid, account) self.roster.add_contact_to_roster(u.jid, account)
gajim.connections[account].update_user(u.jid, u.name, u.groups) gajim.connections[account].update_contact(u.jid, u.name, u.groups)
else: else:
keyID = '' keyID = ''
attached_keys = gajim.config.get_per('accounts', account, attached_keys = gajim.config.get_per('accounts', account,

View File

@ -1601,8 +1601,8 @@ _('If "%s" accepts this request you will know his status.') %jid).get_response()
pass pass
def on_cell_edited(self, cell, row, new_text): def on_cell_edited(self, cell, row, new_text):
'''When an iter is editer : '''When an iter is edited:
if text has changed, rename the user''' if text has changed, rename the contact'''
model = self.tree.get_model() model = self.tree.get_model()
iter = model.get_iter_from_string(row) iter = model.get_iter_from_string(row)
path = model.get_path(iter) path = model.get_path(iter)
@ -1614,7 +1614,7 @@ _('If "%s" accepts this request you will know his status.') %jid).get_response()
if old_text != new_text: if old_text != new_text:
for u in self.contacts[account][jid]: for u in self.contacts[account][jid]:
u.name = new_text u.name = new_text
gajim.connections[account].update_user(jid, new_text, u.groups) gajim.connections[account].update_contact(jid, new_text, u.groups)
self.draw_contact(jid, account) self.draw_contact(jid, account)
elif type == 'group': elif type == 'group':
old_name = model.get_value(iter, 1) old_name = model.get_value(iter, 1)
@ -1627,7 +1627,7 @@ _('If "%s" accepts this request you will know his status.') %jid).get_response()
user.groups.remove(old_name) user.groups.remove(old_name)
user.groups.append(new_text) user.groups.append(new_text)
self.add_contact_to_roster(user.jid, account) self.add_contact_to_roster(user.jid, account)
gajim.connections[account].update_user(user.jid, user.name, gajim.connections[account].update_contact(user.jid, user.name,
user.groups) user.groups)
model.set_value(iter, 5, False) model.set_value(iter, 5, False)
@ -1912,7 +1912,7 @@ _('If "%s" accepts this request you will know his status.') %jid).get_response()
if not grp_dest in u.groups: if not grp_dest in u.groups:
u.groups.append(grp_dest) u.groups.append(grp_dest)
self.add_contact_to_roster(data, account) self.add_contact_to_roster(data, account)
gajim.connections[account].update_user(u.jid, u.name, u.groups) gajim.connections[account].update_contact(u.jid, u.name, u.groups)
if context.action == gtk.gdk.ACTION_MOVE: if context.action == gtk.gdk.ACTION_MOVE:
context.finish(True, True, etime) context.finish(True, True, etime)
return return

View File

@ -86,7 +86,7 @@ class VcardWindow:
self.user.name = new_name self.user.name = new_name
for i in self.plugin.roster.get_contact_iter(self.user.jid, self.account): for i in self.plugin.roster.get_contact_iter(self.user.jid, self.account):
self.plugin.roster.tree.get_model().set_value(i, 1, new_name) self.plugin.roster.tree.get_model().set_value(i, 1, new_name)
gajim.connections[self.account].update_user(self.user.jid, gajim.connections[self.account].update_contact(self.user.jid,
self.user.name, self.user.groups) self.user.name, self.user.groups)
#log history ? #log history ?
oldlog = True oldlog = True