Skip to content

[FIX] "Allow Reaction" does not work properly on "Read Only" rooms#4864

Merged
reinaldonetof merged 5 commits into
developfrom
fix.show-message-action-read-only
Feb 24, 2023
Merged

[FIX] "Allow Reaction" does not work properly on "Read Only" rooms#4864
reinaldonetof merged 5 commits into
developfrom
fix.show-message-action-read-only

Conversation

@reinaldonetof

@reinaldonetof reinaldonetof commented Jan 25, 2023

Copy link
Copy Markdown
Contributor

Proposed changes

When the user is in a Read Only room when he does a long press, the message action doesn't appear and he isn't able to reply directly to the person who sent a message before or react to it with an emoji, or copy the permalink. This is a regression from #4366

Issue(s)

How to test or reproduce

In any channel, with a user that has the appropriate permissions

  • Make it a “Read Only” room
  • And activate the “Allow Rection” option
  • Send a few messages and react to a couple.
  • With another user, without “workaround” permissions” (like being an all-powerful admin or owner)
  • Join the room and try reacting to a message

Screenshots

Before

Screen.Recording.2023-01-25.at.16.35.02.mov

After

Screen.Recording.2023-01-25.at.16.29.26.mov

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

TC-326

@reinaldonetof reinaldonetof self-assigned this Jan 25, 2023
Comment on lines +788 to +796
handleCloseEmoji = (action?: Function, params?: any) => {
if (this.messagebox?.current) {
return this.messagebox?.current.closeEmojiAndAction(action, params);
}
if (action) {
return action(params);
}
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I needed to do this differentiation because there is the possibility that the message box isn't rendered, for example, when the room is read only.

So, in that case, besides the possibility to reactions on long press, the user must be able to click on the emoji + to add new emoji or long press on the reactions.

@reinaldonetof reinaldonetof merged commit 4336f0d into develop Feb 24, 2023
@reinaldonetof reinaldonetof deleted the fix.show-message-action-read-only branch February 24, 2023 14:37
diegolmello pushed a commit that referenced this pull request Mar 2, 2023
…4864)

* [FIX] "Allow Reaction" does not work properly on "Read Only" rooms

* fix the handle of message box

---------

Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants