Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Darst <rkd@zgib.net>2009-07-08 19:33:53 (GMT)
committer Richard Darst <rkd@zgib.net>2009-07-08 19:33:53 (GMT)
commit014d99acb4fa25f5c3d0f2a4bb814fab165a4210 (patch)
treead26c2b4230f2ca38edb8c324d79ea9970913fa6
parentaded36e115745c500c23ae06cfd283298dbddf3a (diff)
Add a `recent` supybot command to list recent meetings
- This is mainly to help audit use of the bot, see what channels and when are using it. Right now limits to history of the last 10 meetings. darcs-hash:20090708193353-82ea9-992a76035ab5237f89f686db12489587064166a3.gz
-rw-r--r--plugin.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/plugin.py b/plugin.py
index 7415e22..4080e6d 100644
--- a/plugin.py
+++ b/plugin.py
@@ -49,7 +49,8 @@ try:
meeting_cache
except NameError:
meeting_cache = {}
-
+ recent_meetings = [ ]
+
class MeetBot(callbacks.Plugin):
"""Add the help for "@plugin help MeetBot" here
@@ -102,6 +103,10 @@ class MeetBot(callbacks.Plugin):
M._sendReply = _sendReply
# callback to get supybot registry values.
M._registryValue = self.registryValue
+ recent_meetings.append(
+ (channel, irc.msg.tags['receivedOn'], time.ctime()))
+ if len(recent_meetings) > 10:
+ del recent_meetings[0]
# If there is no meeting going on, then we quit
if M is None: return
# Add line to our meeting buffer.
@@ -163,6 +168,18 @@ class MeetBot(callbacks.Plugin):
irc.reply("Deleted: meeting on (%s, %s)."%(channel, network))
deletemeeting = wrap(deletemeeting, ['admin', "channel", "something",
optional("boolean", True)])
+ def recent(self, irc, msg, args):
+ reply = []
+ for channel, network, ctime in recent_meetings:
+ Mkey = (channel,network)
+ if Mkey in meeting_cache: state = ", running"
+ else: state = ""
+ reply.append("(%s, %s, %s%s)"%(channel, network, ctime, state))
+ if reply:
+ irc.reply(" ".join(reply))
+ else:
+ irc.reply("No recent meetings in internal state.")
+ recent = wrap(recent, ['admin'])
def pingall(self, irc, msg, args, message):
"""<text>