small changes
This commit is contained in:
parent
d9f5bd08e8
commit
9825647585
3 changed files with 28 additions and 19 deletions
|
@ -66,6 +66,8 @@ class GajimCore:
|
||||||
log.debug("subscribe request from %s" % who)
|
log.debug("subscribe request from %s" % who)
|
||||||
if self.cfgParser.Core_alwaysauth == 1 or string.find(who, "@") <= 0:
|
if self.cfgParser.Core_alwaysauth == 1 or string.find(who, "@") <= 0:
|
||||||
self.con.send(common.jabber.Presence(who, 'subscribed'))
|
self.con.send(common.jabber.Presence(who, 'subscribed'))
|
||||||
|
if string.find(who, "@") <= 0:
|
||||||
|
self.hub.sendPlugin('NOTIFY', (who, 'offline', 'offline'))
|
||||||
else:
|
else:
|
||||||
self.hub.sendPlugin('SUBSCRIBE', who)
|
self.hub.sendPlugin('SUBSCRIBE', who)
|
||||||
elif type == 'subscribed':
|
elif type == 'subscribed':
|
||||||
|
@ -205,6 +207,7 @@ class GajimCore:
|
||||||
|
|
||||||
def loadPlugins(gc):
|
def loadPlugins(gc):
|
||||||
modStr = gc.cfgParser.Core_modules
|
modStr = gc.cfgParser.Core_modules
|
||||||
|
if modStr :
|
||||||
mods = string.split (modStr, ' ')
|
mods = string.split (modStr, ' ')
|
||||||
|
|
||||||
for mod in mods:
|
for mod in mods:
|
||||||
|
|
|
@ -798,7 +798,7 @@ class plugin:
|
||||||
user1 = user(jid, jid, ['Agents'], ev[1][1], ev[1][2], 'from')
|
user1 = user(jid, jid, ['Agents'], ev[1][1], ev[1][2], 'from')
|
||||||
iterU = self.r.treestore.append(self.r.l_group['Agents'], \
|
iterU = self.r.treestore.append(self.r.l_group['Agents'], \
|
||||||
(self.r.pixbufs[ev[1][1]], jid, 'agent', FALSE, \
|
(self.r.pixbufs[ev[1][1]], jid, 'agent', FALSE, \
|
||||||
self.userbgcolor, TRUE))
|
self.r.userbgcolor, TRUE))
|
||||||
self.r.l_contact[jid] = {'user':user1, 'iter':[iterU]}
|
self.r.l_contact[jid] = {'user':user1, 'iter':[iterU]}
|
||||||
else:
|
else:
|
||||||
#Update existing line
|
#Update existing line
|
||||||
|
@ -857,6 +857,9 @@ class plugin:
|
||||||
if Wbrowser:
|
if Wbrowser:
|
||||||
Wbrowser.agents(ev[1])
|
Wbrowser.agents(ev[1])
|
||||||
elif ev[0] == 'AGENT_INFO':
|
elif ev[0] == 'AGENT_INFO':
|
||||||
|
if not ev[1][1].has_key('instructions'):
|
||||||
|
warning('error contacting %s' % ev[1][0])
|
||||||
|
else:
|
||||||
Wreg = agent_reg(ev[1][0], ev[1][1], self.r)
|
Wreg = agent_reg(ev[1][0], ev[1][1], self.r)
|
||||||
#('ACC_OK', (hostname, login, pasword, name, ressource))
|
#('ACC_OK', (hostname, login, pasword, name, ressource))
|
||||||
elif ev[0] == 'ACC_OK':
|
elif ev[0] == 'ACC_OK':
|
||||||
|
|
|
@ -49,6 +49,7 @@ class plugin:
|
||||||
return
|
return
|
||||||
elif ev[0] == 'NOTIFY':
|
elif ev[0] == 'NOTIFY':
|
||||||
status = ev[1][2]
|
status = ev[1][2]
|
||||||
|
jid = string.split(ev[1][0], '/')[0]
|
||||||
if not status:
|
if not status:
|
||||||
status = ""
|
status = ""
|
||||||
if lognotsep == 1:
|
if lognotsep == 1:
|
||||||
|
@ -57,16 +58,18 @@ class plugin:
|
||||||
ev[1][1], status))
|
ev[1][1], status))
|
||||||
fic.close()
|
fic.close()
|
||||||
if lognotusr == 1:
|
if lognotusr == 1:
|
||||||
fic = open(LOGPATH + ev[1][0], "a")
|
fic = open(LOGPATH + jid, "a")
|
||||||
fic.write("%s:%s:%s:%s\n" % (tim, ev[1][0], \
|
fic.write("%s:%s:%s:%s\n" % (tim, jid, \
|
||||||
ev[1][1], status))
|
ev[1][1], status))
|
||||||
fic.close()
|
fic.close()
|
||||||
elif ev[0] == 'MSG':
|
elif ev[0] == 'MSG':
|
||||||
fic = open(LOGPATH + ev[1][0], "a")
|
jid = string.split(ev[1][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[1][1]))
|
||||||
fic.close()
|
fic.close()
|
||||||
elif ev[0] == 'MSGSENT':
|
elif ev[0] == 'MSGSENT':
|
||||||
fic = open(LOGPATH + ev[1][0], "a")
|
jid = string.split(ev[1][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[1][1]))
|
||||||
fic.close()
|
fic.close()
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|
Loading…
Add table
Reference in a new issue