From efcc710d91489df5ad680ac3ea9b5c16a65dab57 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 28 Dec 2024 21:31:24 -0500 Subject: [PATCH] ssb: Let's assume we read our own messages. --- apps/ssb.json | 2 +- apps/ssb/tf-app.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index fa3a998b..49c32824 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&SM9hI4To1+vk52CT8S2VvnhAynikIX27IFxqZIfNGAY=.sha256" + "previous": "&BxKPtOan2rRMbmW8x32Dw7XZCbUloe7Nl5m/FJNqjUE=.sha256" } diff --git a/apps/ssb/tf-app.js b/apps/ssb/tf-app.js index b10c26aa..619890e2 100644 --- a/apps/ssb/tf-app.js +++ b/apps/ssb/tf-app.js @@ -313,21 +313,29 @@ class TfElement extends LitElement { SELECT channels.value AS channel, MAX(messages.rowid) AS rowid FROM messages JOIN json_each(?1) AS channels ON messages.content ->> 'channel' = channels.value JOIN json_each(?2) AS following ON messages.author = following.value - WHERE messages.content ->> 'type' = 'post' AND messages.content ->> 'root' IS NULL + WHERE + messages.content ->> 'type' = 'post' AND + messages.content ->> 'root' IS NULL AND + messages.author != ?4 GROUP by channel UNION SELECT '' AS channel, MAX(messages.rowid) AS rowid FROM messages JOIN json_each(?2) AS following ON messages.author = following.value - WHERE messages.content ->> 'type' = 'post' AND messages.content ->> 'root' IS NULL + WHERE + messages.content ->> 'type' = 'post' AND + messages.content ->> 'root' IS NULL AND + messages.author != ?4 UNION SELECT '@' AS channel, MAX(messages.rowid) AS rowid FROM messages_fts(?3) JOIN messages ON messages.rowid = messages_fts.rowid JOIN json_each(?2) AS following ON messages.author = following.value + WHERE messages.author != ?4 `, [ JSON.stringify(this.channels), JSON.stringify(following), '"' + this.whoami.replace('"', '""') + '"', + this.whoami, ] ); this.channels_latest = Object.fromEntries(