From b087a09d37229d44fb76c0e4d6bd12176417420a Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Fri, 3 Nov 2023 00:49:17 +0000 Subject: [PATCH] Fix blocking the same way, too. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4602 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/ssb.json | 2 +- apps/ssb/tf-profile.js | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index bfeacb7a..2f765ae9 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🐌", - "previous": "&JKRKYoQgzxByd80DTQQVWoDfoEd27h2jhaUrNXAGK7k=.sha256" + "previous": "&qvm+scemENl4DobpOoh/UyILGvvx5NbcPJKTU3CswSE=.sha256" } \ No newline at end of file diff --git a/apps/ssb/tf-profile.js b/apps/ssb/tf-profile.js index 21817df7..e5ddd8c9 100644 --- a/apps/ssb/tf-profile.js +++ b/apps/ssb/tf-profile.js @@ -40,12 +40,20 @@ class TfProfileElement extends LitElement { SELECT json_extract(content, '$.following') AS following FROM messages WHERE author = ? AND json_extract(content, '$.type') = 'contact' AND - json_extract(content, '$.contact') = ? + json_extract(content, '$.contact') = ? AND + following IS NOT NULL ORDER BY sequence DESC LIMIT 1 `, [this.whoami, this.id]); - console.log(result); this.following = result?.[0]?.following ?? false; - console.log('FOLLOWING', this.whoami, this.id, this.following); + result = await tfrpc.rpc.query(` + SELECT json_extract(content, '$.blocking') AS blocking + FROM messages WHERE author = ? AND + json_extract(content, '$.type') = 'contact' AND + json_extract(content, '$.contact') = ? AND + blocking IS NOT NULL + ORDER BY sequence DESC LIMIT 1 + `, [this.whoami, this.id]); + this.blocking = result?.[0]?.blocking ?? false; } }