mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-12-02 08:07:26 +01:00
Add a default handler to prettyPrint for unknown commands. (closes #1630963)
This commit is contained in:
parent
8c56a60050
commit
35debf5303
@ -171,7 +171,7 @@ class IrcMsg(object):
|
|||||||
self.prefix == other.prefix and \
|
self.prefix == other.prefix and \
|
||||||
self.args == other.args
|
self.args == other.args
|
||||||
__req__ = __eq__ # I don't know exactly what this does, but it can't hurt.
|
__req__ = __eq__ # I don't know exactly what this does, but it can't hurt.
|
||||||
|
|
||||||
def __ne__(self, other):
|
def __ne__(self, other):
|
||||||
return not (self == other)
|
return not (self == other)
|
||||||
__rne__ = __ne__ # Likewise as above.
|
__rne__ = __ne__ # Likewise as above.
|
||||||
@ -317,6 +317,8 @@ def prettyPrint(msg, addRecipients=False, timestampFormat=None, showNick=True):
|
|||||||
s = '*** %s changes topic to %s' % (nickorprefix(), msg.args[1])
|
s = '*** %s changes topic to %s' % (nickorprefix(), msg.args[1])
|
||||||
elif msg.command == 'NICK':
|
elif msg.command == 'NICK':
|
||||||
s = '*** %s is now known as %s' % (msg.nick, msg.args[0])
|
s = '*** %s is now known as %s' % (msg.nick, msg.args[0])
|
||||||
|
else:
|
||||||
|
s = utils.str.format('--- Unknown command %q', ' '.join(msg.args))
|
||||||
at = getattr(msg, 'receivedAt', None)
|
at = getattr(msg, 'receivedAt', None)
|
||||||
if timestampFormat and at:
|
if timestampFormat and at:
|
||||||
s = '%s %s' % (time.strftime(timestampFormat, time.localtime(at)), s)
|
s = '%s %s' % (time.strftime(timestampFormat, time.localtime(at)), s)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user