-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Functional members #1771
Functional members #1771
Conversation
(Updated base branch so it doesn't accidentally go to the wrong place.) |
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Adding tests for this behaviour would be great |
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.
as t3chguy says, tests would be appreciated for this. From my part, it'd be good to see tests for the abusive cases, and a paragraph somewhere on this PR acknowledging the room for abuse and how that is mitigated (if at all).
Some abusive cases include:
- Existing DMs with participants where excluding the member might cause an empty name (eg: 1:1 DM and manually excluding a non-service user). Alternatively, putting all users from the DM into the excluded users list.
- Excluding users which are not present in the room (would expect the performance to not be impacted, and for the code to not explode)
It's particularly concerning that the exclusion is based on user ID only as that isn't a reliable factor for whether or not the user is truly a service/bot user or not. It's largely fine for this case, I think, but acknowledging the vector is appreciated.
*/ | ||
export const UNSTABLE_ELEMENT_FUNCTIONAL_USERS = new UnstableValue( | ||
"io.element.functional_members", | ||
"io.element.functional_members"); |
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'd sooner hop into UnstableValue
and mark the second field as optional, fixing any docs along the way.
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'd make it a type of its own, as UnstableValue has a different meaning, is exported and also requires unstable
to be defined.
Or do you mean to set .unstable
to the same value as .name
if no second parameter is provided to the constructor?
Co-authored-by: Travis Ralston <travisr@matrix.org>
…-js-sdk into j94/functional-members
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.
Thanks!
At Element Matrix Services we're experimenting with "functional members", e.g. bots you want to have in a DM room with someone else.
Currently, if I have a DM room with Alice and my bot "Helper Bot" the DM room will be called "Alice and 1 other" (or "Helper Bot" and 1 other").
We want to filter bots based on a state event so that the room name will be just "Alice".
The state event content for the type
io.element.functional_members
would look like this:I'm writing this PR as an employee at Element, so I'm not sure the Sign-Off is required.
Signed-off-by: Christian Paul christianp@element.io