mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-19 11:43:35 +00:00
Apply mutes to notifications
This commit is contained in:
parent
6dbaf7450a
commit
b458e3b2d6
@ -7,6 +7,7 @@ import {getUserReadRelays} from "src/agent/relays"
|
||||
import {notifications, userEvents, contacts, rooms} from "src/agent/tables"
|
||||
import {watch} from "src/agent/storage"
|
||||
import network from "src/agent/network"
|
||||
import user from "src/agent/user"
|
||||
|
||||
let listener
|
||||
|
||||
@ -110,6 +111,8 @@ const listen = async pubkey => {
|
||||
{kinds: [42], "#e": roomIds, since},
|
||||
],
|
||||
onChunk: async events => {
|
||||
events = user.applyMutes(events)
|
||||
|
||||
await network.loadPeople(pluck("pubkey", events))
|
||||
await processNotifications(pubkey, events)
|
||||
await processMessages(pubkey, events)
|
||||
|
@ -8,6 +8,7 @@
|
||||
import Content from "src/partials/Content.svelte"
|
||||
import Notification from "src/views/notifications/Notification.svelte"
|
||||
import {watch} from "src/agent/storage"
|
||||
import user from "src/agent/user"
|
||||
import {userEvents} from "src/agent/tables"
|
||||
import {lastChecked} from "src/app/listener"
|
||||
|
||||
@ -18,7 +19,7 @@
|
||||
const notifications = watch("notifications", t => {
|
||||
lastChecked.update(assoc("notifications", now()))
|
||||
|
||||
return sortBy(e => -e.created_at, t.all())
|
||||
return sortBy(e => -e.created_at, user.applyMutes(t.all()))
|
||||
})
|
||||
|
||||
// Group notifications so we're only showing the parent once per chunk
|
||||
|
Loading…
Reference in New Issue
Block a user