Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugin.py
diff options
context:
space:
mode:
authorRichard Darst <rkd@zgib.net>2009-07-31 21:31:47 (GMT)
committer Richard Darst <rkd@zgib.net>2009-07-31 21:31:47 (GMT)
commit61fd50a22d30c9f74e47ac5f50ac1fbbd53796f5 (patch)
tree212bc4b1813f246aa7bd2f04b9b811079a2b9a5a /plugin.py
parentaafae93a30120fc1a6a08f2d913aba9292dfac63 (diff)
Make MeetBot able to log output from other supybot commands
- Responds to a bug report from fedora-devel list. - Now meetbot's output will appear in the logs, too. Before it didn't, such as the start meeting messages. darcs-hash:20090731213147-82ea9-14f497fb994bcee1b0210c27d5c95eb9e2d45125.gz
Diffstat (limited to 'plugin.py')
-rw-r--r--plugin.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugin.py b/plugin.py
index 59f5657..88d418d 100644
--- a/plugin.py
+++ b/plugin.py
@@ -119,6 +119,23 @@ class MeetBot(callbacks.Plugin):
#M.save() # now do_endmeeting in M calls the save functions
del meeting_cache[Mkey]
+ def outFilter(self, irc, msg):
+ """Log outgoing messages from supybot.
+ """
+ # Gotta catch my own messages *somehow* :)
+ # Let's try this little trick...
+ if msg.command in ('PRIVMSG'):
+ # Note that we have to get our nick and network parameters
+ # in a slightly different way here, compared to doPrivmsg.
+ nick = irc.nick
+ channel = msg.args[0]
+ payload = msg.args[1]
+ Mkey = (channel,irc.network)
+ M = meeting_cache.get(Mkey, None)
+ if M is not None:
+ M.addrawline(nick, payload)
+ return msg
+
# These are admin commands, for use by the bot owner when there
# are many channels which may need to be independently managed.
def listmeetings(self, irc, msg, args):