ssb: Use the cache of private messages we built for the unread notification to actually show private messages. Still needs some work, but it's something.

This commit is contained in:
2025-02-05 18:41:37 -05:00
parent dddec489b9
commit e5899fca58
4 changed files with 12 additions and 5 deletions

View File

@ -17,6 +17,7 @@ class TfTabNewsFeedElement extends LitElement {
loading: {type: Number},
time_range: {type: Array},
time_loading: {type: Array},
private_messages: {type: Array},
};
}
@ -148,13 +149,13 @@ class TfTabNewsFeedElement extends LitElement {
`
SELECT TRUE AS is_primary, messages.rowid, messages.id, previous, author, sequence, timestamp, hash, json(content) AS content, signature
FROM messages
JOIN json_each(?1) AS following ON messages.author = following.value
JOIN json_each(?1) AS private_messages ON messages.id = private_messages.value
WHERE
(?2 IS NULL OR (messages.timestamp >= ?2)) AND messages.timestamp < ?3 AND
json(messages.content) LIKE '"%'
ORDER BY messages.sequence DESC LIMIT 20
`,
[JSON.stringify(this.following), start_time, end_time]
[JSON.stringify(this.private_messages), start_time, end_time]
);
result = (await this.decrypt(result)).filter((x) => x.decrypted);
} else {