def init(): """ called after reload """ saymonitor.start() jabbermonitor.start() saymonitor.add('relay', saycb, prerelaysay, True) jabbermonitor.add('relay', jabbersaycb, jabberprerelaysay, True) return 1
def init(): global stopped callbacks.add('ALL', supylogcb, presupylogcb) jcallbacks.add('ALL', jabbersupylogcb, jabberpresupylogcb) outmonitor.add('supylog', supylogcb, presupylogcb) jabbermonitor.add('supylog', jabbersupylogcb, jabberpresupylogcb) stopped = False return 1
def init(): global stopped callbacks.add("ALL", simplelogcb, presimplelogcb) jcallbacks.add("ALL", jabbersimplelogcb, jabberpresimplelogcb) outmonitor.add("simplelog", simplelogcb, presimplelogcb) jabbermonitor.add("simplelog", jabbersimplelogcb, jabberpresimplelogcb) stopped = False return 1
return if to in logs.loglist: return 1 def jcblogsay(botname, msg): """ log the jabber message """ try: to = str(msg.getTo()) txt = msg.getBody() except: return logs.logbot(botname, time.time(), to, txt) jabbermonitor.add('log', jcblogsay, jprelogsay) def prelog(bot, ievent): """ log pre condition """ if ievent.channel and ievent.channel in logs.loglist: return 1 def logcb(bot, ievent): """ callback that logs ievent """ logs.log(bot.name, time.time(), ievent) callbacks.add('ALL', logcb, prelog) jcallbacks.add('Message', logcb, prelog)
to = str(msg.getTo()) except: return if to in logs.loglist: return 1 def jcblogsay(botname, msg): """ log the jabber message """ try: to = str(msg.getTo()) txt = msg.getBody() except: return logs.logbot(botname, time.time(), to, txt) jabbermonitor.add('log', jcblogsay, jprelogsay) def prelog(bot, ievent): """ log pre condition """ if ievent.channel and ievent.channel in logs.loglist: return 1 def logcb(bot, ievent): """ callback that logs ievent """ logs.log(bot.name, time.time(), ievent) callbacks.add('ALL', logcb, prelog) jcallbacks.add('Message', logcb, prelog) def handle_logon(bot, ievent): """ log-on .. enable logging in channel the command was given in """