parent
569eee98bf
commit
2bed6bc625
|
@ -230,9 +230,12 @@ class GajimCore:
|
|||
while 1:
|
||||
if not self.hub.queueIn.empty():
|
||||
ev = self.hub.queueIn.get()
|
||||
if ev[1] and (ev[1] in self.connexions.values()):
|
||||
for con in self.connexions.keys():
|
||||
if ev[1] == self.connexions[con]:
|
||||
break
|
||||
else:
|
||||
con = None
|
||||
#('QUIT', account, ())
|
||||
if ev[0] == 'QUIT':
|
||||
# for con in self.connexions.keys():
|
||||
|
@ -358,6 +361,12 @@ class GajimCore:
|
|||
print "error " + c.lastErr
|
||||
else:
|
||||
self.hub.sendPlugin('ACC_OK', ev[1], ev[2])
|
||||
#('ACC_CHG', old_account, new_account)
|
||||
elif ev[0] == 'ACC_CHG':
|
||||
self.connected[ev[2]] = self.connected[ev[1]]
|
||||
del self.connected[ev[1]]
|
||||
if con:
|
||||
self.connexions[con] = self.connected[ev[2]]
|
||||
#('ASK_VCARD', account, jid)
|
||||
elif ev[0] == 'ASK_VCARD':
|
||||
iq = common.jabber.Iq(to=ev[2], type="get")
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkWindow" id="Gajim">
|
||||
<property name="visible">True</property>
|
||||
|
|
|
@ -622,17 +622,29 @@ class accountPreference_Window:
|
|||
del self.plugin.roster.groups[self.account]
|
||||
del self.plugin.roster.contacts[self.account]
|
||||
del self.plugin.accounts[self.account]
|
||||
self.plugin.send('ACC_CHG', self.account, name)
|
||||
self.plugin.accounts[name] = {'name': login, 'hostname': hostname,\
|
||||
'password': entryPass.get_text(), 'ressource': \
|
||||
entryRessource.get_text()}
|
||||
self.plugin.send('CONFIG', None, ('accounts', self.plugin.accounts))
|
||||
#refresh accounts window
|
||||
if self.plugin.windows.has_key('accounts'):
|
||||
self.plugin.windows['accounts'].init_accounts()
|
||||
#refresh roster
|
||||
self.plugin.roster.draw_roster()
|
||||
widget.get_toplevel().destroy()
|
||||
return
|
||||
#if it's a new account
|
||||
else:
|
||||
if name in self.plugin.accounts.keys():
|
||||
warning_Window('An account already has this name')
|
||||
return 0
|
||||
return
|
||||
#if we neeed to register a new account
|
||||
if check.get_active():
|
||||
self.plugin.send('NEW_ACC', None, (hostname, login, \
|
||||
entryPass.get_text(), name, entryRessource.get_text()))
|
||||
check.set_active(FALSE)
|
||||
return 1
|
||||
return
|
||||
self.plugin.accounts[name] = {'name': login, 'hostname': hostname,\
|
||||
'password': entryPass.get_text(), 'ressource': \
|
||||
entryRessource.get_text()}
|
||||
|
@ -814,7 +826,7 @@ class authorize_Window:
|
|||
self.jid = jid
|
||||
self.account = account
|
||||
xml.get_widget('label').set_text('Subscription request from ' + self.jid)
|
||||
xml.get_widget("textview_sub").get_buffer().set_text(txt)
|
||||
xml.get_widget("textview").get_buffer().set_text(txt)
|
||||
xml.signal_connect('on_button_auth_clicked', self.auth)
|
||||
xml.signal_connect('on_button_deny_clicked', self.deny)
|
||||
xml.signal_connect('on_button_close_clicked', self.on_close)
|
||||
|
@ -1276,7 +1288,7 @@ class roster_Window:
|
|||
item.set_submenu(menu_sub)
|
||||
item = gtk.MenuItem("Resend authorization to")
|
||||
menu_sub.append(item)
|
||||
item.connect("activate", self.authorize, jid)
|
||||
item.connect("activate", self.authorize, jid, account)
|
||||
item = gtk.MenuItem("Rerequest authorization from")
|
||||
menu_sub.append(item)
|
||||
item.connect("activate", self.req_sub, jid, \
|
||||
|
@ -1433,7 +1445,7 @@ class roster_Window:
|
|||
def on_add(self, widget, account):
|
||||
"""When add user is selected :
|
||||
call the add class"""
|
||||
addContact_Window(self, account)
|
||||
addContact_Window(self.plugin, account)
|
||||
|
||||
def on_about(self, widget):
|
||||
"""When about is selected :
|
||||
|
@ -1545,7 +1557,7 @@ class roster_Window:
|
|||
"""when show offline option is changed :
|
||||
redraw the treeview"""
|
||||
self.plugin.config['showoffline'] = 1 - self.plugin.config['showoffline']
|
||||
self.redraw_roster()
|
||||
self.draw_roster()
|
||||
|
||||
def __init__(self, plugin):
|
||||
# FIXME : handle no file ...
|
||||
|
|
|
@ -44,29 +44,29 @@ class plugin:
|
|||
print "plugin logger stopped"
|
||||
return
|
||||
elif ev[0] == 'NOTIFY':
|
||||
status = ev[1][2]
|
||||
jid = string.split(ev[1][0], '/')[0]
|
||||
status = ev[2][2]
|
||||
jid = string.split(ev[2][0], '/')[0]
|
||||
if not status:
|
||||
status = ""
|
||||
if lognotsep == 1:
|
||||
fic = open(LOGPATH + "notify.log", "a")
|
||||
fic.write("%s:%s:%s:%s\n" % (tim, ev[1][0], \
|
||||
ev[1][1], status))
|
||||
fic.write("%s:%s:%s:%s\n" % (tim, ev[2][0], \
|
||||
ev[2][1], status))
|
||||
fic.close()
|
||||
if lognotusr == 1:
|
||||
fic = open(LOGPATH + jid, "a")
|
||||
fic.write("%s:%s:%s:%s\n" % (tim, jid, \
|
||||
ev[1][1], status))
|
||||
ev[2][1], status))
|
||||
fic.close()
|
||||
elif ev[0] == 'MSG':
|
||||
jid = string.split(ev[1][0], '/')[0]
|
||||
jid = string.split(ev[2][0], '/')[0]
|
||||
fic = open(LOGPATH + jid, "a")
|
||||
fic.write("%s:recv:%s\n" % (tim, ev[1][1]))
|
||||
fic.write("%s:recv:%s\n" % (tim, ev[2][1]))
|
||||
fic.close()
|
||||
elif ev[0] == 'MSGSENT':
|
||||
jid = string.split(ev[1][0], '/')[0]
|
||||
jid = string.split(ev[2][0], '/')[0]
|
||||
fic = open(LOGPATH + jid, "a")
|
||||
fic.write("%s:sent:%s\n" % (tim, ev[1][1]))
|
||||
fic.write("%s:sent:%s\n" % (tim, ev[2][1]))
|
||||
fic.close()
|
||||
time.sleep(0.5)
|
||||
|
||||
|
@ -76,14 +76,14 @@ class plugin:
|
|||
while 1:
|
||||
if not self.queueIN.empty():
|
||||
ev = self.queueIN.get()
|
||||
if ev[0] == what and ev[1][0] == 'Logger':
|
||||
return ev[1][1]
|
||||
if ev[0] == what and ev[2][0] == 'Logger':
|
||||
return ev[2][1]
|
||||
time.sleep(0.1)
|
||||
|
||||
def __init__(self, quIN, quOUT):
|
||||
self.queueIN = quIN
|
||||
self.queueOUT = quOUT
|
||||
quOUT.put(('ASK_CONFIG', ('Logger', 'Logger', {\
|
||||
quOUT.put(('ASK_CONFIG', None, ('Logger', 'Logger', {\
|
||||
'lognotsep':1, 'lognotusr':1})))
|
||||
self.config = self.wait('CONFIG')
|
||||
#create ~/.gajim/logs/ if it doesn't exist
|
||||
|
|
Loading…
Reference in New Issue