Moved org finder to the core
Allowed viewing the most recent account logs by using !account log recent Allowed removing of chatbots Moved the so far hardcoded org prefixing into the DB, which allows dynamically changing them. Fix for orgrosters; org leaves are being detected now.
This commit is contained in:
@@ -532,14 +532,21 @@ class AccountService:
|
||||
"VALUES (?, ?, ?, ?, ?, ?)",
|
||||
[main, log_type, delta, leader, message, time.time()])
|
||||
|
||||
def get_logs(self, user, log_type=None, limit=25) -> List[DictObject]:
|
||||
if not log_type:
|
||||
return self.db.query("SELECT * FROM account_log "
|
||||
"where char_id=? and type != 'admin' order by log_id desc LIMIT ? ", [user, limit])
|
||||
|
||||
def get_logs(self, user=None, log_type=None, limit=25) -> List[DictObject]:
|
||||
if not user:
|
||||
if not log_type:
|
||||
return self.db.query("SELECT * FROM account_log "
|
||||
"where type != 'admin' order by log_id desc LIMIT ? ", [limit])
|
||||
else:
|
||||
return self.db.query("SELECT * FROM account_log "
|
||||
"where type=? order by log_id desc LIMIT ?", [log_type, limit])
|
||||
else:
|
||||
return self.db.query("SELECT * FROM account_log "
|
||||
"where char_id=? and type=? order by log_id desc LIMIT ?", [user, log_type, limit])
|
||||
if not log_type:
|
||||
return self.db.query("SELECT * FROM account_log "
|
||||
"where char_id=? and type != 'admin' order by log_id desc LIMIT ? ", [user, limit])
|
||||
else:
|
||||
return self.db.query("SELECT * FROM account_log "
|
||||
"where char_id=? and type=? order by log_id desc LIMIT ?", [user, log_type, limit])
|
||||
|
||||
def get_log_by_id(self, log_id) -> DictObject:
|
||||
return self.db.query_single("SELECT * FROM account_log where log_id=? ", [log_id])
|
||||
|
||||
Reference in New Issue
Block a user