mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
eeccfb47d5
Fixed some broken file paths Fixed a couple of bugs with closed groups Fixed a few migration issues Fixed a bug with the ProfilePictureView in open groups (was including the open parenthesis in the initials) Migrated the Id Blinding changes to work with GRDB Migrated the call logic to work with GRDB Updated the code to work the with hard fork changes
28 lines
946 B
Swift
28 lines
946 B
Swift
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
import GRDB
|
|
|
|
extension MessageReceiver {
|
|
internal static func handleDataExtractionNotification(_ db: Database, message: DataExtractionNotification) throws {
|
|
guard
|
|
let sender: String = message.sender,
|
|
let messageKind: DataExtractionNotification.Kind = message.kind,
|
|
let thread: SessionThread = try? SessionThread.fetchOne(db, id: sender),
|
|
thread.variant == .contact
|
|
else { return }
|
|
|
|
_ = try Interaction(
|
|
serverHash: message.serverHash,
|
|
threadId: thread.id,
|
|
authorId: sender,
|
|
variant: {
|
|
switch messageKind {
|
|
case .screenshot: return .infoScreenshotNotification
|
|
case .mediaSaved: return .infoMediaSavedNotification
|
|
}
|
|
}()
|
|
).inserted(db)
|
|
}
|
|
}
|