=> ed447a57221142914d7058624648d834f3370926
[1mdiff --git a/model.py b/model.py[m [1mindex 06eb0e6..9c892c1 100644[m [1m--- a/model.py[m [1m+++ b/model.py[m [36m@@ -51,7 +51,8 @@[m [mclass Notification:[m ISSUE_CLOSED = 0x200[m [m def __init__(self, id, type, dst, src, post, is_sent, ts,[m [31m- src_name=None, post_title=None, post_issueid=None):[m [32m+[m[32m src_name=None, post_title=None, post_issueid=None,[m [32m+[m[32m post_subname=None, post_subowner=None):[m self.id = id[m self.type = type[m self.dst = dst[m [36m@@ -62,6 +63,8 @@[m [mclass Notification:[m self.src_name = src_name[m self.post_title = post_title[m self.post_issueid = post_issueid[m [32m+[m[32m self.post_subname = post_subname[m [32m+[m[32m self.post_subowner = post_subowner[m [m def ymd_date(self):[m dt = datetime.datetime.fromtimestamp(self.ts, UTC)[m [36m@@ -93,6 +96,8 @@[m [mclass Notification:[m icon = '💬 '[m elif self.type == Notification.POST_BY_FOLLOWED_USER:[m event = 'published new a post'[m [32m+[m[32m elif self.type == Notification.POST_IN_FOLLOWED_SUBSPACE:[m [32m+[m[32m event = f'posted in followed subspace {"u/" if self.post_subowner else "s/"}{self.post_subname}'[m elif self.type == Notification.MENTION:[m event = 'mentioned you'[m elif self.type == Notification.NEW_POLL:[m [36m@@ -1558,17 +1563,19 @@[m [mclass Database:[m cur.execute(f"""[m SELECT[m n.id, n.type, n.dst, n.src, n.post, n.is_sent, UNIX_TIMESTAMP(n.ts),[m [31m- u.name, p.title, p.issueid[m [32m+[m[32m u.name, p.title, p.issueid, s.name, s.owner[m FROM notifs n[m JOIN users u ON src=u.id[m JOIN posts p ON post=p.id[m [32m+[m[32m JOIN subspaces s ON s.id=p.subspace[m WHERE {' AND '.join(cond)}[m ORDER BY ts[m """, tuple(values))[m notifs = [][m [31m- for (id, type, dst, src, post, is_sent, ts, src_name, post_title, post_issueid) in cur:[m [32m+[m[32m for (id, type, dst, src, post, is_sent, ts, src_name, post_title, post_issueid, post_subname, post_subowner) in cur:[m notifs.append(Notification(id, type, dst, src, post, is_sent, ts,[m [31m- src_name, post_title, post_issueid))[m [32m+[m[32m src_name, post_title, post_issueid,[m [32m+[m[32m post_subname, post_subowner))[m if clear and notifs:[m cur.execute(f"DELETE FROM notifs WHERE id IN ({','.join(map(lambda n: str(n.id), notifs))})", list())[m self.commit()[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).