mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Merge branch 'dev' into ui-media-message
This commit is contained in:
commit
0f21a1381e
4 changed files with 49 additions and 14 deletions
|
@ -6850,7 +6850,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 369;
|
||||
CURRENT_PROJECT_VERSION = 371;
|
||||
DEVELOPMENT_TEAM = SUQ8J2PCT7;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -6889,7 +6889,7 @@
|
|||
"$(SRCROOT)",
|
||||
);
|
||||
LLVM_LTO = NO;
|
||||
MARKETING_VERSION = 2.0.2;
|
||||
MARKETING_VERSION = 2.0.3;
|
||||
OTHER_LDFLAGS = "$(inherited)";
|
||||
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger";
|
||||
|
@ -6922,7 +6922,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 369;
|
||||
CURRENT_PROJECT_VERSION = 371;
|
||||
DEVELOPMENT_TEAM = SUQ8J2PCT7;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -6961,7 +6961,7 @@
|
|||
"$(SRCROOT)",
|
||||
);
|
||||
LLVM_LTO = NO;
|
||||
MARKETING_VERSION = 2.0.2;
|
||||
MARKETING_VERSION = 2.0.3;
|
||||
OTHER_LDFLAGS = "$(inherited)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger";
|
||||
PRODUCT_NAME = Session;
|
||||
|
|
|
@ -175,7 +175,7 @@ enum _001_InitialSetupMigration: Migration {
|
|||
.notNull()
|
||||
}
|
||||
|
||||
try db.create(table: GroupMember.self) { t in
|
||||
try db.create(table: _006_FixHiddenModAdminSupport.PreMigrationGroupMember.self) { t in
|
||||
// Note: Since we don't know whether this will be stored against a 'ClosedGroup' or
|
||||
// an 'OpenGroup' we add the foreign key constraint against the thread itself (which
|
||||
// shares the same 'id' as the 'groupId') so we can cascade delete automatically
|
||||
|
|
|
@ -647,11 +647,10 @@ enum _003_YDBToGRDBMigration: Migration {
|
|||
}
|
||||
|
||||
try groupModel.groupMemberIds.forEach { memberId in
|
||||
try GroupMember(
|
||||
try _006_FixHiddenModAdminSupport.PreMigrationGroupMember(
|
||||
groupId: threadId,
|
||||
profileId: memberId,
|
||||
role: .standard,
|
||||
isHidden: false
|
||||
role: .standard
|
||||
).insert(db)
|
||||
|
||||
if !validProfileIds.contains(memberId) {
|
||||
|
@ -660,11 +659,10 @@ enum _003_YDBToGRDBMigration: Migration {
|
|||
}
|
||||
|
||||
try groupModel.groupAdminIds.forEach { adminId in
|
||||
try GroupMember(
|
||||
try _006_FixHiddenModAdminSupport.PreMigrationGroupMember(
|
||||
groupId: threadId,
|
||||
profileId: adminId,
|
||||
role: .admin,
|
||||
isHidden: false
|
||||
role: .admin
|
||||
).insert(db)
|
||||
|
||||
if !validProfileIds.contains(adminId) {
|
||||
|
@ -673,11 +671,10 @@ enum _003_YDBToGRDBMigration: Migration {
|
|||
}
|
||||
|
||||
try (closedGroupZombieMemberIds[legacyThread.uniqueId] ?? []).forEach { zombieId in
|
||||
try GroupMember(
|
||||
try _006_FixHiddenModAdminSupport.PreMigrationGroupMember(
|
||||
groupId: threadId,
|
||||
profileId: zombieId,
|
||||
role: .zombie,
|
||||
isHidden: false
|
||||
role: .zombie
|
||||
).insert(db)
|
||||
|
||||
if !validProfileIds.contains(zombieId) {
|
||||
|
|
|
@ -28,3 +28,41 @@ enum _006_FixHiddenModAdminSupport: Migration {
|
|||
Storage.update(progress: 1, for: self, in: target) // In case this is the last migration
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Pre-Migration Types
|
||||
|
||||
extension _006_FixHiddenModAdminSupport {
|
||||
internal struct PreMigrationGroupMember: Codable, PersistableRecord, TableRecord, ColumnExpressible {
|
||||
public static var databaseTableName: String { "groupMember" }
|
||||
|
||||
public typealias Columns = CodingKeys
|
||||
public enum CodingKeys: String, CodingKey, ColumnExpression {
|
||||
case groupId
|
||||
case profileId
|
||||
case role
|
||||
}
|
||||
|
||||
public enum Role: Int, Codable, DatabaseValueConvertible {
|
||||
case standard
|
||||
case zombie
|
||||
case moderator
|
||||
case admin
|
||||
}
|
||||
|
||||
public let groupId: String
|
||||
public let profileId: String
|
||||
public let role: Role
|
||||
|
||||
// MARK: - Initialization
|
||||
|
||||
public init(
|
||||
groupId: String,
|
||||
profileId: String,
|
||||
role: Role
|
||||
) {
|
||||
self.groupId = groupId
|
||||
self.profileId = profileId
|
||||
self.role = role
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue