Skip to content
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

Closed

Conversation

chagai95
Copy link

@chagai95 chagai95 commented Jun 1, 2022

Signed-off-by: Chagai Friedlander chagai.friedlander@aarenet.com


Here's what your changelog entry will look like:

✨ Features

@chagai95 chagai95 requested a review from a team as a code owner June 1, 2022 08:39
Copy link
Contributor

@weeman1337 weeman1337 left a 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_")){
Copy link
Member

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?

Copy link
Author

@chagai95 chagai95 Jun 1, 2022

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? 🙈

Copy link
Member

@t3chguy t3chguy Jun 2, 2022

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?

Copy link
Author

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?

Copy link
Member

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

Copy link
Member

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

Copy link
Author

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.

Copy link
Author

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...

Copy link
Member

Choose a reason for hiding this comment

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

image

Just because one vendor uses it, doesn't make it specced. This is especially bad given the m. prefix which is reserved for specced things only

Copy link
Author

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!

@chagai95 chagai95 closed this Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants