Immediately forward any non-post messages to the browser. The thought was to let votes through right away, because there's no harm, and I wanted to see what else makes sense.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3759 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-01-14 23:55:14 +00:00
parent 0bcc7d8c59
commit 5e0304481b
2 changed files with 3 additions and 2 deletions

View File

@ -363,7 +363,8 @@ ssb.addEventListener('message', async function(id) {
var db = await database("ssb");
var posts = await getPosts(db, [id]);
for (let post of posts) {
if (post.author == await ssb.whoami()) {
if (post.author == await ssb.whoami() ||
JSON.parse(post.content).type != 'post') {
await app.postMessage({message: post});
} else {
await app.postMessage({unread: 1});