From d9dff033b521e55d52d6951441ed1f5100cc5002 Mon Sep 17 00:00:00 2001 From: Thorsten S Date: Mon, 21 Dec 2015 14:17:00 +0100 Subject: [PATCH] temporarily disable full bot protection, fix light protection --- config.py | 1 + plugins.py | 5 +++-- urlbot.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config.py b/config.py index f2aad85..2208e70 100644 --- a/config.py +++ b/config.py @@ -67,6 +67,7 @@ def runtimeconf_get(key, default=None): @interprocess_locked(runtime_config_store.filename) def runtimeconf_persist(): + logging.getLogger(__name__).debug(json.dumps(runtime_config_store, indent=2)) runtime_config_store.write() diff --git a/plugins.py b/plugins.py index 71511d9..5a2ea28 100644 --- a/plugins.py +++ b/plugins.py @@ -962,6 +962,7 @@ def recognize_bots(**args): if username not in config.runtime_config_store['other_bots']: config.runtime_config_store['other_bots'].append(username) config.runtimeconf_persist() + log.info("Adding {} to the list of bots (now {})".format(username, config.runtime_config_store['other_bots'])) return { 'event': { 'time': time.time() + 3, @@ -970,9 +971,9 @@ def recognize_bots(**args): } if any([phrase in args['data'] for phrase in unique_standard_phrases]): - _add_to_list(args['reply_user'], 'Making notes...') + return _add_to_list(args['reply_user'], 'Making notes...') elif 'I\'ll be back' in args['data']: - _add_to_list(args['reply_user'], 'Hey there, buddy!') + return _add_to_list(args['reply_user'], 'Hey there, buddy!') @pluginfunction("remove-from-botlist", "remove a user from the botlist", ptypes_COMMAND) diff --git a/urlbot.py b/urlbot.py index 0428a94..7ef43c5 100755 --- a/urlbot.py +++ b/urlbot.py @@ -158,8 +158,8 @@ class UrlBot(IdleBot): if msg_obj: # TODO: bot modes off/on/auto... this should be active for "on". # message = _prevent_panic(message, msg_obj['from'].bare) - if get_bots_present(msg_obj['from'].bare): - return + # if get_bots_present(msg_obj['from'].bare): + # return self.send_message( mto=msg_obj['from'].bare, mbody=message,