diff --git a/Core/core.py b/Core/core.py index a661b4de2..b73ae94e5 100644 --- a/Core/core.py +++ b/Core/core.py @@ -572,7 +572,7 @@ class GajimCore: def connect(self, account): """Connect and authentificate to the Jabber server""" - hostname = self.cfgParser.tab[account]["hostname"] + hostname = self.cfgParser.tab[account]['hostname'] name = self.cfgParser.tab[account]["name"] password = self.passwords[account] if not self.cfgParser.tab[account].has_key('resource'): diff --git a/plugins/gtkgui/dialogs.py b/plugins/gtkgui/dialogs.py index efc9d0824..7993d436d 100644 --- a/plugins/gtkgui/dialogs.py +++ b/plugins/gtkgui/dialogs.py @@ -423,7 +423,9 @@ class Add_contact_window: start_iter = message_buffer.get_start_iter() end_iter = message_buffer.get_end_iter() message = message_buffer.get_text(start_iter, end_iter, 0) - self.plugin.roster.req_sub(self, jid, message, self.account, nickname) + group = self.group_comboboxentry.child.get_text() + self.plugin.roster.req_sub(self, jid, message, self.account, group,\ + nickname) if self.xml.get_widget('auto_authorize_checkbutton').get_active(): self.plugin.send('AUTH', self.account, jid) widget.get_toplevel().destroy() @@ -512,6 +514,13 @@ class Add_contact_window: self.xml.get_widget('uid_entry').set_text(jid_splited[0]) if jid_splited[1] in jid_agents: protocol_combobox.set_active(jid_agents.index(jid_splited[1])+1) + + self.group_comboboxentry = self.xml.get_widget('group_comboboxentry') + liststore = gtk.ListStore(str) + self.group_comboboxentry.set_model(liststore) + for g in self.plugin.roster.groups[account].keys(): + self.group_comboboxentry.append_text(g) + self.xml.signal_autoconnect(self) class About_dialog: diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade index 2e60bfda2..7e2b6b5c2 100644 --- a/plugins/gtkgui/gtkgui.glade +++ b/plugins/gtkgui/gtkgui.glade @@ -1944,7 +1944,7 @@ - + True False diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index 7b755ca22..7431ba66d 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -585,7 +585,8 @@ class plugin: user.name = name user.sub = array[2] user.ask = array[3] - user.groups = array[4] + if array[4]: + user.groups = array[4] self.roster.redraw_jid(jid, account) def read_queue(self): diff --git a/plugins/gtkgui/roster_window.py b/plugins/gtkgui/roster_window.py index 508b87757..2591e6f7f 100644 --- a/plugins/gtkgui/roster_window.py +++ b/plugins/gtkgui/roster_window.py @@ -590,13 +590,15 @@ class Roster_window: """Authorize a user""" self.plugin.send('AUTH', account, jid) - def req_sub(self, widget, jid, txt, account, pseudo=None): + def req_sub(self, widget, jid, txt, account, group=None, pseudo=None): """Request subscription to a user""" if not pseudo: pseudo = jid self.plugin.send('SUB', account, (jid, txt)) if not self.contacts[account].has_key(jid): - user1 = User(jid, pseudo, ['General'], 'requested', \ + if not group: + group = 'General' + user1 = User(jid, pseudo, [group], 'requested', \ 'requested', 'none', 'subscribe', '', 0, '') self.contacts[account][jid] = [user1] self.add_user_to_roster(jid, account)