add !verifiedrich and /h/highrollerclub for paypigs

master
Aevann 2023-08-01 09:46:00 +03:00
parent 18df32de4b
commit 0900277226
4 changed files with 19 additions and 1 deletions

View File

@ -1126,6 +1126,7 @@ class User(Base):
elif isinstance(other, Sub): elif isinstance(other, Sub):
if other.name == 'chudrama': return bool(user) and user.can_see_chudrama if other.name == 'chudrama': return bool(user) and user.can_see_chudrama
if other.name == 'countryclub': return bool(user) and user.can_see_countryclub if other.name == 'countryclub': return bool(user) and user.can_see_countryclub
if other.name == 'highrollerclub': return bool(user) and user.can_see_highrollerclub
elif isinstance(other, User): elif isinstance(other, User):
return (user and user.id == other.id) or (user and user.can_see_shadowbanned) or not other.shadowbanned return (user and user.id == other.id) or (user and user.can_see_shadowbanned) or not other.shadowbanned
return True return True
@ -1165,6 +1166,16 @@ class User(Base):
return False return False
@property
@lazy
def can_see_highrollerclub(self):
if self.can_see_restricted_holes != None:
return self.can_see_restricted_holes
if self.patron: return True
return False
@property @property
@lazy @lazy
def can_post_in_ghost_threads(self): def can_post_in_ghost_threads(self):

View File

@ -165,6 +165,11 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False, log_cost=None):
elif i.group(1) == 'jannies': elif i.group(1) == 'jannies':
group = None group = None
member_ids = set([x[0] for x in g.db.query(User.id).filter(User.admin_level > 0, User.id != AEVANN_ID).all()]) member_ids = set([x[0] for x in g.db.query(User.id).filter(User.admin_level > 0, User.id != AEVANN_ID).all()])
elif i.group(1) == 'verifiedrich':
if not v.patron:
abort(403, f"Only !verifiedrich members can mention it!")
group = None
member_ids = set([x[0] for x in g.db.query(User.id).filter(User.patron > 0).all()])
else: else:
group = g.db.get(Group, i.group(1)) group = g.db.get(Group, i.group(1))
if not group: continue if not group: continue

View File

@ -420,6 +420,8 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
return f'<a href="/users">!{name}</a>' return f'<a href="/users">!{name}</a>'
elif name == 'jannies': elif name == 'jannies':
return f'<a href="/admins">!{name}</a>' return f'<a href="/admins">!{name}</a>'
elif name == 'verifiedrich':
return f'<a href="/h/highrollerclub">!{name}</a>'
elif g.db.get(Group, name): elif g.db.get(Group, name):
return f'<a href="/!{name}">!{name}</a>' return f'<a href="/!{name}">!{name}</a>'
else: else:

View File

@ -32,7 +32,7 @@ def create_group(v):
if not valid_sub_regex.fullmatch(name): if not valid_sub_regex.fullmatch(name):
return redirect(f"/ping_groups?error=Name does not match the required format!") return redirect(f"/ping_groups?error=Name does not match the required format!")
if name in {'everyone', 'jannies'} or g.db.get(Group, name): if name in {'everyone', 'jannies', 'verifiedrich'} or g.db.get(Group, name):
return redirect(f"/ping_groups?error=This group already exists!") return redirect(f"/ping_groups?error=This group already exists!")
if not v.charge_account('combined', GROUP_COST)[0]: if not v.charge_account('combined', GROUP_COST)[0]: