mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 04:05:20 +00:00
Keep share extension helpers target-local
This commit is contained in:
@@ -45,10 +45,6 @@ struct SharedContentPayload: Codable, Sendable, Equatable, Identifiable {
|
||||
SharedContentPayload(kind: .text, content: content, createdAt: createdAt)
|
||||
}
|
||||
|
||||
static func url(_ url: URL, title: String?, createdAt: Date = Date()) -> SharedContentPayload {
|
||||
SharedContentPayload(kind: .url, content: url.absoluteString, title: title, createdAt: createdAt)
|
||||
}
|
||||
|
||||
var composerText: String { content }
|
||||
|
||||
var preview: String {
|
||||
@@ -148,11 +144,6 @@ final class SharedContentStore {
|
||||
self.decoder = JSONDecoder()
|
||||
}
|
||||
|
||||
convenience init?(suiteName: String) {
|
||||
guard let defaults = UserDefaults(suiteName: suiteName) else { return nil }
|
||||
self.init(defaults: defaults)
|
||||
}
|
||||
|
||||
/// Replaces any older pending share with a validated, bounded envelope.
|
||||
func stage(_ payload: SharedContentPayload, now: Date = Date()) throws {
|
||||
try payload.validate(now: now)
|
||||
|
||||
Reference in New Issue
Block a user