From ed447a57221142914d7058624648d834f3370926 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi

Date: Sun, 14 May 2023 22:51:06 +0300

Subject: [PATCH 1/1] Added missing description of a notification

Fetch the subspace info and describe the "post in followed subspace"

notification.

IssueID #12


model.py | 15 +++++++++++----

1 file changed, 11 insertions(+), 4 deletions(-)

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,

     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

 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.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),

         FROM notifs n

             JOIN users u ON src=u.id

             JOIN posts p ON post=p.id

         WHERE {' AND '.join(cond)}

         ORDER BY ts

     """, tuple(values))

     notifs = []

         notifs.append(Notification(id, type, dst, src, post, is_sent, ts,

     if clear and notifs:

         cur.execute(f"DELETE FROM notifs WHERE id IN ({','.join(map(lambda n: str(n.id), notifs))})", list())

         self.commit()

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/bubble/main/patch/ed447a57221142914d7058624648d834f3370926.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
273.060332 milliseconds
Gemini-to-HTML Time
1.481087 milliseconds

This content has been proxied by September (ba2dc).