forked from MarseyWorld/MarseyWorld
add !verifiedrich and /h/highrollerclub for paypigs
parent
18df32de4b
commit
0900277226
|
@ -1126,6 +1126,7 @@ class User(Base):
|
|||
elif isinstance(other, Sub):
|
||||
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 == 'highrollerclub': return bool(user) and user.can_see_highrollerclub
|
||||
elif isinstance(other, User):
|
||||
return (user and user.id == other.id) or (user and user.can_see_shadowbanned) or not other.shadowbanned
|
||||
return True
|
||||
|
@ -1165,6 +1166,16 @@ class User(Base):
|
|||
|
||||
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
|
||||
@lazy
|
||||
def can_post_in_ghost_threads(self):
|
||||
|
|
|
@ -165,6 +165,11 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False, log_cost=None):
|
|||
elif i.group(1) == 'jannies':
|
||||
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()])
|
||||
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:
|
||||
group = g.db.get(Group, i.group(1))
|
||||
if not group: continue
|
||||
|
|
|
@ -420,6 +420,8 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
|
|||
return f'<a href="/users">!{name}</a>'
|
||||
elif name == 'jannies':
|
||||
return f'<a href="/admins">!{name}</a>'
|
||||
elif name == 'verifiedrich':
|
||||
return f'<a href="/h/highrollerclub">!{name}</a>'
|
||||
elif g.db.get(Group, name):
|
||||
return f'<a href="/!{name}">!{name}</a>'
|
||||
else:
|
||||
|
|
|
@ -32,7 +32,7 @@ def create_group(v):
|
|||
if not valid_sub_regex.fullmatch(name):
|
||||
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!")
|
||||
|
||||
if not v.charge_account('combined', GROUP_COST)[0]:
|
||||
|
|
Loading…
Reference in New Issue