fix user notifications from old events immediately shown on install and login
Changelog-Fixed: Fix user notifications from old events immediately shown on install and login Closes: #1106
This commit is contained in:
committed by
William Casarin
parent
9847f12c95
commit
43017828e2
@@ -278,6 +278,11 @@ class NostrEvent: Codable, Identifiable, CustomStringConvertible, Equatable, Has
|
||||
func sign(privkey: String) {
|
||||
self.sig = sign_event(privkey: privkey, ev: self)
|
||||
}
|
||||
|
||||
var age: TimeInterval {
|
||||
let event_date = Date(timeIntervalSince1970: TimeInterval(created_at))
|
||||
return Date.now.timeIntervalSince(event_date)
|
||||
}
|
||||
}
|
||||
|
||||
func sign_event(privkey: String, ev: NostrEvent) -> String {
|
||||
|
||||
Reference in New Issue
Block a user