Files
session-ios/Session/Utilities/UIActivityViewController+Utilities.swift
Morgan Pretty 1a5b00a95b Updated the home screen to be based on the new ObservationManager
• Rebuild the observation system so UI updates can be triggered arbitrarily rather than just from database changes (requires manual evert firing)
• Refactored the TypingIndicators to be an actor
• Fixed an issue where sharing something from within the app via Session wouldn't update the conversation list content
2025-07-08 16:21:25 +10:00

26 lines
1009 B
Swift

// Copyright © 2025 Rangeproof Pty Ltd. All rights reserved.
import UIKit
import SessionMessagingKit
import SessionUtilitiesKit
public extension UIActivityViewController {
static func notifyIfNeeded(_ success: Bool, using dependencies: Dependencies) {
if success {
if let threadId: String = dependencies[defaults: .appGroup, key: .lastSharedThreadId] {
let interactionId: Int64 = Int64(dependencies[defaults: .appGroup, key: .lastSharedMessageId])
dependencies[singleton: .storage].readAsync(
retrieve: { db in
db.addMessageEvent(id: interactionId, threadId: threadId, type: .created)
},
completion: { _ in }
)
}
dependencies[defaults: .appGroup].removeObject(forKey: .lastSharedThreadId)
dependencies[defaults: .appGroup].removeObject(forKey: .lastSharedMessageId)
}
}
}