-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Improvement] The order of the mentions now shows the room participants first then outsiders. #4011
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
Conversation
|
Hello, Team! |
| export enum ReverseSubscriptionType { | ||
| 'p' = SubscriptionType.GROUP, | ||
| 'd' = SubscriptionType.DIRECT, | ||
| 'c' = SubscriptionType.CHANNEL, | ||
| 'l' = SubscriptionType.OMNICHANNEL, | ||
| 'e2e' = SubscriptionType.E2E, | ||
| 't' = SubscriptionType.THREAD | ||
| } |
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.
Why is this needed?
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.
I think later in the comment you have mentioned the usage of roomTypeToApiType, but here we need an enumeration that maps the string literals 'p', 'd', etc, to Subscription type of the room, since the function getRoomMembers requires it in this data type only.
The roomType gives us data of type RoomType and I wasn't able to find a way to map RoomType to SubscriptionType.
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.
An alternative to using this could be add an async call to getRoom function from lib/methods/getRoom and then get the roomSubscriptionType from there.
Right now I am receiving the roomType and rid as a string through props.
| }); | ||
| } | ||
| } | ||
| const roomTypeSub = (<any>ReverseSubscriptionType)[roomType]; |
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.
I think you could have used roomTypeToApiType
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.
I tried using that but I am unable to find a way to map a roomType(string) to a SubscriptionDataType.
ReverseSubscriptionType does reverse of SubscriptionType enumeration, it takes a String and gives us a SubscriptionType.
| setData = new Set([...tempData, ...data.filter(user => user.name.match(regex))]); | ||
| setData = new Set([...setData, ...data.filter(user => roomUsers.includes(user.name))]); | ||
| // TODO: add the conditions to check whether external mentions are allowed | ||
| setData = new Set([...setData, ...data]); |
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.
I think I got a bit lost here, can you explain why this should be done?
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.
So here is the explanation for each step:
1: tempData stores the users with the exact username and member of the room.
2: In Line : 175 - We add the remaining users, whose usernames exactly match but are not part of the room.
3: In Line : 176 - We add the remaining users, who are members of the room containing the text in their username, name or nickname.
4: In Line : 178 - We add the remaining users, who are not members of the room but contain the text in their username, name or nickname.
Here we need to add a condition on step 2 and step 4, whether mentions of people outside room are allowed or not.
|
@gerzonc @diegolmello @GleidsonDaniel hey! |
|
@gerzonc @diegolmello @GleidsonDaniel hello, team! |
This PR was out of my radar. |
Proposed changes
The order of mentions in the mobile app used to be according to recent conversation, but now before that the priority is given to the participants of the room. The order followed is as it is done in the web-app as mentioned here
Issue(s)
Fixes #3681
How to test or reproduce
Screenshots
Simulator.Screen.Recording.-.iPhone.12.-.2022-04-02.at.19.28.43.mp4
Types of changes
Checklist
Further comments