mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-16 08:37:12 +00:00
parent
00af1d0e90
commit
0455832f92
@ -218,6 +218,9 @@ proc getCommunityTags*(self: Controller): string =
|
||||
proc getAllCommunities*(self: Controller): seq[CommunityDto] =
|
||||
result = self.communityService.getAllCommunities()
|
||||
|
||||
proc isDisplayNameDupeOfCommunityMember*(self: Controller, displayName: string): bool =
|
||||
result = self.communityService.isDisplayNameDupeOfCommunityMember(displayName)
|
||||
|
||||
proc getCommunityById*(self: Controller, communityId: string): CommunityDto =
|
||||
result = self.communityService.getCommunityById(communityId)
|
||||
|
||||
|
@ -35,6 +35,9 @@ method setCuratedCommunities*(self: AccessInterface, curatedCommunities: seq[Com
|
||||
method getCommunityItem*(self: AccessInterface, community: CommunityDto): SectionItem {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method isDisplayNameDupeOfCommunityMember*(self: AccessInterface, displayName: string): bool {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method navigateToCommunity*(self: AccessInterface, communityId: string) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
|
@ -290,6 +290,9 @@ proc getDiscordChannelItem(self: Module, c: DiscordChannelDto): DiscordChannelIt
|
||||
c.filePath,
|
||||
true)
|
||||
|
||||
method isDisplayNameDupeOfCommunityMember*(self: Module, displayName: string): bool =
|
||||
self.controller.isDisplayNameDupeOfCommunityMember(displayName)
|
||||
|
||||
method setCommunityTags*(self: Module, communityTags: string) =
|
||||
self.view.setCommunityTags(communityTags)
|
||||
|
||||
|
@ -482,6 +482,9 @@ QtObject:
|
||||
proc spectateCommunity*(self: View, communityId: string) {.slot.} =
|
||||
discard self.delegate.spectateCommunity(communityId)
|
||||
|
||||
proc isDisplayNameDupeOfCommunityMember*(self: View, displayName: string): bool {.slot.} =
|
||||
return self.delegate.isDisplayNameDupeOfCommunityMember(displayName)
|
||||
|
||||
proc createCommunity*(self: View, name: string,
|
||||
description: string, introMessage: string, outroMessage: string,
|
||||
access: int, color: string, tags: string,
|
||||
|
@ -852,6 +852,20 @@ QtObject:
|
||||
proc getCommunityIds*(self: Service): seq[string] =
|
||||
return toSeq(self.communities.keys)
|
||||
|
||||
proc isDisplayNameDupeOfCommunityMember*(self: Service, displayName: string): bool =
|
||||
try:
|
||||
let response = status_go.isDisplayNameDupeOfCommunityMember(displayName)
|
||||
|
||||
if response.error != nil:
|
||||
let error = Json.decode($response.error, RpcError)
|
||||
raise newException(RpcException, "Error scanning communities for member name: " & error.message)
|
||||
|
||||
if response.result.kind != JNull:
|
||||
return response.result.getBool
|
||||
|
||||
except Exception as e:
|
||||
error "error scanning communities for member name: ", errMsg = e.msg
|
||||
|
||||
proc getCommunityTokenBySymbol*(self: Service, communityId: string, symbol: string): CommunityTokenDto =
|
||||
let community = self.getCommunityById(communityId)
|
||||
for metadata in community.communityTokensMetadata:
|
||||
|
@ -29,6 +29,9 @@ proc getCuratedCommunities*(): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||
proc getAllCommunities*(): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||
result = callPrivateRPC("communities".prefix)
|
||||
|
||||
proc isDisplayNameDupeOfCommunityMember*(displayName: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||
result = callPrivateRPC("isDisplayNameDupeOfCommunityMember".prefix, %* [displayName])
|
||||
|
||||
proc spectateCommunity*(communityId: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||
result = callPrivateRPC("spectateCommunity".prefix, %*[communityId])
|
||||
|
||||
|
@ -100,6 +100,11 @@ QtObject {
|
||||
return root.communitiesModuleInst.getCommunityPublicKeyFromPrivateKey(privateKey);
|
||||
}
|
||||
|
||||
// Returns true if the provided displayName occurs in community members
|
||||
function isDisplayNameDupeOfCommunityMember(displayName) {
|
||||
root.communitiesModuleInst.isDisplayNameDupeOfCommunityMember(displayName)
|
||||
}
|
||||
|
||||
function requestCommunityInfo(communityKey, shardCluster, shardIndex, importing = false) {
|
||||
const publicKey = Utils.isCompressedPubKey(communityKey)
|
||||
? Utils.changeCommunityKeyCompression(communityKey)
|
||||
|
2
vendor/status-go
vendored
2
vendor/status-go
vendored
@ -1 +1 @@
|
||||
Subproject commit 577db512c6953bec5a82b961cd901c58851362dd
|
||||
Subproject commit 571f30777ebe32501df0d25f5eb79dbcbbb277c0
|
Loading…
x
Reference in New Issue
Block a user