Skip to content

Commit

Permalink
MOB-1773 - Fixed blocking of users in chat (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg-Pecheneg authored Mar 12, 2024
1 parent 6b22b99 commit 61741d7
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 27 deletions.
34 changes: 17 additions & 17 deletions unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@
C61B3E90283E708500500B6D /* EnterEmailVerificationCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61B3E8A283E708500500B6D /* EnterEmailVerificationCodeViewController.swift */; };
C61B3E94283E708500500B6D /* EnterEmailVerificationCodeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C61B3E8B283E708500500B6D /* EnterEmailVerificationCodeViewController.xib */; };
C61B3E99283E70C100500B6D /* EnterEmailVerificationCodeToMintDomainsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61B3E98283E70C100500B6D /* EnterEmailVerificationCodeToMintDomainsPresenter.swift */; };
C61B6C742BA0052C007408FD /* Push in Frameworks */ = {isa = PBXBuildFile; productRef = C61B6C732BA0052C007408FD /* Push */; };
C61C333A2B90CE6600BD11F5 /* MessagingChatUserDisplayInfoImageLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61C33392B90CE6600BD11F5 /* MessagingChatUserDisplayInfoImageLoader.swift */; };
C61C333B2B90CE6600BD11F5 /* MessagingChatUserDisplayInfoImageLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61C33392B90CE6600BD11F5 /* MessagingChatUserDisplayInfoImageLoader.swift */; };
C61C50002820E39600D1110A /* PullUpSelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61C4FFF2820E39600D1110A /* PullUpSelectionView.swift */; };
Expand Down Expand Up @@ -678,7 +679,6 @@
C64312A22B68BB2900BCA2A4 /* ConnectedAppsEmptyCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C643129F2B68BB2900BCA2A4 /* ConnectedAppsEmptyCell.swift */; };
C64312A32B68BB2900BCA2A4 /* ConnectedAppsEmptyCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C64312A02B68BB2900BCA2A4 /* ConnectedAppsEmptyCell.xib */; };
C64312A42B68BB2900BCA2A4 /* ConnectedAppsEmptyCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C64312A02B68BB2900BCA2A4 /* ConnectedAppsEmptyCell.xib */; };
C64457822B85EBEB00F236A4 /* Push in Frameworks */ = {isa = PBXBuildFile; productRef = C64457812B85EBEB00F236A4 /* Push */; };
C64513072808089400413C51 /* UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = C64513062808089400413C51 /* UserDefaults.swift */; };
C645130C280808ED00413C51 /* Codable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C645130B280808ED00413C51 /* Codable.swift */; };
C645131128095BA400413C51 /* ExistingUsersTutorialViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C645131028095BA400413C51 /* ExistingUsersTutorialViewController.swift */; };
Expand Down Expand Up @@ -3637,7 +3637,6 @@
307B1D5A2603C8E0007B14C3 /* BigInt in Frameworks */,
290A60502950AA1600882109 /* WalletConnectPush in Frameworks */,
C66811F52B47B1C600BDABB0 /* XMTP in Frameworks */,
C64457822B85EBEB00F236A4 /* Push in Frameworks */,
2917EDDD2A6F25AB004EAB31 /* Web3ContractABI in Frameworks */,
C689C1732ADE484300AA0186 /* LaunchDarkly in Frameworks */,
290A604E2950AA1600882109 /* WalletConnectPairing in Frameworks */,
Expand All @@ -3647,6 +3646,7 @@
30D89F5B26A9EB5500251C2D /* Bugsnag in Frameworks */,
290A60522950AA1600882109 /* WalletConnectRouter in Frameworks */,
30B6583926A9E75E004F707F /* Stripe in Frameworks */,
C61B6C742BA0052C007408FD /* Push in Frameworks */,
2917EDDB2A6F25AB004EAB31 /* Boilertalk-Web3 in Frameworks */,
C652446A2AF8A7A400673CC0 /* WalletConnectNotify in Frameworks */,
290A60542950AA1600882109 /* WalletConnectVerify in Frameworks */,
Expand Down Expand Up @@ -7682,7 +7682,7 @@
C65244692AF8A7A400673CC0 /* WalletConnectNotify */,
C607A5CC2B3288900088ECF3 /* Amplitude */,
C66811F42B47B1C600BDABB0 /* XMTP */,
C64457812B85EBEB00F236A4 /* Push */,
C61B6C732BA0052C007408FD /* Push */,
);
productName = "domains-manager-ios";
productReference = 3064867D2527253700388026 /* domains-manager-ios.app */;
Expand Down Expand Up @@ -7820,7 +7820,7 @@
C689C1712ADE47AF00AA0186 /* XCRemoteSwiftPackageReference "ios-client-sdk" */,
C607A5CB2B3288800088ECF3 /* XCRemoteSwiftPackageReference "Amplitude-iOS" */,
C66811F02B47B0F500BDABB0 /* XCRemoteSwiftPackageReference "xmtp-ios" */,
C64457802B85EBD300F236A4 /* XCRemoteSwiftPackageReference "push-swift-sdk" */,
C61B6C722BA004F2007408FD /* XCRemoteSwiftPackageReference "push-swift-sdk" */,
);
productRefGroup = 3064867E2527253700388026 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -11004,6 +11004,14 @@
kind = branch;
};
};
C61B6C722BA004F2007408FD /* XCRemoteSwiftPackageReference "push-swift-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/ethereum-push-notification-service/push-swift-sdk";
requirement = {
kind = revision;
revision = 45113991bb3eb6e7ab54556918a8aa523da85ce8;
};
};
C61ECD842A25AB4200E97D70 /* XCRemoteSwiftPackageReference "socket" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/socketio/socket.io-client-swift";
Expand All @@ -11028,14 +11036,6 @@
kind = branch;
};
};
C64457802B85EBD300F236A4 /* XCRemoteSwiftPackageReference "push-swift-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Oleg-Pecheneg/push-swift-sdk";
requirement = {
kind = revision;
revision = 7aa3a1aeea89acd91dcbefcb0473a2a993a66334;
};
};
C66811F02B47B0F500BDABB0 /* XCRemoteSwiftPackageReference "xmtp-ios" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/xmtp/xmtp-ios";
Expand Down Expand Up @@ -11143,6 +11143,11 @@
package = 30CE604A26A9DED000E0D29B /* XCRemoteSwiftPackageReference "web3swift" */;
productName = web3swift;
};
C61B6C732BA0052C007408FD /* Push */ = {
isa = XCSwiftPackageProductDependency;
package = C61B6C722BA004F2007408FD /* XCRemoteSwiftPackageReference "push-swift-sdk" */;
productName = Push;
};
C61ECD852A25AB4200E97D70 /* SocketIO */ = {
isa = XCSwiftPackageProductDependency;
package = C61ECD842A25AB4200E97D70 /* XCRemoteSwiftPackageReference "socket" */;
Expand All @@ -11158,11 +11163,6 @@
package = C63812222993E009002590E7 /* XCRemoteSwiftPackageReference "Valet-ios" */;
productName = Valet;
};
C64457812B85EBEB00F236A4 /* Push */ = {
isa = XCSwiftPackageProductDependency;
package = C64457802B85EBD300F236A4 /* XCRemoteSwiftPackageReference "push-swift-sdk" */;
productName = Push;
};
C65244692AF8A7A400673CC0 /* WalletConnectNotify */ = {
isa = XCSwiftPackageProductDependency;
package = 290A60462950AA1500882109 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"originHash" : "7ef48ccc75c726c1506bc02084c676ce9561560c2e5a8b11a64a3392d2a42f0c",
"pins" : [
{
"identity" : "amplitude-ios",
Expand Down Expand Up @@ -111,9 +112,9 @@
{
"identity" : "push-swift-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Oleg-Pecheneg/push-swift-sdk",
"location" : "https://github.com/ethereum-push-notification-service/push-swift-sdk",
"state" : {
"revision" : "7aa3a1aeea89acd91dcbefcb0473a2a993a66334"
"revision" : "45113991bb3eb6e7ab54556918a8aa523da85ce8"
}
},
{
Expand Down Expand Up @@ -350,5 +351,5 @@
}
}
],
"version" : 2
"version" : 3
}
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,9 @@ private extension ChatListViewModel {
}

func fillSnapshotForUserChatsList() {
chatsRequests = chatsList.requestsOnly()
chatsListToShow = chatsList.confirmedOnly().unblockedOnly()
let unblockedChats = chatsList.unblockedOnly()
chatsRequests = unblockedChats.requestsOnly()
chatsListToShow = unblockedChats.confirmedOnly()
}

func fillSnapshotForUserCommunitiesList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ extension ChatRequestsListViewModel {
guard !selectedChats.isEmpty,
case .chatRequests(let chats) = dataType else { return }

let chatsToBlock = Array(selectedChats)
isEditing = false
Task {
isLoading = true
do {
try await appContext.messagingService.block(chats: Array(selectedChats))
if chats.count == selectedChats.count {
try await appContext.messagingService.block(chats: chatsToBlock)
if chats.count == chatsToBlock.count {
router.chatTabNavPath.removeLast()
}
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,11 @@ extension MessagingService: MessagingServiceProtocol {
}

try await apiService.block(chats: messagingChats, by: profile)
for chat in messagingChats {
try? await storageService.markAllMessagesIn(chat: chat, isRead: true)
}

if Constants.shouldHideBlockedUsersLocally {
for chat in messagingChats {
try? await storageService.markAllMessagesIn(chat: chat, isRead: true)
}
notifyChatsChanged(wallet: profile.wallet,
serviceIdentifier: serviceIdentifier)
}
Expand Down

0 comments on commit 61741d7

Please sign in to comment.