1
0
mirror of http://aero2k.de/t/repos/urlbot-native.git synced 2017-09-06 15:25:38 +02:00

temporarily disable full bot protection, fix light protection

This commit is contained in:
Thorsten S
2015-12-21 14:17:00 +01:00
parent 4e78a2229e
commit d9dff033b5
3 changed files with 6 additions and 4 deletions

View File

@@ -67,6 +67,7 @@ def runtimeconf_get(key, default=None):
@interprocess_locked(runtime_config_store.filename) @interprocess_locked(runtime_config_store.filename)
def runtimeconf_persist(): def runtimeconf_persist():
logging.getLogger(__name__).debug(json.dumps(runtime_config_store, indent=2))
runtime_config_store.write() runtime_config_store.write()

View File

@@ -962,6 +962,7 @@ def recognize_bots(**args):
if username not in config.runtime_config_store['other_bots']: if username not in config.runtime_config_store['other_bots']:
config.runtime_config_store['other_bots'].append(username) config.runtime_config_store['other_bots'].append(username)
config.runtimeconf_persist() config.runtimeconf_persist()
log.info("Adding {} to the list of bots (now {})".format(username, config.runtime_config_store['other_bots']))
return { return {
'event': { 'event': {
'time': time.time() + 3, 'time': time.time() + 3,
@@ -970,9 +971,9 @@ def recognize_bots(**args):
} }
if any([phrase in args['data'] for phrase in unique_standard_phrases]): 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']: 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) @pluginfunction("remove-from-botlist", "remove a user from the botlist", ptypes_COMMAND)

View File

@@ -158,8 +158,8 @@ class UrlBot(IdleBot):
if msg_obj: if msg_obj:
# TODO: bot modes off/on/auto... this should be active for "on". # TODO: bot modes off/on/auto... this should be active for "on".
# message = _prevent_panic(message, msg_obj['from'].bare) # message = _prevent_panic(message, msg_obj['from'].bare)
if get_bots_present(msg_obj['from'].bare): # if get_bots_present(msg_obj['from'].bare):
return # return
self.send_message( self.send_message(
mto=msg_obj['from'].bare, mto=msg_obj['from'].bare,
mbody=message, mbody=message,