notify: add typesafe notifications
This commit is contained in:
25
damus/Notify/NewUnmutesNotify.swift
Normal file
25
damus/Notify/NewUnmutesNotify.swift
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// NewUnmutesNotify.swift
|
||||
// damus
|
||||
//
|
||||
// Created by William Casarin on 2023-07-30.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct NewUnmutesNotify: Notify {
|
||||
typealias Payload = Set<Pubkey>
|
||||
var payload: Payload
|
||||
}
|
||||
|
||||
extension NotifyHandler {
|
||||
static var new_unmutes: NotifyHandler<NewUnmutesNotify> {
|
||||
.init()
|
||||
}
|
||||
}
|
||||
|
||||
extension Notifications {
|
||||
static func new_unmutes(_ pubkeys: Set<Pubkey>) -> Notifications<NewUnmutesNotify> {
|
||||
.init(.init(payload: pubkeys))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user