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-10-11 21:35:01 (GMT)
committer Richard Darst <rkd@zgib.net>2009-10-11 21:35:01 (GMT)
commit3f956996b2c101aaf4bf8bdd5c175d7c2f2bbe44 (patch)
tree5ed597f2759aa64359c79b90834b805faee54827
parent81a7e071d9865e3c36090c0cd7cf0f59297df145 (diff)
Warn when #chair'ing a nick that isn't in the channel
darcs-hash:20091011213501-82ea9-3c525113fb5d54919bb81220143d64217c562fdb.gz
-rw-r--r--meeting.py7
-rw-r--r--plugin.py4
2 files changed, 9 insertions, 2 deletions
diff --git a/meeting.py b/meeting.py
index 00e04ca..fff694e 100644
--- a/meeting.py
+++ b/meeting.py
@@ -340,6 +340,10 @@ class MeetingCommands(object):
chair = chair.strip()
if not chair: continue
if chair not in self.chairs:
+ if self._channelNicks is not None and \
+ ( chair.encode(self.config.input_codec)
+ not in self._channelNicks()):
+ self.reply("Warning: Nick not in channel: %s"%chair)
self.addnick(chair, lines=0)
self.chairs.setdefault(chair, True)
chairs = dict(self.chairs) # make a copy
@@ -433,7 +437,7 @@ class Meeting(MeetingCommands, object):
def __init__(self, channel, owner, oldtopic=None,
filename=None, writeRawLog=False,
setTopic=None, sendReply=None, getRegistryValue=None,
- safeMode=False,
+ safeMode=False, channelNicks=None,
extraConfig={}):
self.config = Config(self, writeRawLog=writeRawLog, safeMode=safeMode,
extraConfig=extraConfig)
@@ -458,6 +462,7 @@ class Meeting(MeetingCommands, object):
self._meetingTopic = None
self._meetingname = ""
self._meetingIsOver = False
+ self._channelNicks = channelNicks
if filename:
self._filename = filename
diff --git a/plugin.py b/plugin.py
index c1b3518..9b003b0 100644
--- a/plugin.py
+++ b/plugin.py
@@ -98,12 +98,14 @@ class MeetBot(callbacks.Plugin):
irc.sendMsg(ircmsgs.topic(channel, x))
def _sendReply(x):
irc.sendMsg(ircmsgs.privmsg(channel, x))
+ def _channelNicks():
+ return irc.state.channels[channel].users
M = meeting.Meeting(channel=channel, owner=nick,
oldtopic=irc.state.channels[channel].topic,
writeRawLog=True,
setTopic = _setTopic, sendReply = _sendReply,
getRegistryValue = self.registryValue,
- safeMode=True
+ safeMode=True, channelNicks=_channelNicks,
)
meeting_cache[Mkey] = M
recent_meetings.append(