mirror of
https://git.skyjake.fi/gemini/bubble.git
synced 2024-06-22 16:47:09 +00:00
Show dormant moderators; fixed a couple of regressions
This commit is contained in:
parent
bcdf1e7962
commit
263498483c
|
@ -219,7 +219,7 @@ Bubble is open source:
|
|||
if num_notifs > 0:
|
||||
notifs += f' — 🔔 {num_notifs} notification{plural_s(num_notifs)}'
|
||||
|
||||
num_drafts = self.db.count_posts(user=self.user, draft=True)
|
||||
num_drafts = self.db.count_posts(user=self.user, draft=True, is_comment=None)
|
||||
if num_drafts > 0:
|
||||
notifs += f' — ✏️ {num_drafts} draft{plural_s(num_drafts)}'
|
||||
|
||||
|
|
19
feeds.py
19
feeds.py
|
@ -683,8 +683,11 @@ def make_feed_page(session):
|
|||
if context.url:
|
||||
topinfo += f'=> {context.url}\n'
|
||||
# Users moderating this subspace.
|
||||
now = time.time()
|
||||
for mod in context_mods:
|
||||
topinfo += f'=> /u/{mod.name} {mod.avatar} Moderated by: {mod.name}\n'
|
||||
dormant_days = (now - mod.ts_active) / 3600 / 24
|
||||
dormant = f' · 😴 {int(dormant_days)} days' if dormant_days > 60 else ''
|
||||
topinfo += f'=> /u/{mod.name} {mod.avatar} Moderated by: {mod.name}{dormant}\n'
|
||||
if session.is_context_locked:
|
||||
topinfo += '=> /help/locked 🔒 Locked\n'
|
||||
|
||||
|
@ -720,13 +723,13 @@ def make_feed_page(session):
|
|||
sort_mode = ' 💬'
|
||||
feed_sort_mode = Post.SORT_CREATED
|
||||
|
||||
omit_user_subspaces = (user.flags & User.HOME_NO_USERS_FEED_FLAG) != 0
|
||||
omit_nonuser_subspaces = (user.flags & User.HOME_USERS_FEED_FLAG) != 0
|
||||
rotate_per_day = (session.is_rotation_enabled()
|
||||
and not context
|
||||
and not is_flat_feed
|
||||
and feed_sort_mode == Post.SORT_CREATED
|
||||
and not filter_by_followed)
|
||||
if not is_issue_tracker and not context:
|
||||
omit_user_subspaces = (user.flags & User.HOME_NO_USERS_FEED_FLAG) != 0
|
||||
omit_nonuser_subspaces = (user.flags & User.HOME_USERS_FEED_FLAG) != 0
|
||||
rotate_per_day = (session.is_rotation_enabled()
|
||||
and not is_flat_feed
|
||||
and feed_sort_mode == Post.SORT_CREATED
|
||||
and not filter_by_followed)
|
||||
|
||||
# Pagination.
|
||||
num_total = db.count_posts(subspace=context,
|
||||
|
|
6
model.py
6
model.py
|
@ -1201,16 +1201,16 @@ class Database:
|
|||
cur = self.conn.cursor()
|
||||
cur.execute("""
|
||||
SELECT
|
||||
u.id, u.avatar, u.name
|
||||
u.id, u.avatar, u.name, UNIX_TIMESTAMP(u.ts_active)
|
||||
FROM mods m JOIN users u ON u.id=m.user
|
||||
WHERE m.subspace=?
|
||||
ORDER BY u.name
|
||||
""", (subspace,))
|
||||
|
||||
mods = []
|
||||
for (id, avatar, name) in cur:
|
||||
for (id, avatar, name, ts_active) in cur:
|
||||
mods.append(User(id, name, None, None, None, avatar, None, None, None, None, None, None, None,
|
||||
None, None, None, None, None, None))
|
||||
None, None, ts_active, None, None, None))
|
||||
return mods
|
||||
|
||||
def modify_mods(self, subspace, actor=None, add=None, remove=None):
|
||||
|
|
Loading…
Reference in New Issue
Block a user