we can now choose a group when we add a user
This commit is contained in:
parent
0efac5ef4d
commit
f1e6a30dcc
5 changed files with 18 additions and 6 deletions
|
@ -572,7 +572,7 @@ class GajimCore:
|
||||||
|
|
||||||
def connect(self, account):
|
def connect(self, account):
|
||||||
"""Connect and authentificate to the Jabber server"""
|
"""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"]
|
name = self.cfgParser.tab[account]["name"]
|
||||||
password = self.passwords[account]
|
password = self.passwords[account]
|
||||||
if not self.cfgParser.tab[account].has_key('resource'):
|
if not self.cfgParser.tab[account].has_key('resource'):
|
||||||
|
|
|
@ -423,7 +423,9 @@ class Add_contact_window:
|
||||||
start_iter = message_buffer.get_start_iter()
|
start_iter = message_buffer.get_start_iter()
|
||||||
end_iter = message_buffer.get_end_iter()
|
end_iter = message_buffer.get_end_iter()
|
||||||
message = message_buffer.get_text(start_iter, end_iter, 0)
|
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():
|
if self.xml.get_widget('auto_authorize_checkbutton').get_active():
|
||||||
self.plugin.send('AUTH', self.account, jid)
|
self.plugin.send('AUTH', self.account, jid)
|
||||||
widget.get_toplevel().destroy()
|
widget.get_toplevel().destroy()
|
||||||
|
@ -512,6 +514,13 @@ class Add_contact_window:
|
||||||
self.xml.get_widget('uid_entry').set_text(jid_splited[0])
|
self.xml.get_widget('uid_entry').set_text(jid_splited[0])
|
||||||
if jid_splited[1] in jid_agents:
|
if jid_splited[1] in jid_agents:
|
||||||
protocol_combobox.set_active(jid_agents.index(jid_splited[1])+1)
|
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)
|
self.xml.signal_autoconnect(self)
|
||||||
|
|
||||||
class About_dialog:
|
class About_dialog:
|
||||||
|
|
|
@ -1944,7 +1944,7 @@
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkComboBoxEntry" id="comboboxentry1">
|
<widget class="GtkComboBoxEntry" id="group_comboboxentry">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="items" translatable="yes"></property>
|
<property name="items" translatable="yes"></property>
|
||||||
<property name="add_tearoffs">False</property>
|
<property name="add_tearoffs">False</property>
|
||||||
|
|
|
@ -585,7 +585,8 @@ class plugin:
|
||||||
user.name = name
|
user.name = name
|
||||||
user.sub = array[2]
|
user.sub = array[2]
|
||||||
user.ask = array[3]
|
user.ask = array[3]
|
||||||
user.groups = array[4]
|
if array[4]:
|
||||||
|
user.groups = array[4]
|
||||||
self.roster.redraw_jid(jid, account)
|
self.roster.redraw_jid(jid, account)
|
||||||
|
|
||||||
def read_queue(self):
|
def read_queue(self):
|
||||||
|
|
|
@ -590,13 +590,15 @@ class Roster_window:
|
||||||
"""Authorize a user"""
|
"""Authorize a user"""
|
||||||
self.plugin.send('AUTH', account, jid)
|
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"""
|
"""Request subscription to a user"""
|
||||||
if not pseudo:
|
if not pseudo:
|
||||||
pseudo = jid
|
pseudo = jid
|
||||||
self.plugin.send('SUB', account, (jid, txt))
|
self.plugin.send('SUB', account, (jid, txt))
|
||||||
if not self.contacts[account].has_key(jid):
|
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, '')
|
'requested', 'none', 'subscribe', '', 0, '')
|
||||||
self.contacts[account][jid] = [user1]
|
self.contacts[account][jid] = [user1]
|
||||||
self.add_user_to_roster(jid, account)
|
self.add_user_to_roster(jid, account)
|
||||||
|
|
Loading…
Add table
Reference in a new issue