Add a default handler to prettyPrint for unknown commands. (closes #1630963)

This commit is contained in:
James Vega 2007-10-17 01:49:02 +00:00
parent 8c56a60050
commit 35debf5303

View File

@ -317,6 +317,8 @@ def prettyPrint(msg, addRecipients=False, timestampFormat=None, showNick=True):
s = '*** %s changes topic to %s' % (nickorprefix(), msg.args[1])
elif msg.command == 'NICK':
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)
if timestampFormat and at:
s = '%s %s' % (time.strftime(timestampFormat, time.localtime(at)), s)