Notifications.swift (3417B)
1 // 2 // Notifications.swift 3 // damus 4 // 5 // Created by William Casarin on 2022-04-22. 6 // 7 8 import Foundation 9 10 extension Notification.Name { 11 static var relays_changed: Notification.Name { 12 return Notification.Name("relays_changed") 13 } 14 static var profile_updated: Notification.Name { 15 return Notification.Name("profile_updated") 16 } 17 static var switched_timeline: Notification.Name { 18 return Notification.Name("switched_timeline") 19 } 20 static var liked: Notification.Name { 21 return Notification.Name("liked") 22 } 23 static var scroll_to_top: Notification.Name { 24 return Notification.Name("scroll_to_to") 25 } 26 static var broadcast_event: Notification.Name { 27 return Notification.Name("broadcast event") 28 } 29 static var notice: Notification.Name { 30 return Notification.Name("notice") 31 } 32 static var delete: Notification.Name { 33 return Notification.Name("delete note") 34 } 35 static var post: Notification.Name { 36 return Notification.Name("send post") 37 } 38 static var compose: Notification.Name { 39 return Notification.Name("compose") 40 } 41 static var boosted: Notification.Name { 42 return Notification.Name("boosted") 43 } 44 static var follow: Notification.Name { 45 return Notification.Name("follow") 46 } 47 static var unfollow: Notification.Name { 48 return Notification.Name("unfollow") 49 } 50 static var login: Notification.Name { 51 return Notification.Name("login") 52 } 53 static var logout: Notification.Name { 54 return Notification.Name("logout") 55 } 56 static var followed: Notification.Name { 57 return Notification.Name("followed") 58 } 59 static var unfollowed: Notification.Name { 60 return Notification.Name("unfollowed") 61 } 62 static var report: Notification.Name { 63 return Notification.Name("report") 64 } 65 static var mute: Notification.Name { 66 return Notification.Name("mute") 67 } 68 static var new_mutes: Notification.Name { 69 return Notification.Name("new_mutes") 70 } 71 static var new_unmutes: Notification.Name { 72 return Notification.Name("new_unmutes") 73 } 74 static var deleted_account: Notification.Name { 75 return Notification.Name("deleted_account") 76 } 77 static var update_stats: Notification.Name { 78 return Notification.Name("update_stats") 79 } 80 static var present_sheet: Notification.Name { 81 return Notification.Name("present_sheet") 82 } 83 static var zapping: Notification.Name { 84 return Notification.Name("zapping") 85 } 86 static var mute_thread: Notification.Name { 87 return Notification.Name("mute_thread") 88 } 89 static var unmute_thread: Notification.Name { 90 return Notification.Name("unmute_thread") 91 } 92 static var local_notification: Notification.Name { 93 return Notification.Name("local_notification") 94 } 95 static var onlyzaps_mode: Notification.Name { 96 return Notification.Name("hide_reactions") 97 } 98 static var attached_wallet: Notification.Name { 99 return Notification.Name("attached_wallet") 100 } 101 } 102 103 func handle_notify(_ name: Notification.Name) -> NotificationCenter.Publisher { 104 return NotificationCenter.default.publisher(for: name) 105 } 106 107 func notify(_ name: NSNotification.Name, _ object: Any?) { 108 NotificationCenter.default.post(name: name, object: object) 109 }