when we remove an agent we need to remove it with its resource (especially when we are not really registererd {wrong password})

This commit is contained in:
Yann Leboulanger 2005-05-11 09:12:18 +00:00
parent b5244d8a9c
commit fa183bae5d
1 changed files with 9 additions and 8 deletions

View File

@ -365,7 +365,7 @@ class Roster_window:
#get resource #get resource
resource = '' resource = ''
if len(jids) > 1: if len(jids) > 1:
resource = jids[1:] resource = '/'.join(jids[1:])
#get name #get name
name = array[jid]['name'] name = array[jid]['name']
if not name: if not name:
@ -435,14 +435,14 @@ class Roster_window:
'''When an agent is requested to log in or off''' '''When an agent is requested to log in or off'''
gajim.connections[account].send_agent_status(jid, state) gajim.connections[account].send_agent_status(jid, state)
def on_remove_agent(self, widget, jid, account): def on_remove_agent(self, widget, user, account):
'''When an agent is requested to log in or off''' '''When an agent is requested to log in or off'''
window = dialogs.Confirmation_dialog(_('Are you sure you want to remove the agent %s from your roster?') % jid) window = dialogs.Confirmation_dialog(_('Are you sure you want to remove the agent %s from your roster?') % user.jid)
if window.get_response() == gtk.RESPONSE_YES: if window.get_response() == gtk.RESPONSE_YES:
gajim.connections[account].unsubscribe_agent(jid) gajim.connections[account].unsubscribe_agent(user.jid + '/' \
for u in self.contacts[account][jid]: + user.resource)
self.remove_user(u, account) self.remove_user(user, account)
del self.contacts[account][u.jid] del self.contacts[account][user.jid]
def on_rename(self, widget, iter, path): def on_rename(self, widget, iter, path):
model = self.tree.get_model() model = self.tree.get_model()
@ -535,6 +535,7 @@ class Roster_window:
jid = model.get_value(iter, 3) jid = model.get_value(iter, 3)
path = model.get_path(iter) path = model.get_path(iter)
account = model.get_value(iter, 4) account = model.get_value(iter, 4)
user = self.contacts[account][jid][0]
menu = gtk.Menu() menu = gtk.Menu()
item = gtk.MenuItem(_('Log on')) item = gtk.MenuItem(_('Log on'))
#FIXME: what about error? #FIXME: what about error?
@ -555,7 +556,7 @@ class Roster_window:
item = gtk.MenuItem(_('Remove')) item = gtk.MenuItem(_('Remove'))
menu.append(item) menu.append(item)
item.connect('activate', self.on_remove_agent, jid, account) item.connect('activate', self.on_remove_agent, user, account)
menu.popup(None, None, None, event.button, event.time) menu.popup(None, None, None, event.button, event.time)
menu.show_all() menu.show_all()