log groupchat messages
This commit is contained in:
parent
8e2a95f46c
commit
093c3e8335
1 changed files with 15 additions and 3 deletions
|
@ -84,12 +84,13 @@ class plugin:
|
||||||
status = string.replace(status, '\n', '\\n')
|
status = string.replace(status, '\n', '\\n')
|
||||||
if lognotsep == 1:
|
if lognotsep == 1:
|
||||||
fic = open(LOGPATH + "notify.log", "a")
|
fic = open(LOGPATH + "notify.log", "a")
|
||||||
fic.write("%s:%s:%s:%s\n" % (tim, ev[2][0], \
|
fic.write("%s:%s:%s:%s\n" % (tim, ev[2][0] + '/' + ev[2][3], \
|
||||||
ev[2][1], status))
|
ev[2][1], status))
|
||||||
fic.close()
|
fic.close()
|
||||||
if lognotusr == 1:
|
if lognotusr == 1:
|
||||||
|
print jid
|
||||||
fic = open(LOGPATH + jid, "a")
|
fic = open(LOGPATH + jid, "a")
|
||||||
fic.write("%s:%s:%s:%s\n" % (tim, jid, \
|
fic.write("%s:%s:%s:%s\n" % (tim, ev[2][0] + '/' + ev[2][3], \
|
||||||
ev[2][1], status))
|
ev[2][1], status))
|
||||||
fic.close()
|
fic.close()
|
||||||
elif ev[0] == 'MSG':
|
elif ev[0] == 'MSG':
|
||||||
|
@ -105,6 +106,17 @@ class plugin:
|
||||||
fic = open(LOGPATH + jid, "a")
|
fic = open(LOGPATH + jid, "a")
|
||||||
fic.write("%s:sent:%s\n" % (tim, msg))
|
fic.write("%s:sent:%s\n" % (tim, msg))
|
||||||
fic.close()
|
fic.close()
|
||||||
|
elif ev[0] == 'GC_MSG':
|
||||||
|
msg = string.replace(ev[2][1], '\n', '\\n')
|
||||||
|
jids = string.split(ev[2][0], '/')
|
||||||
|
jid = jids[0]
|
||||||
|
nick = ''
|
||||||
|
if len(jids) > 1:
|
||||||
|
nick = string.split(ev[2][0], '/')[1]
|
||||||
|
fic = open(LOGPATH + jid, "a")
|
||||||
|
t = time.mktime(ev[2][2])
|
||||||
|
fic.write("%s:recv:%s:%s\n" % (t, nick, msg))
|
||||||
|
fic.close()
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
def wait(self, what):
|
def wait(self, what):
|
||||||
|
@ -121,7 +133,7 @@ class plugin:
|
||||||
self.queueIN = quIN
|
self.queueIN = quIN
|
||||||
self.queueOUT = quOUT
|
self.queueOUT = quOUT
|
||||||
quOUT.put(('REG_MESSAGE', 'logger', ['CONFIG', 'NOTIFY', 'MSG', \
|
quOUT.put(('REG_MESSAGE', 'logger', ['CONFIG', 'NOTIFY', 'MSG', \
|
||||||
'MSGSENT', 'QUIT']))
|
'MSGSENT', 'GC_MSG', 'QUIT']))
|
||||||
quOUT.put(('ASK_CONFIG', None, ('Logger', 'Logger', {\
|
quOUT.put(('ASK_CONFIG', None, ('Logger', 'Logger', {\
|
||||||
'lognotsep':1, 'lognotusr':1})))
|
'lognotsep':1, 'lognotusr':1})))
|
||||||
self.config = self.wait('CONFIG')
|
self.config = self.wait('CONFIG')
|
||||||
|
|
Loading…
Add table
Reference in a new issue