notify: add typesafe notifications

This commit is contained in:
William Casarin
2023-07-30 10:48:56 -07:00
parent df3b94a1fc
commit 80063af19a
28 changed files with 795 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
//
// NewMutesNotify.swift
// damus
//
// Created by William Casarin on 2023-07-30.
//
import Foundation
struct NewMutesNotify: Notify {
typealias Payload = Set<Pubkey>
var payload: Payload
}
extension NotifyHandler {
static var new_mutes: NotifyHandler<NewMutesNotify> {
.init()
}
}
extension Notifications {
static func new_mutes(_ pubkeys: Set<Pubkey>) -> Notifications<NewMutesNotify> {
.init(.init(payload: pubkeys))
}
}