From a5b3011ea4601a78d0c01aab141dd0e16c886aa0 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 12 May 2017 19:58:03 -0700 Subject: [PATCH] networks: clear the 'remote command used' state and break if overriding account/reply target fails --- plugins/networks.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/networks.py b/plugins/networks.py index fbd67af..6700be6 100644 --- a/plugins/networks.py +++ b/plugins/networks.py @@ -100,10 +100,14 @@ def remote(irc, source, args): # Force remoteirc.called_in to something private in order to prevent # accidental information leakage from replies. - remoteirc.called_in = remoteirc.called_by = remoteirc.pseudoclient.uid + try: + remoteirc.called_in = remoteirc.called_by = remoteirc.pseudoclient.uid - # Set the identification override to the caller's account. - remoteirc.pseudoclient.account = irc.users[source].account + # Set the identification override to the caller's account. + remoteirc.pseudoclient.account = irc.users[source].account + except: + REMOTE_IN_USE.clear() + raise def _remote_reply(placeholder_self, text, **kwargs): """