Added functionality to protect private commands from being @more <nicked>, and fixed the fact that it doesn't work across the Relay.

This commit is contained in:
Jeremy Fincher 2003-09-08 19:43:33 +00:00
parent 89d5f7a088
commit 61a0142265
2 changed files with 9 additions and 4 deletions

View File

@ -165,6 +165,8 @@ class MiscCommands(callbacks.Privmsg):
messages = pprint.pformat(irc.state.history[-10:])
email = textwrap.dedent("""
Subject: %s
From: jemfinch@users.sourceforge.net
To: supybot-bugs@lists.sourceforge.net
Date: %s
Bug report for Supybot %s.
@ -247,10 +249,12 @@ class MiscCommands(callbacks.Privmsg):
userHostmask = msg.prefix.split('!', 1)[1]
if nick:
try:
hostmask = irc.state.nickToHostmask(nick)
otherUserHostmask = hostmask.split('!', 1)[1]
L = self._mores[otherUserHostmask][:]
self._mores[userHostmask] = L
(public, L) = self._mores[nick]
if public:
self._mores[userHostmask] = L[:]
else:
irc.error(msg, '%s has no public mores.' % nick)
return
except KeyError:
irc.error(msg, 'Sorry, I can\'t find a hostmask for %s' % nick)
return

View File

@ -385,6 +385,7 @@ class IrcObjectProxy:
utils.nItems(len(msgs), 'message', 'more')
mask = msg.prefix.split('!', 1)[1]
Privmsg._mores[mask] = msgs
Privmsg._mores[msg.nick]=(ircutils.isChannel(msg.args[0]),msgs)
self.irc.queueMsg(reply(msg, response, self.prefixName))
else:
self.args[self.counter] = s