mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
Elide ignored replies from nested command output.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
parent
d78f7b6ac5
commit
c10d964604
@ -1,5 +1,6 @@
|
||||
###
|
||||
# Copyright (c) 2002-2004, Jeremiah Fincher
|
||||
# Copyright (c) 2010, James Vega
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -43,7 +44,11 @@ class Utilities(callbacks.Plugin):
|
||||
Does nothing. Useful sometimes for sequencing commands when you don't
|
||||
care about their non-error return values.
|
||||
"""
|
||||
pass
|
||||
if irc.nested:
|
||||
msg.tag('ignored')
|
||||
# Need to call NestedCommandsIrcProxy.reply to continue evaluation
|
||||
# of the remaining nested commands.
|
||||
irc.reply('')
|
||||
# Do be careful not to wrap this unless you do any('something').
|
||||
|
||||
def success(self, irc, msg, args, text):
|
||||
|
@ -1,6 +1,6 @@
|
||||
###
|
||||
# Copyright (c) 2002-2005, Jeremiah Fincher
|
||||
# Copyright (c) 2008-2009, James Vega
|
||||
# Copyright (c) 2008-2010, James Vega
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -920,7 +920,14 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
||||
finally:
|
||||
self._resetReplyAttributes()
|
||||
else:
|
||||
self.args[self.counter] = s
|
||||
if msg.ignored:
|
||||
# Since the final reply string is constructed via
|
||||
# ' '.join(self.args), the args index for ignored commands
|
||||
# needs to be popped to avoid extra spaces in the final reply.
|
||||
self.args.pop(self.counter)
|
||||
msg.tag('ignored', False)
|
||||
else:
|
||||
self.args[self.counter] = s
|
||||
self.evalArgs()
|
||||
|
||||
def error(self, s='', Raise=False, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user