Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
manually update code priv list
  • Loading branch information
iBug committed Sep 18, 2018
1 parent ad6e41e commit e4914ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions chatcommands.py
Expand Up @@ -729,6 +729,7 @@ def amicodeprivileged(msg):
:param msg:
:return: A string
"""
update_code_privileged_users_list()
if is_code_privileged(msg._client.host, msg.owner.id):
return "\u2713 You are a code-privileged user."

Expand Down
13 changes: 8 additions & 5 deletions datahandling.py
Expand Up @@ -3,7 +3,7 @@
# noinspection PyPep8Naming
import pickle
from datetime import datetime
from metasmoke import Metasmoke
import metasmoke
import requests
import json
import time
Expand Down Expand Up @@ -155,12 +155,15 @@ def is_auto_ignored_post(postid_site_tuple):
return False


# noinspection PyUnusedLocal
def update_code_privileged_users_list():
metasmoke.Metasmoke.update_code_privileged_users_list()
_dump_pickle("codePrivileges.p", GlobalVars.code_privileged_users)


def is_code_privileged(site, user_id):
if GlobalVars.code_privileged_users is None:
Metasmoke.update_code_privileged_users_list()
update_code_privileged_users_list()

_dump_pickle("codePrivileges.p", GlobalVars.code_privileged_users)
# For now, disable the moderator override on code/blacklist changes
return (site, user_id) in GlobalVars.code_privileged_users

Expand Down Expand Up @@ -458,7 +461,7 @@ def append_pings(original_message, names):
def has_community_bumped_post(post_url, post_content):
if GlobalVars.metasmoke_key is not None and GlobalVars.metasmoke_host is not None:
try:
ms_posts = Metasmoke.get_post_bodies_from_ms(post_url)
ms_posts = metasmoke.Metasmoke.get_post_bodies_from_ms(post_url)
if not ms_posts:
return False

Expand Down

0 comments on commit e4914ef

Please sign in to comment.