Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/13385/community permissions issues #13573

Merged
merged 3 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/modules/main/chat_section/module.nim
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ method onKickedFromCommunity*(self: Module) =
self.view.setWaitingOnNewCommunityOwnerToConfirmRequestToRejoin(self.controller.waitingOnNewCommunityOwnerToConfirmRequestToRejoin(communityId))

method onJoinedCommunity*(self: Module) =
self.rebuildCommunityTokenPermissionsModel()
self.view.setAmIMember(true)
self.view.setWaitingOnNewCommunityOwnerToConfirmRequestToRejoin(false)

Expand Down
4 changes: 0 additions & 4 deletions src/app/modules/main/communities/module.nim
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,6 @@ proc buildTokensAndCollectiblesFromCommunities(self: Module) =
let communityTokens = self.controller.getAllCommunityTokens()
let communities = self.controller.getAllCommunities()
for community in communities:
if not community.isOwner and not community.isTokenMaster:
# No need to include those tokens, we do not manage that community
continue

for tokenMetadata in community.communityTokensMetadata:
# Set fallback supply to infinite in case we don't have it
var supply = "1"
Expand Down
6 changes: 6 additions & 0 deletions src/app_service/service/community/service.nim
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,12 @@ QtObject:
permissionUpdated = true
break

if tokenPermission.chatIds.len == prevTokenPermission.chatIds.len:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to split this function into smaller ones some day.

for chatID in tokenPermission.chatIds:
if not (chatID in prevTokenPermission.chatIds):
permissionUpdated = true
break

if permissionUpdated:
self.communities[community.id].tokenPermissions[id] = tokenPermission
self.events.emit(SIGNAL_COMMUNITY_TOKEN_PERMISSION_UPDATED,
Expand Down