|
|
|
@ -73,6 +73,8 @@ public struct Interaction: Codable, Identifiable, Equatable, FetchableRecord, Mu
|
|
|
|
|
case infoClosedGroupCreated = 1000
|
|
|
|
|
case infoClosedGroupUpdated
|
|
|
|
|
case infoClosedGroupCurrentUserLeft
|
|
|
|
|
case infoClosedGroupCurrentUserErrorLeaving
|
|
|
|
|
case infoClosedGroupCurrentUserLeaving
|
|
|
|
|
|
|
|
|
|
case infoDisappearingMessagesUpdate = 2000
|
|
|
|
|
|
|
|
|
@ -87,7 +89,8 @@ public struct Interaction: Codable, Identifiable, Equatable, FetchableRecord, Mu
|
|
|
|
|
|
|
|
|
|
public var isInfoMessage: Bool {
|
|
|
|
|
switch self {
|
|
|
|
|
case .infoClosedGroupCreated, .infoClosedGroupUpdated, .infoClosedGroupCurrentUserLeft,
|
|
|
|
|
case .infoClosedGroupCreated, .infoClosedGroupUpdated,
|
|
|
|
|
.infoClosedGroupCurrentUserLeft, .infoClosedGroupCurrentUserLeaving, .infoClosedGroupCurrentUserErrorLeaving,
|
|
|
|
|
.infoDisappearingMessagesUpdate, .infoScreenshotNotification, .infoMediaSavedNotification,
|
|
|
|
|
.infoMessageRequestAccepted, .infoCall:
|
|
|
|
|
return true
|
|
|
|
@ -106,7 +109,8 @@ public struct Interaction: Codable, Identifiable, Equatable, FetchableRecord, Mu
|
|
|
|
|
|
|
|
|
|
case .standardOutgoing, .standardIncomingDeleted: return false
|
|
|
|
|
|
|
|
|
|
case .infoClosedGroupCreated, .infoClosedGroupUpdated, .infoClosedGroupCurrentUserLeft,
|
|
|
|
|
case .infoClosedGroupCreated, .infoClosedGroupUpdated,
|
|
|
|
|
.infoClosedGroupCurrentUserLeft, .infoClosedGroupCurrentUserLeaving, .infoClosedGroupCurrentUserErrorLeaving,
|
|
|
|
|
.infoDisappearingMessagesUpdate, .infoScreenshotNotification, .infoMediaSavedNotification,
|
|
|
|
|
.infoMessageRequestAccepted:
|
|
|
|
|
return false
|
|
|
|
@ -399,6 +403,7 @@ public struct Interaction: Codable, Identifiable, Equatable, FetchableRecord, Mu
|
|
|
|
|
|
|
|
|
|
public extension Interaction {
|
|
|
|
|
func with(
|
|
|
|
|
variant: Variant? = nil,
|
|
|
|
|
serverHash: String? = nil,
|
|
|
|
|
authorId: String? = nil,
|
|
|
|
|
body: String? = nil,
|
|
|
|
@ -415,7 +420,7 @@ public extension Interaction {
|
|
|
|
|
messageUuid: self.messageUuid,
|
|
|
|
|
threadId: self.threadId,
|
|
|
|
|
authorId: (authorId ?? self.authorId),
|
|
|
|
|
variant: self.variant,
|
|
|
|
|
variant: (variant ?? self.variant),
|
|
|
|
|
body: (body ?? self.body),
|
|
|
|
|
timestampMs: (timestampMs ?? self.timestampMs),
|
|
|
|
|
receivedAtTimestampMs: self.receivedAtTimestampMs,
|
|
|
|
@ -846,6 +851,8 @@ public extension Interaction {
|
|
|
|
|
|
|
|
|
|
case .infoClosedGroupCreated: return "GROUP_CREATED".localized()
|
|
|
|
|
case .infoClosedGroupCurrentUserLeft: return "GROUP_YOU_LEFT".localized()
|
|
|
|
|
case .infoClosedGroupCurrentUserLeaving: return "group_you_leaving".localized()
|
|
|
|
|
case .infoClosedGroupCurrentUserErrorLeaving: return "group_unable_to_leave".localized()
|
|
|
|
|
case .infoClosedGroupUpdated: return (body ?? "GROUP_UPDATED".localized())
|
|
|
|
|
case .infoMessageRequestAccepted: return (body ?? "MESSAGE_REQUESTS_ACCEPTED".localized())
|
|
|
|
|
|
|
|
|
|