-
Notifications
You must be signed in to change notification settings - Fork 508
Fix duplicated candidate mentions in file rooms #1682
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 duplicated candidate mentions in file rooms #1682
Conversation
|
/backport to stable15 |
Ivansss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works 👍
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
In regular rooms only the current participants are candidates in mentions, but in file rooms the candidates are all the users with access to the file, even if they are not currently participants of the room. However, as the users with access to the file are a superset of the current participants those participants were returned twice. Therefore, now candidates for mentions in file rooms are got only from the users with access to the file instead of in addition to the current participants. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
ed03ac4 to
475abd0
Compare
|
Rebased. |
|
backport to stable15 in #1693 |
| * @since 13.0.0 | ||
| */ | ||
| public function search($search, $limit, $offset, ISearchResult $searchResult) { | ||
| if ($this->room->getObjectType() === 'file') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw jsut for the record:
I did it the other way around, so normal users are listed before users which are not in the room yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I did not think on that. Then maybe it would be better to restore the previous code and explicitly remove duplicated elements?
Requires #1676 and #1677
(I will rebase on master the last two commits of this pull request once those two pull requests are merged).In regular rooms only the current participants are candidates in mentions, but in file rooms the candidates are all the users with access to the file, even if they are not currently participants of the room. However, as the users with access to the file are a superset of the current participants those participants were returned twice. Therefore, now candidates for mentions in file rooms are got only from the users with access to the file instead of in addition to the current participants.
How to test:
Result with this pull request:
The other user appears once in the candidate mentions
Result without this pull request:
The other user appears twice in the candidate mentions