bugfix in contact menu

This commit is contained in:
Yann Leboulanger 2005-06-15 07:38:58 +00:00
parent 7bd2cf9d59
commit 9063034cf8
2 changed files with 6 additions and 8 deletions

View File

@ -331,8 +331,8 @@ _('User names must be of the form "user@servername".')).get_response()
end_iter = message_buffer.get_end_iter()
message = message_buffer.get_text(start_iter, end_iter, 0)
group = self.group_comboboxentry.child.get_text()
self.plugin.roster.req_sub(self, jid, message, self.account, group,
nickname)
self.plugin.roster.req_sub(self, jid, message, self.account,
group = group, pseudo = nickname)
if self.xml.get_widget('auto_authorize_checkbutton').get_active():
gajim.connections[self.account].send_authorization(jid)
self.window.destroy()

View File

@ -589,7 +589,7 @@ class RosterWindow:
item = gtk.MenuItem(_('Rere_quest Authorization from'))
sub_menu.append(item)
item.connect('activate', self.req_sub, jid,
_('I would like to add you to my roster'), account, menuitem=True)
_('I would like to add you to my roster'), account)
else:
item = gtk.MenuItem()
menu.append(item)
@ -738,8 +738,7 @@ class RosterWindow:
dialogs.InformationDialog(_('Authorization has been sent'),
_('Now "%s" will know when your status.') %jid).get_response()
def req_sub(self, widget, jid, txt, account, group=None, pseudo=None,\
menuitem=False):
def req_sub(self, widget, jid, txt, account, group=None, pseudo=None):
'''Request subscription to a user'''
if not pseudo:
pseudo = jid
@ -758,14 +757,13 @@ class RosterWindow:
else:
user1 = self.contacts[account][jid][0]
if not 'not in the roster' in user1.groups:
dialogs.InformationDialog(_('Subscription request has been sent'),
_('If "%s" accepts this request you will know his status.') %jid).get_response()
return
user1.groups = [group]
user1.name = pseudo
self.remove_user(user1, account)
self.add_user_to_roster(jid, account)
if menuitem:
dialogs.InformationDialog(_('Subscription request has been sent'),
_('If "%s" accepts this request you will know his status.') %jid).get_response()
def on_roster_treeview_key_press_event(self, widget, event):
'''when a key is pressed in the treeviews'''