diff --git a/protocol/communities/community.go b/protocol/communities/community.go index 84a278f70..f7613beae 100644 --- a/protocol/communities/community.go +++ b/protocol/communities/community.go @@ -1913,8 +1913,9 @@ func (o *Community) CanPost(pk *ecdsa.PublicKey, chatID string, messageType prot if !isChatMember { return false, nil } - isPoster := member.ChannelRole == protobuf.CommunityMember_CHANNEL_ROLE_POSTER - isViewer := member.ChannelRole == protobuf.CommunityMember_CHANNEL_ROLE_VIEWER + + isPoster := member.GetChannelRole() == protobuf.CommunityMember_CHANNEL_ROLE_POSTER + isViewer := member.GetChannelRole() == protobuf.CommunityMember_CHANNEL_ROLE_VIEWER return isPoster || (isViewer && chat.ViewersCanPostReactions), nil default: diff --git a/protocol/communities/manager.go b/protocol/communities/manager.go index 666c2d407..a0c1d039d 100644 --- a/protocol/communities/manager.go +++ b/protocol/communities/manager.go @@ -1056,11 +1056,11 @@ func (m *Manager) ReevaluateMembers(community *Community) (map[protobuf.Communit if response.ViewAndPostPermissions.Satisfied { channelRole = protobuf.CommunityMember_CHANNEL_ROLE_POSTER } - if !isMemberAlreadyInChannel { - _, err := community.AddMemberToChat(channelID, memberPubKey, []protobuf.CommunityMember_Roles{}, channelRole) - if err != nil { - return nil, err - } + + // Add the member back to the chat member list in case the role changed (it replaces the previous values) + _, err := community.AddMemberToChat(channelID, memberPubKey, []protobuf.CommunityMember_Roles{}, channelRole) + if err != nil { + return nil, err } } else if isMemberAlreadyInChannel { _, err := community.RemoveUserFromChat(memberPubKey, channelID)