Skip to content

Commit 71a170e

Browse files
authored
Merge pull request #478 from session-foundation/dev
Release 2.13.0
2 parents 8a689a6 + 8ee3032 commit 71a170e

File tree

62 files changed

+3177
-1378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3177
-1378
lines changed

Session.xcodeproj/project.pbxproj

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
945D9C582D6FDBE7003C4C0C /* _005_AddJobUniqueHash.swift in Sources */ = {isa = PBXBuildFile; fileRef = 945D9C572D6FDBE7003C4C0C /* _005_AddJobUniqueHash.swift */; };
180180
946F5A732D5DA3AC00A5ADCE /* Punycode in Frameworks */ = {isa = PBXBuildFile; productRef = 946F5A722D5DA3AC00A5ADCE /* Punycode */; };
181181
9473386E2BDF5F3E00B9E169 /* InfoPlist.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 9473386D2BDF5F3E00B9E169 /* InfoPlist.xcstrings */; };
182+
9479981C2DD44ADC008F5CD5 /* ThreadNotificationSettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9479981B2DD44AC5008F5CD5 /* ThreadNotificationSettingsViewModel.swift */; };
182183
947D7FD42D509FC900E8E413 /* SessionNetworkAPI+Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 947D7FD12D509FC900E8E413 /* SessionNetworkAPI+Models.swift */; };
183184
947D7FD62D509FC900E8E413 /* SessionNetworkAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 947D7FCF2D509FC900E8E413 /* SessionNetworkAPI.swift */; };
184185
947D7FD72D509FC900E8E413 /* SessionNetworkAPI+Network.swift in Sources */ = {isa = PBXBuildFile; fileRef = 947D7FD22D509FC900E8E413 /* SessionNetworkAPI+Network.swift */; };
@@ -188,6 +189,8 @@
188189
947D7FE72D51837200E8E413 /* ArrowCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 947D7FE42D51837200E8E413 /* ArrowCapsule.swift */; };
189190
947D7FE82D51837200E8E413 /* PopoverView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 947D7FE52D51837200E8E413 /* PopoverView.swift */; };
190191
947D7FE92D51837200E8E413 /* Text+CopyButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 947D7FE62D51837200E8E413 /* Text+CopyButton.swift */; };
192+
9499E6032DDD9BF900091434 /* ExpandableLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9499E6022DDD9BEE00091434 /* ExpandableLabel.swift */; };
193+
9499E68B2DF92F4E00091434 /* ThreadNotificationSettingsViewModelSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9499E68A2DF92F3B00091434 /* ThreadNotificationSettingsViewModelSpec.swift */; };
191194
94A6B9DB2DD6BF7C00DB4B44 /* Constants+URLs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94A6B9DA2DD6BF6E00DB4B44 /* Constants+URLs.swift */; };
192195
94B3DC172AF8592200C88531 /* QuoteView_SwiftUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94B3DC162AF8592200C88531 /* QuoteView_SwiftUI.swift */; };
193196
94C58AC92D2E037200609195 /* Permissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C58AC82D2E036E00609195 /* Permissions.swift */; };
@@ -1480,6 +1483,7 @@
14801483
945D9C572D6FDBE7003C4C0C /* _005_AddJobUniqueHash.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = _005_AddJobUniqueHash.swift; sourceTree = "<group>"; };
14811484
9471CAA72CACFB4E00090FB7 /* GenerateLicenses.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenerateLicenses.swift; sourceTree = "<group>"; };
14821485
9473386D2BDF5F3E00B9E169 /* InfoPlist.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = InfoPlist.xcstrings; sourceTree = "<group>"; };
1486+
9479981B2DD44AC5008F5CD5 /* ThreadNotificationSettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadNotificationSettingsViewModel.swift; sourceTree = "<group>"; };
14831487
947AD68F2C8968FF000B2730 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
14841488
947D7FCF2D509FC900E8E413 /* SessionNetworkAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionNetworkAPI.swift; sourceTree = "<group>"; };
14851489
947D7FD02D509FC900E8E413 /* SessionNetworkAPI+Database.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SessionNetworkAPI+Database.swift"; sourceTree = "<group>"; };
@@ -1492,6 +1496,8 @@
14921496
947D7FE42D51837200E8E413 /* ArrowCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrowCapsule.swift; sourceTree = "<group>"; };
14931497
947D7FE52D51837200E8E413 /* PopoverView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopoverView.swift; sourceTree = "<group>"; };
14941498
947D7FE62D51837200E8E413 /* Text+CopyButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Text+CopyButton.swift"; sourceTree = "<group>"; };
1499+
9499E6022DDD9BEE00091434 /* ExpandableLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExpandableLabel.swift; sourceTree = "<group>"; };
1500+
9499E68A2DF92F3B00091434 /* ThreadNotificationSettingsViewModelSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadNotificationSettingsViewModelSpec.swift; sourceTree = "<group>"; };
14951501
94A6B9DA2DD6BF6E00DB4B44 /* Constants+URLs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Constants+URLs.swift"; sourceTree = "<group>"; };
14961502
94B3DC162AF8592200C88531 /* QuoteView_SwiftUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuoteView_SwiftUI.swift; sourceTree = "<group>"; };
14971503
94C58AC82D2E036E00609195 /* Permissions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Permissions.swift; sourceTree = "<group>"; };
@@ -3022,6 +3028,7 @@
30223028
children = (
30233029
B84A89BB25DE328A0040017D /* ProfilePictureVC.swift */,
30243030
FD7115EA28C5D78E00B47552 /* ThreadSettingsViewModel.swift */,
3031+
9479981B2DD44AC5008F5CD5 /* ThreadNotificationSettingsViewModel.swift */,
30253032
FD7115F328C71EB200B47552 /* ThreadDisappearingMessagesSettingsViewModel.swift */,
30263033
);
30273034
path = Settings;
@@ -3183,6 +3190,7 @@
31833190
C38EF2A3255B6D93007E1867 /* PlaceholderIcon.swift */,
31843191
C38EF2A4255B6D93007E1867 /* ProfilePictureView.swift */,
31853192
FD6673FC2D77F54400041530 /* ScreenLockViewController.swift */,
3193+
9499E6022DDD9BEE00091434 /* ExpandableLabel.swift */,
31863194
FD0150572CA27DEE005B08A1 /* ScrollableLabel.swift */,
31873195
7B8914762A7CAAE200A4C627 /* SessionHostingViewController.swift */,
31883196
FDA335F42D911576007E0EB6 /* SessionImageView.swift */,
@@ -4182,6 +4190,7 @@
41824190
FD71161328D00D5D00B47552 /* Settings */ = {
41834191
isa = PBXGroup;
41844192
children = (
4193+
9499E68A2DF92F3B00091434 /* ThreadNotificationSettingsViewModelSpec.swift */,
41854194
FD71161428D00D6700B47552 /* ThreadDisappearingMessagesViewModelSpec.swift */,
41864195
FD71161628D00DA400B47552 /* ThreadSettingsViewModelSpec.swift */,
41874196
);
@@ -5864,6 +5873,7 @@
58645873
9422EE2B2B8C3A97004C740D /* String+Utilities.swift in Sources */,
58655874
FD37EA0128A60473003AE748 /* UIKit+Theme.swift in Sources */,
58665875
FD37E9CF28A1EB1B003AE748 /* Theme.swift in Sources */,
5876+
9499E6032DDD9BF900091434 /* ExpandableLabel.swift in Sources */,
58675877
FDE754BA2C9B97B8002A2623 /* UIDevice+Utilities.swift in Sources */,
58685878
C331FFB92558FA8D00070591 /* UIView+Constraints.swift in Sources */,
58695879
FD0B77B029B69A65009169BA /* TopBannerController.swift in Sources */,
@@ -6580,6 +6590,7 @@
65806590
4CA46F4C219CCC630038ABDE /* CaptionView.swift in Sources */,
65816591
C328253025CA55370062D0A7 /* ContextMenuWindow.swift in Sources */,
65826592
FDEF57242C3CF04700131302 /* (null) in Sources */,
6593+
9479981C2DD44ADC008F5CD5 /* ThreadNotificationSettingsViewModel.swift in Sources */,
65836594
34BECE2E1F7ABCE000D7438D /* GifPickerViewController.swift in Sources */,
65846595
9422568C2C23F8C800C0FDBF /* DisplayNameScreen.swift in Sources */,
65856596
B84664F5235022F30083A1CD /* MentionUtilities.swift in Sources */,
@@ -6670,6 +6681,7 @@
66706681
FD23EA5D28ED00FA0058676E /* TestConstants.swift in Sources */,
66716682
FD71161A28D00E1100B47552 /* NotificationContentViewModelSpec.swift in Sources */,
66726683
FDFE75B52ABD46B700655640 /* MockUserDefaults.swift in Sources */,
6684+
9499E68B2DF92F4E00091434 /* ThreadNotificationSettingsViewModelSpec.swift in Sources */,
66736685
FD01504B2CA243CB005B08A1 /* Mock.swift in Sources */,
66746686
FD0969FA2A6A00B000C5C365 /* Mocked.swift in Sources */,
66756687
FD481A9A2CB4CAE500ECC4CF /* CommonSMKMockExtensions.swift in Sources */,
@@ -7919,7 +7931,7 @@
79197931
CODE_SIGN_IDENTITY = "iPhone Developer";
79207932
COMPILE_LIB_SESSION = "";
79217933
COPY_PHASE_STRIP = NO;
7922-
CURRENT_PROJECT_VERSION = 603;
7934+
CURRENT_PROJECT_VERSION = 606;
79237935
ENABLE_BITCODE = NO;
79247936
ENABLE_STRICT_OBJC_MSGSEND = YES;
79257937
ENABLE_TESTABILITY = YES;
@@ -7960,7 +7972,7 @@
79607972
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
79617973
LIB_SESSION_SOURCE_DIR = "${SRCROOT}/../LibSession-Util";
79627974
LOCALIZED_STRING_SWIFTUI_SUPPORT = NO;
7963-
MARKETING_VERSION = 2.12.0;
7975+
MARKETING_VERSION = 2.13.0;
79647976
ONLY_ACTIVE_ARCH = YES;
79657977
OTHER_CFLAGS = "-Werror=protocol";
79667978
OTHER_SWIFT_FLAGS = "-D DEBUG -Xfrontend -warn-long-expression-type-checking=100";
@@ -8001,7 +8013,7 @@
80018013
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
80028014
CODE_SIGN_IDENTITY = "iPhone Distribution";
80038015
COMPILE_LIB_SESSION = "";
8004-
CURRENT_PROJECT_VERSION = 603;
8016+
CURRENT_PROJECT_VERSION = 606;
80058017
ENABLE_BITCODE = NO;
80068018
ENABLE_MODULE_VERIFIER = YES;
80078019
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -8037,7 +8049,7 @@
80378049
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
80388050
LIB_SESSION_SOURCE_DIR = "${SRCROOT}/../LibSession-Util";
80398051
LOCALIZED_STRING_SWIFTUI_SUPPORT = NO;
8040-
MARKETING_VERSION = 2.12.0;
8052+
MARKETING_VERSION = 2.13.0;
80418053
ONLY_ACTIVE_ARCH = NO;
80428054
OTHER_CFLAGS = (
80438055
"-DNS_BLOCK_ASSERTIONS=1",
@@ -8529,7 +8541,7 @@
85298541
CODE_SIGN_IDENTITY = "iPhone Developer";
85308542
COMPILE_LIB_SESSION = YES;
85318543
COPY_PHASE_STRIP = NO;
8532-
CURRENT_PROJECT_VERSION = 603;
8544+
CURRENT_PROJECT_VERSION = 606;
85338545
ENABLE_BITCODE = NO;
85348546
ENABLE_STRICT_OBJC_MSGSEND = YES;
85358547
ENABLE_TESTABILITY = YES;
@@ -8572,7 +8584,7 @@
85728584
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
85738585
LIB_SESSION_SOURCE_DIR = "${SRCROOT}/../LibSession-Util";
85748586
LOCALIZED_STRING_SWIFTUI_SUPPORT = NO;
8575-
MARKETING_VERSION = 2.12.0;
8587+
MARKETING_VERSION = 2.13.0;
85768588
ONLY_ACTIVE_ARCH = YES;
85778589
OTHER_CFLAGS = (
85788590
"-fobjc-arc-exceptions",
@@ -9166,7 +9178,7 @@
91669178
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
91679179
CODE_SIGN_IDENTITY = "iPhone Distribution";
91689180
COMPILE_LIB_SESSION = YES;
9169-
CURRENT_PROJECT_VERSION = 603;
9181+
CURRENT_PROJECT_VERSION = 606;
91709182
ENABLE_BITCODE = NO;
91719183
ENABLE_STRICT_OBJC_MSGSEND = YES;
91729184
GCC_NO_COMMON_BLOCKS = YES;
@@ -9203,7 +9215,7 @@
92039215
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
92049216
LIB_SESSION_SOURCE_DIR = "${SRCROOT}/../LibSession-Util";
92059217
LOCALIZED_STRING_SWIFTUI_SUPPORT = NO;
9206-
MARKETING_VERSION = 2.12.0;
9218+
MARKETING_VERSION = 2.13.0;
92079219
ONLY_ACTIVE_ARCH = NO;
92089220
OTHER_CFLAGS = (
92099221
"-DNS_BLOCK_ASSERTIONS=1",

Session/Closed Groups/EditGroupViewModel.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class EditGroupViewModel: SessionTableViewModel, NavigatableStateHolder, Editabl
180180
.reduce(into: [:]) { result, next in result[next.profileId] = next }
181181
.values)
182182
}()
183-
.sorted()
183+
.sorted(by: { lhs, rhs in GroupMember.compareForManagement(lhs: lhs, rhs: rhs) })
184184

185185
return [
186186
SectionModel(
@@ -443,7 +443,8 @@ class EditGroupViewModel: SessionTableViewModel, NavigatableStateHolder, Editabl
443443
WHERE (
444444
\(groupMember[.profileId]) IS NULL AND
445445
\(contact[.isApproved]) = TRUE AND
446-
\(contact[.didApproveMe]) = TRUE
446+
\(contact[.didApproveMe]) = TRUE AND
447+
\(contact[.isBlocked]) = FALSE
447448
)
448449
"""),
449450
footerTitle: "membersInviteTitle".localized(),

Session/Conversations/Context Menu/ContextMenuVC+Action.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ extension ContextMenuVC {
127127

128128
static func ban(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action {
129129
return Action(
130-
icon: Lucide.image(icon: .ban, size: 24),
130+
icon: UIImage(named: "ic_user_round_ban")?.withRenderingMode(.alwaysTemplate),
131131
title: "banUser".localized(),
132132
themeColor: .danger,
133133
accessibilityLabel: "Ban user"
@@ -136,7 +136,7 @@ extension ContextMenuVC {
136136

137137
static func banAndDeleteAllMessages(_ cellViewModel: MessageViewModel, _ delegate: ContextMenuActionDelegate?) -> Action {
138138
return Action(
139-
icon: Lucide.image(icon: .ban, size: 24),
139+
icon: UIImage(named: "ic_user_round_ban")?.withRenderingMode(.alwaysTemplate),
140140
title: "banDeleteAll".localized(),
141141
themeColor: .danger,
142142
shouldDismissInfoScreen: true,

Session/Conversations/Context Menu/ContextMenuVC+ActionView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ extension ContextMenuVC {
1818

1919
// MARK: - UI
2020

21-
private lazy var iconContainerView: UIImageView = {
22-
let result: UIImageView = UIImageView()
21+
private lazy var iconContainerView: UIView = {
22+
let result: UIView = UIView()
2323
result.themeTintColor = action.themeColor
2424
result.set(.width, to: ActionView.iconImageViewSize)
2525
result.set(.height, to: ActionView.iconImageViewSize)

Session/Conversations/ConversationVC+Interaction.swift

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ extension ConversationVC:
110110
// MARK: - Call
111111

112112
@objc func startCall(_ sender: Any?) {
113-
guard viewModel.threadData.threadIsBlocked == false else { return }
113+
guard viewModel.threadData.threadIsBlocked != true else {
114+
self.showBlockedModalIfNeeded()
115+
return
116+
}
114117
guard viewModel.dependencies[singleton: .storage, key: .areCallsEnabled] else {
115118
let confirmationModal: ConfirmationModal = ConfirmationModal(
116119
info: ConfirmationModal.Info(
@@ -925,6 +928,11 @@ extension ConversationVC:
925928
// MARK: MessageCellDelegate
926929

927930
func handleItemLongPressed(_ cellViewModel: MessageViewModel) {
931+
// Show the unblock modal if needed
932+
guard self.viewModel.threadData.threadIsBlocked != true else {
933+
self.showBlockedModalIfNeeded()
934+
return
935+
}
928936
// Show the context menu if applicable
929937
guard
930938
// FIXME: Need to update this when an appropriate replacement is added (see https://teng.pub/technical/2021/11/9/uiapplication-key-window-replacement)
@@ -2113,11 +2121,11 @@ extension ConversationVC:
21132121
explanation: ThemedAttributedString(string: deletionBehaviours.body),
21142122
warning: deletionBehaviours.warning.map { ThemedAttributedString(string: $0) },
21152123
options: deletionBehaviours.actions.map { action in
2116-
(
2117-
action.title,
2118-
action.state != .disabled,
2119-
action.state == .enabledAndDefaultSelected,
2120-
action.accessibility
2124+
ConfirmationModal.Info.Body.RadioOptionInfo(
2125+
title: action.title,
2126+
enabled: action.state != .disabled,
2127+
selected: action.state == .enabledAndDefaultSelected,
2128+
accessibility: action.accessibility
21212129
)
21222130
}
21232131
),

0 commit comments

Comments
 (0)