From 50c187edff3a8b64275b65236b6ca61695e7972c Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Thu, 21 Dec 2023 20:05:04 +0000 Subject: [PATCH] remove legacy `requestCommunityInfo` code (#13012) --- src/app/modules/main/communities/controller.nim | 3 --- src/app/modules/main/communities/io_interface.nim | 3 --- src/app/modules/main/communities/module.nim | 3 --- src/app/modules/main/communities/view.nim | 1 - src/app_service/service/community/service.nim | 11 ----------- ui/app/AppLayouts/Chat/stores/RootStore.qml | 6 ------ .../Communities/stores/CommunitiesStore.qml | 6 ------ 7 files changed, 33 deletions(-) diff --git a/src/app/modules/main/communities/controller.nim b/src/app/modules/main/communities/controller.nim index cffba14482..a5bb70e569 100644 --- a/src/app/modules/main/communities/controller.nim +++ b/src/app/modules/main/communities/controller.nim @@ -79,9 +79,6 @@ proc init*(self: Controller) = let args = CommunityArgs(e) self.delegate.communityInfoRequestFailed(args.communityId, args.error) - self.events.on(SIGNAL_COMMUNITY_INFO_ALREADY_REQUESTED) do(e: Args): - self.delegate.communityInfoAlreadyRequested() - self.events.on(SIGNAL_CURATED_COMMUNITY_FOUND) do(e:Args): let args = CommunityArgs(e) self.delegate.curatedCommunityAdded(args.community) diff --git a/src/app/modules/main/communities/io_interface.nim b/src/app/modules/main/communities/io_interface.nim index 3b00dbb6d7..a40534af28 100644 --- a/src/app/modules/main/communities/io_interface.nim +++ b/src/app/modules/main/communities/io_interface.nim @@ -194,9 +194,6 @@ method curatedCommunitiesLoadingFailed*(self: AccessInterface) {.base.} = method curatedCommunitiesLoaded*(self: AccessInterface, curatedCommunities: seq[CommunityDto]) {.base.} = raise newException(ValueError, "No implementation available") -method communityInfoAlreadyRequested*(self: AccessInterface) {.base.} = - raise newException(ValueError, "No implementation available") - method onCommunityTokenMetadataAdded*(self: AccessInterface, communityId: string, tokenMetadata: CommunityTokensMetadataDto) {.base.} = raise newException(ValueError, "No implementation available") diff --git a/src/app/modules/main/communities/module.nim b/src/app/modules/main/communities/module.nim index 3e6cb95b20..b36b96e5d9 100644 --- a/src/app/modules/main/communities/module.nim +++ b/src/app/modules/main/communities/module.nim @@ -538,9 +538,6 @@ method requestCancelDiscordCommunityImport*(self: Module, id: string) = method requestCancelDiscordChannelImport*(self: Module, discordChannelId: string) = self.controller.requestCancelDiscordChannelImport(discordChannelId) -method communityInfoAlreadyRequested*(self: Module) = - self.view.communityInfoAlreadyRequested() - proc createCommunityTokenItem(self: Module, token: CommunityTokensMetadataDto, communityId: string, supply: string, infiniteSupply: bool): TokenListItem = result = initTokenListItem( diff --git a/src/app/modules/main/communities/view.nim b/src/app/modules/main/communities/view.nim index 8ab70aa1af..563ad097fe 100644 --- a/src/app/modules/main/communities/view.nim +++ b/src/app/modules/main/communities/view.nim @@ -132,7 +132,6 @@ QtObject: proc communityAccessFailed*(self: View, communityId: string, error: string) {.signal.} proc communityEditSharedAddressesSucceeded*(self: View, communityId: string) {.signal.} proc communityEditSharedAddressesFailed*(self: View, communityId: string, error: string) {.signal.} - proc communityInfoAlreadyRequested*(self: View) {.signal.} proc communityTagsChanged*(self: View) {.signal.} diff --git a/src/app_service/service/community/service.nim b/src/app_service/service/community/service.nim index 36326ba33d..449ad2a668 100644 --- a/src/app_service/service/community/service.nim +++ b/src/app_service/service/community/service.nim @@ -234,8 +234,6 @@ const SIGNAL_ACCEPT_REQUEST_TO_JOIN_LOADING* = "acceptRequestToJoinLoading" const SIGNAL_ACCEPT_REQUEST_TO_JOIN_FAILED* = "acceptRequestToJoinFailed" const SIGNAL_ACCEPT_REQUEST_TO_JOIN_FAILED_NO_PERMISSION* = "acceptRequestToJoinFailedNoPermission" -const SIGNAL_COMMUNITY_INFO_ALREADY_REQUESTED* = "communityInfoAlreadyRequested" - const TOKEN_PERMISSIONS_ADDED = "tokenPermissionsAdded" const TOKEN_PERMISSIONS_MODIFIED = "tokenPermissionsModified" const TOKEN_PERMISSIONS_REMOVED = "tokenPermissionsRemoved" @@ -260,7 +258,6 @@ QtObject: communityTags: string # JSON string contraining tags map communities: Table[string, CommunityDto] # [community_id, CommunityDto] historyArchiveDownloadTaskCommunityIds*: HashSet[string] - requestedCommunityIds*: HashSet[string] communityMetrics: Table[string, CommunityMetricsDto] communityInfoRequests: Table[string, Time] @@ -296,7 +293,6 @@ QtObject: result.communityTags = newString(0) result.communities = initTable[string, CommunityDto]() result.historyArchiveDownloadTaskCommunityIds = initHashSet[string]() - result.requestedCommunityIds = initHashSet[string]() result.communityMetrics = initTable[string, CommunityMetricsDto]() result.communityInfoRequests = initTable[string, Time]() @@ -1495,7 +1491,6 @@ QtObject: let rpcResponseObj = communityIdAndRpcResponse.parseJson let requestedCommunityId = rpcResponseObj{"communityId"}.getStr() - self.requestedCommunityIds.excl(requestedCommunityId) if rpcResponseObj{"error"}.kind != JNull and rpcResponseObj{"error"}.getStr != "": error "Error requesting community info", msg = rpcResponseObj{"error"} @@ -1780,11 +1775,6 @@ QtObject: proc requestCommunityInfo*(self: Service, communityId: string, shard: Shard, importing = false, tryDatabase = true, requiredTimeSinceLastRequest = initDuration(0, 0)) = - if communityId in self.requestedCommunityIds: - info "requestCommunityInfo: skipping as already requested", communityId - self.events.emit(SIGNAL_COMMUNITY_INFO_ALREADY_REQUESTED, Args()) - return - let now = now().toTime() if self.communityInfoRequests.hasKey(communityId): let lastRequestTime = self.communityInfoRequests[communityId] @@ -1794,7 +1784,6 @@ QtObject: return self.communityInfoRequests[communityId] = now - self.requestedCommunityIds.incl(communityId) let arg = AsyncRequestCommunityInfoTaskArg( tptr: cast[ByteAddress](asyncRequestCommunityInfoTask), diff --git a/ui/app/AppLayouts/Chat/stores/RootStore.qml b/ui/app/AppLayouts/Chat/stores/RootStore.qml index 6350db5c75..7ec3b79121 100644 --- a/ui/app/AppLayouts/Chat/stores/RootStore.qml +++ b/ui/app/AppLayouts/Chat/stores/RootStore.qml @@ -98,8 +98,6 @@ QtObject { signal communityAdded(string communityId) - signal communityInfoAlreadyRequested() - signal communityAccessRequested(string communityId) signal goToMembershipRequestsPage() @@ -575,10 +573,6 @@ QtObject { root.importingCommunityStateChanged(communityId, state, errorMsg) } - function onCommunityInfoAlreadyRequested() { - root.communityInfoAlreadyRequested() - } - function onCommunityAccessRequested(communityId) { root.communityAccessRequested(communityId) } diff --git a/ui/app/AppLayouts/Communities/stores/CommunitiesStore.qml b/ui/app/AppLayouts/Communities/stores/CommunitiesStore.qml index 16b1a076a7..fd2346f91e 100644 --- a/ui/app/AppLayouts/Communities/stores/CommunitiesStore.qml +++ b/ui/app/AppLayouts/Communities/stores/CommunitiesStore.qml @@ -60,8 +60,6 @@ QtObject { signal importingCommunityStateChanged(string communityId, int state, string errorMsg) - signal communityInfoAlreadyRequested() - signal communityInfoRequestCompleted(string communityId, string errorMsg) function createCommunity(args = { @@ -251,10 +249,6 @@ QtObject { root.importingCommunityStateChanged(communityId, state, errorMsg) } - function onCommunityInfoAlreadyRequested() { - root.communityInfoAlreadyRequested() - } - function onCommunityInfoRequestCompleted(communityId, erorrMsg) { root.communityInfoRequestCompleted(communityId, erorrMsg) }