whitespace fixes
This commit is contained in:
@@ -1,11 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
|
|
||||||
import config
|
import config
|
||||||
from plugin_system import pluginfunction, ptypes
|
from plugin_system import pluginfunction, ptypes
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
comment_joins_strings = [
|
comment_joins_strings = [
|
||||||
@@ -17,8 +16,8 @@ comment_joins_strings = [
|
|||||||
@config.config_locked
|
@config.config_locked
|
||||||
def comment_joins(**args):
|
def comment_joins(**args):
|
||||||
# max elapsed time between the latest and the N latest join
|
# max elapsed time between the latest and the N latest join
|
||||||
timespan = 120
|
timespan = 120
|
||||||
max_joins = 6
|
max_joins = config.runtime_config_store
|
||||||
|
|
||||||
current_timestamp = int(time.time())
|
current_timestamp = int(time.time())
|
||||||
|
|
||||||
@@ -26,7 +25,7 @@ def comment_joins(**args):
|
|||||||
arg_user_key = arg_user.lower()
|
arg_user_key = arg_user.lower()
|
||||||
|
|
||||||
if arg_user_key not in config.runtime_config_store['user_joins']:
|
if arg_user_key not in config.runtime_config_store['user_joins']:
|
||||||
config.runtime_config_store['user_joins'][arg_user_key] = [ current_timestamp ]
|
config.runtime_config_store['user_joins'][arg_user_key] = [current_timestamp]
|
||||||
config.runtimeconf_persist()
|
config.runtimeconf_persist()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@@ -42,7 +41,7 @@ def comment_joins(**args):
|
|||||||
config.runtime_config_store['user_joins'].pop(arg_user_key)
|
config.runtime_config_store['user_joins'].pop(arg_user_key)
|
||||||
config.runtimeconf_persist()
|
config.runtimeconf_persist()
|
||||||
log.info("send comment on join")
|
log.info("send comment on join")
|
||||||
return { 'msg': random.choice(comment_joins_strings) % arg_user }
|
return {'msg': random.choice(comment_joins_strings) % arg_user}
|
||||||
else:
|
else:
|
||||||
user_joins.append(current_timestamp)
|
user_joins.append(current_timestamp)
|
||||||
config.runtime_config_store['user_joins'][arg_user_key] = user_joins
|
config.runtime_config_store['user_joins'][arg_user_key] = user_joins
|
||||||
|
|||||||
Reference in New Issue
Block a user