Exemple #1
0
def init(config, _db, _ch):
    global db, ch, spam_scores, blacklist_contact, enable_signing
    db = _db
    ch = _ch
    spam_scores = ScoreKeeper()

    blacklist_contact = config.get("blacklist_contact", "")
    enable_signing = config["enable_signing"]

    # initialize db if empty
    if db.getSystemConfig() is None:
        c = SystemConfig()
        c.defaults()
        db.setSystemConfig(c)
Exemple #2
0
def init(config, _db, _ch):
	global db, ch, spam_scores, blacklist_contact, enable_signing, media_limit_period
	db = _db
	ch = _ch
	spam_scores = ScoreKeeper()

	blacklist_contact = config.get("blacklist_contact", "")
	enable_signing = config["enable_signing"]
	if "media_limit_period" in config.keys():
		media_limit_period = timedelta(hours=int(config["media_limit_period"]))

	# initialize db if empty
	if db.getSystemConfig() is None:
		c = SystemConfig()
		c.defaults()
		db.setSystemConfig(c)
Exemple #3
0
def init(config, _db, _ch):
	global db, ch, spam_scores, blacklist_contact, enable_signing, allow_remove_command, media_limit_period, sign_interval
	db = _db
	ch = _ch
	spam_scores = ScoreKeeper()

	blacklist_contact = config.get("blacklist_contact", "")
	enable_signing = config["enable_signing"]
	allow_remove_command = config["allow_remove_command"]
	if "media_limit_period" in config.keys():
		media_limit_period = timedelta(hours=int(config["media_limit_period"]))
	sign_interval = timedelta(seconds=int(config.get("sign_limit_interval", 600)))

	# initialize db if empty
	if db.getSystemConfig() is None:
		c = SystemConfig()
		c.defaults()
		db.setSystemConfig(c)