-
-
Notifications
You must be signed in to change notification settings - Fork 590
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
adding isSip function to room #2427
Conversation
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.
Hi @chagai95, thank you for your contribution 👍
Please have a look at the checks, fix the issues and then re-request the view.
If you have any questions just ask them here in the comments.
public isSip(): boolean { | ||
for (const member of this.getMembers()) { | ||
if(member.userId != this.client.getUserId()){ | ||
if(member.userId.startsWith("@_sip_")){ |
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.
Where is this @_sip_
prefix specced?
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 don't think it's specced, how would you purpose we go about this?
Our users are all created with this prefix as per the config on the sip bridge, since it's not possible to change a mxid I think it's reasonable to hard code this for now.
https://gitlab.matrix.org/new-vector/voip/matrix-sip-bridge/-/blob/master/config_sample.yaml#L27
Do you perhaps have a better suggestion? 🙈
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.
That's specific to your config on that sip bridge, other sip bridges may have different config. SIP is also not a concept mentioned in the Matrix spec at all. This really cannot land in its current state, it'd be better done as part of the extensible profiles project matrix-org/matrix-spec-proposals#3795
A config is also just that configurable - so the prefix can change and the js-sdk would then do the wrong thing. Also what stops someone registering @_sip_real_user:matrix.org
where now this would wrongly return true
?
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.
Ok thx! Can you maybe elaborate on how this is related to extensible profiles? We would like to identify if a room is a sip room or not, couldn't we spec that as a room type or something?
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.
That is an alternative, though keep in mind room types are immutable, this function currently can change depending on the members in a room. Extensible profiles could make the sip bridge users have an is_sip flag
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.
If it was just a bit of dead code probably not, if it was something more generic to hide rooms with types the app doesnt know then probably
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.
Ok thanks! It's about creating a call list out of the sip rooms.
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.
@t3chguy I hope it's ok for me to ping you, I was just wondering why not use m.bridge? I've seen that used in Beeper...
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.
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.
Ok, thx for clarifying that!
Signed-off-by: Chagai Friedlander chagai.friedlander@aarenet.com
Here's what your changelog entry will look like:
✨ Features