-
Notifications
You must be signed in to change notification settings - Fork 58
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
#241 Group call notifications #250
base: sc
Are you sure you want to change the base?
Conversation
Thanks for your PR! I'll properly review and test when I have more time, maybe on the weekend. |
when (intent?.getIntExtra(EXTRA_CALL_ACTION_KEY, 0)) { | ||
CALL_ACTION_REJECT -> { | ||
val callId = intent.getStringExtra(EXTRA_CALL_ID) ?: return | ||
notificationUtils.cancelAllNotifications() |
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.
Should this really cancel all notifications?
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.
Yeap, this was for testing purpose. Fixed, here we should cancel certain notification
When I try to remove from "string.xml", I got "Unresolved reference: call_notification_open_app_action" while building the project. May be you can give example, how to correctly fix it |
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.
Would you mind rebasing on top of SchildiChat's sc
branch? If I merge this as is currently, it pulls in some unwanted upstream commits
Rebased, could you check if it is correct now ? |
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.
Rebase is fine!
I think your logic for detecting jitsi calls is too generic. From checking the code it looks like it triggers for all kind of widgets. From my experiments it also triggers when removing widgets (i.e. the call will ring again when you actually remove it).
In case it's too hard to get the detection fully accurate, you may get a way with adding a description to the settings so users know about the downsides, but showing a call notification for say a timetable widget being added could be somewhat confusing.
@@ -51,6 +51,7 @@ | |||
<bool name="settings_labs_rich_text_editor_default">false</bool> | |||
<bool name="settings_labs_enable_voice_broadcast_visible">true</bool> | |||
<bool name="settings_labs_enable_voice_broadcast_default">false</bool> | |||
<bool name="settings_labs_enable_jitsi_call_notifications_default">true</bool> |
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.
Should be false
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.
Disabled by default
@@ -498,6 +498,8 @@ fun Event.getPollContent(): MessagePollContent? { | |||
return getClearContent().toModel<MessagePollContent>() | |||
} | |||
|
|||
fun Event.isJitsiEvent() = this.getClearType() == EventType.STATE_ROOM_WIDGET_LEGACY |
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.
This looks too generic to me, won't that trigger for all kinds of widgets, not just jitsi?
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.
Updated detecting function to more accurate one
changelog.d/7761.feature
Outdated
@@ -0,0 +1 @@ | |||
Added ring for group calls |
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.
We don't need this file for downstream changes
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.
Removed this file
@@ -180,4 +180,6 @@ | |||
<string name="settings_clear_highlight_on_scroll">Очистить выделение при прокрутке</string> | |||
<string name="settings_call_ringtone_use_default_stun_title">Разрешить резервный сервер звонков</string> | |||
<string name="settings_integrations_scalar_warning">⚠️ Эта настройка по умолчанию (если не изменена конфигурацией Вашего домашнего сервера) включает доступ к \"Scalar\", менеджеру интеграций от Element. К сожалению, он является проприетарным, т.е. его исходый код не открытый и не может быть проверен пользователями или разработчиками SchildiChat.</string> | |||
<string name="call_notification_open_app_action">Открыть приложение</string> | |||
<string name="labs_enable_group_call_notifications_summary">Включить уведомление для групповых звонков</string> |
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'm not sure if weblate will be happy for manually added translations. Maybe it works but safer path would probably merging without translation first, then add translations via weblate later. 🤔
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.
Removed manually added translation for Russian
This is quite buggy. I now get call notifications even when I send myself messages in a total different room (a DM), for a different room in which I stopped the widget before. |
Apologies for the issue and thanks for raising it - somehow it missed our tests - something we shall work at. Meanwhile - picking this up, hopefully will be fixed in a week or two max. |
…ault. Changed detection for group calls more accurate. Added tracking visibility status for jitsi notifications
Fixed all cases, tested, now that should be much better. Could you please check updated version? |
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! With these changes, it no longer notified for jitsi calls for me. Looks like I got
JitsiEventContent(type=jitsi, name=Jitsi)
, i.e. with uppercase name rather then what you're checking. I was able to fix by adding lowercase()
calls to the check, so it matches both lowercase and uppercase scenarios:
content?.toModel<JitsiEventContent>()?.type?.lowercase() == IS_JITSI_CALL && content.toModel<JitsiEventContent>()?.name?.lowercase() == IS_JITSI_CALL
Otherwise seems to work fine now. I think I'm fine with merging, but I'll probably want to do some code refactoring right after to reduce possible future merge conflicts (I've learnt some tricks which probably doesn't make sense to expect from new contributors to apply).
Let me know if you've tested this a bunch and are confident it works fine for you, so you consider it ready for merge.
@@ -1,7 +1,5 @@ | |||
apply plugin: 'com.android.library' | |||
|
|||
apply plugin: 'com.android.library' |
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.
How does this change relate to the PR?
(I see the line is duplicated, but fixing upstream code style is not really something we want to do here)
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 was unable to build properly and launch an app, with this duplicated line and after removing it, building was success. I am not sure how it affects and can't remember exact error, unfortunately. Do you think we should return back this duplicated line ?
Yeap, I think modifying to lowercase would be much better, to ensure that strings compared correctly. Tested after applying this changes, everything looks good. From my perspective, it is ready to be merged |
@SpiritCroc thank you very much! I don't mean to push or cause any other kind of inconvenience - I understand you are doing and will be doing it when you can. Just to plan things - do you have any ideas when you believe you can have this merged?
And I can't help myself and ask: what is the idea in general? |
No ETAs.
There's a bunch of tricks, I haven't really started writing them down yet. Some things
|
Thank you! I had something similar from my experience, but couldn't help myself with code-style things... That would help me to stay in line :)
Understood, makes perfect sense. If there is something we could do - please, let us know! We would really need that working the sooner - the better, so if there is anything - anything at all - that could be done from my side - just ping me. |
Out of curiosity, what makes this feature urgent in your eyes? I'm a bit surprised that people invest time on jitsi at all with Element call on the horizon. (Not that that would affect how much time my weekend gives me, just curious) |
Sure, to keep things short: Element X is not exactly there yet, and I guess it will take them like half-of-the-year to stabilize and/or reach features parity. And missing the calls is something very much annoying, especially if those group calls are actually a 1:1 calls - that breaks ability to work normally. The thing is that 'groups' are happening at Matrix when you add a third something to 1:1 chat. That something doesn't have to be a person - it could be a bot doing some function you need for work. So, immediately, after you try to enhance your chat with a tool, you lose the ability to make calls. So, at the end of the day we end up with a custom development. Android team seems like ignoring anything related to that functionality (issue at meta, issue at android). I always liked SchildiChat approach (you might remember - I was asking for an iOS port earlier) so I decided this time we shall try our luck with SchildiChat and I'm glad to see that you are responding. I understand that the amount of time in days is limited and that to re-organize code takes time, but it's still our best option, and I'm absolutely grateful for everything you do! |
This PR add ring for group jitsi calls. Also it includes corresponding lab feature, that enable/disable this functionality.