Bubble [main]

Added missing description of a notification

=> ed447a57221142914d7058624648d834f3370926

diff --git a/model.py b/model.py
index 06eb0e6..9c892c1 100644
--- a/model.py
+++ b/model.py
@@ -51,7 +51,8 @@ class Notification:
     ISSUE_CLOSED              = 0x200
 
     def __init__(self, id, type, dst, src, post, is_sent, ts,
-                 src_name=None, post_title=None, post_issueid=None):
+                 src_name=None, post_title=None, post_issueid=None,
+                 post_subname=None, post_subowner=None):
         self.id = id
         self.type = type
         self.dst = dst
@@ -62,6 +63,8 @@ class Notification:
         self.src_name = src_name
         self.post_title = post_title
         self.post_issueid = post_issueid
+        self.post_subname = post_subname
+        self.post_subowner = post_subowner
 
     def ymd_date(self):
         dt = datetime.datetime.fromtimestamp(self.ts, UTC)
@@ -93,6 +96,8 @@ class Notification:
             icon = '💬 '
         elif self.type == Notification.POST_BY_FOLLOWED_USER:
             event = 'published new a post'
+        elif self.type == Notification.POST_IN_FOLLOWED_SUBSPACE:
+            event = f'posted in followed subspace {"u/" if self.post_subowner else "s/"}{self.post_subname}'
         elif self.type == Notification.MENTION:
             event = 'mentioned you'
         elif self.type == Notification.NEW_POLL:
@@ -1558,17 +1563,19 @@ class Database:
         cur.execute(f"""
             SELECT
                 n.id, n.type, n.dst, n.src, n.post, n.is_sent, UNIX_TIMESTAMP(n.ts),
-                u.name, p.title, p.issueid
+                u.name, p.title, p.issueid, s.name, s.owner
             FROM notifs n
                 JOIN users u ON src=u.id
                 JOIN posts p ON post=p.id
+                JOIN subspaces s ON s.id=p.subspace
             WHERE {' AND '.join(cond)}
             ORDER BY ts
         """, tuple(values))
         notifs = []
-        for (id, type, dst, src, post, is_sent, ts, src_name, post_title, post_issueid) in cur:
+        for (id, type, dst, src, post, is_sent, ts, src_name, post_title, post_issueid, post_subname, post_subowner) in cur:
             notifs.append(Notification(id, type, dst, src, post, is_sent, ts,
-                                       src_name, post_title, post_issueid))
+                                       src_name, post_title, post_issueid,
+                                       post_subname, post_subowner))
         if clear and notifs:
             cur.execute(f"DELETE FROM notifs WHERE id IN ({','.join(map(lambda n: str(n.id), notifs))})", list())
             self.commit()
Proxy Information
Original URL
gemini://git.skyjake.fi/bubble/main/cdiff/ed447a57221142914d7058624648d834f3370926
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
28.46659 milliseconds
Gemini-to-HTML Time
0.3065 milliseconds

This content has been proxied by September (ba2dc).