diff --git a/src/ircmsgs.py b/src/ircmsgs.py index 20533bbe5..4f3d5c6d5 100644 --- a/src/ircmsgs.py +++ b/src/ircmsgs.py @@ -81,8 +81,9 @@ class IrcMsg(object): # data. Goodbye, __slots__. # On second thought, let's use methods for tagging. __slots__ = ('args', 'command', 'host', 'nick', 'prefix', 'user', - '_hash', '_str', '_repr', '_len', 'tags') - def __init__(self, s='', command='', args=(), prefix='', msg=None): + '_hash', '_str', '_repr', '_len', 'tags', 'reply_env') + def __init__(self, s='', command='', args=(), prefix='', msg=None, + reply_env=None): assert not (msg and s), 'IrcMsg.__init__ cannot accept both s and msg' if not s and not command and not msg: raise MalformedIrcMsg('IRC messages require a command.') @@ -90,6 +91,7 @@ class IrcMsg(object): self._repr = None self._hash = None self._len = None + self.reply_env = reply_env self.tags = {} if s: originalString = s diff --git a/src/ircutils.py b/src/ircutils.py index 9c293e4dc..7f552e00e 100644 --- a/src/ircutils.py +++ b/src/ircutils.py @@ -713,6 +713,8 @@ def standardSubstitute(irc, msg, text, env=None): 's': localtime[5], 'sec': localtime[5], 'second': localtime[5], 'tz': time.strftime('%Z', localtime), }) + if msg.reply_env: + vars.update(msg.reply_env) if env is not None: vars.update(env) t = string.Template(text)