-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
notify webxdc events, replies and reactions to own messages even if chat is muted #3456
Conversation
To test the changes in this pull request, install this apk: |
To test the changes in this pull request, install this apk: |
just wanted to comment on that :) |
To test the changes in this pull request, install this apk: |
final String name = JsonUtils.optString(info, "name"); | ||
String shortLine = name.isEmpty()? text : (name + ": " + text); | ||
maybeAddNotification(accountId, dcContext.getChat(dcMsg.getChatId()), msgId, shortLine, shortLine, false); | ||
DcChat dcChat = dcContext.getChat(dcMsg.getChatId()); | ||
maybeAddNotification(accountId, dcChat, msgId, shortLine, shortLine, false, dcChat.isMultiUser()); |
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 is that "mentioning" supposed to work?
if i understand the code correctly, that would result in any webxdc-notification to be treated as "mention" and bypass group-muting
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 was the initial idea, but that was before "*" came in, oth, notifying all even if group is muted is still nice, and is similar to what happen in a muted group when someone uses the @all
mention
and I can already see some similar use-cases like in an "announcements" app where the group is muted due to flood but when an important announcement is needed then someone can use the webxdc "*" to notify all of the event
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 that for webxdcs, isMention
should either always be false
or wasDirectlyNotified
(i.e. not only with *
). Because I think it would be quite annoying to get notifications XY added an event to the calendar
all the time even though you muted the group, and look like a bug.
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.
oth the event in the calendar could be important, ex. in work context, while the rest of the chat flood is kept away by the muted chat
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.
btw we simply can't know if it was a direct mention or an "*" mention from current event, so "only notify direct mentions not @all
" is simply not possible
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.
While it still seems to be the "right" way not to notify here to me, we can't know until the feature is actually used and we get some real-life experience, (plus, I do see the advantages @adbenitez mentioned), so, I would also be fine with merging as-is
to move forward.
(Björn, 2024)
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.
2024? he is moving forward since the 80s
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.
Because I think it would be quite annoying to get notifications
XY added an event to the calendar all the time
even though you muted the group, and look like a bug.
agree, we should not do that.
in general, not sure to introduce these "mentions" last minute that the user cannot get rid of.
an option might be nice, but we should have that on all UI then, this is nothing for just 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.
in general, not sure to introduce these "mentions" last minute that the user cannot get rid of.
the webxdc notifications in muted groups was intended since the very beginning or that was hpk told me, I am fine with not doing it, then notifications for webxdc will be lost since there is no way to read them later unlike with messages
as adding "mentions" last-minute without an option to really mute a chat are questionable. and, to do better, might also need help of core (which is also nothing helping getting releases out), i again, suggest to split the PR (in general, it is better to do PR that are doing one thing)
|
created: #3460 |
I am not sure it is better, notify ALL is also considered a mention in other platforms, and would break the workflow of the Calendar example I described above |
05a5e43
to
58523a2
Compare
I updated this PR, now this one is about the extra notifications in "mentions" situations in muted chats |
well, from that point of view every message could be regarded mention 🤷♂️ :) question is, if a webxdc notify to "*" is more like |
the property is called NOTIFY, so yes, it is more like |
for |
To test the changes in this pull request, install this apk: |
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.
some minor comments, i am fine with that in general, having a switch we can also experiment more :)
@@ -211,6 +213,14 @@ protected void finalize() throws Throwable { | |||
public native boolean isSendingLocationsToChat(int chat_id); | |||
public DcProvider getProviderFromEmailWithDns (String email) { long cptr = getProviderFromEmailWithDnsCPtr(email); return cptr!=0 ? new DcProvider(cptr) : null; } | |||
|
|||
public boolean isMentionsEnabled() { | |||
return !"0".equals(getConfig(CONFIG_MENTION_NOTIF_ENABLED)); |
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.
while working, it is a bit hard to understand, every string by "0" means "enabled" then, so also "" (which is the default). getConfigInt() would not work as well, although used for setting.
suggestion: call the thing CONFIG_NOTIIFY_MENTIONS_IF_MUTED
/ ui.notify_mentions_if_muted
, then the default of "" or 0 matches and we can use get/setConfigInt(), and that is also in sync with the other options
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.
suggestion: call the thing
CONFIG_NOTIIFY_MENTIONS_IF_MUTED
/ui.notify_mentions_if_muted
, then the default of "" or 0 matches and we can use get/setConfigInt(), and that is also in sync with the other options
renaming would be ok, but I don't see how it changes the problem, "" (unset) still needs to mean "1" (enabled) since it is the default, you want to "ui.notify_mentions_if_muted" to be on by default 🤔
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 renamed it 👍 and I think I improved the code to be easier to understand 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.
but I don't see how it changes the problem
sorry, my fault 🤦♂️
i meant to inverse the meaning of the var, so CONFIG_MUTE_MENTIONS_IF_MUTED
; that way our default matches the default core will return and we do not need to deal with that.
in fact, we had the default-passing in old cores, but got rid of that as it turned out to be tricky and error-prone in detail one cannot even think of atm :) tbh, i would prefer to not introduce a getConfig(key, default) again, at least not for a comparable side-quested thing
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 also think, it just does not work. for unset keys, getConfig()
does not return NULL or throws an error, but returns a default value, this is an empty string unless something else is defined in core
the try/catch is only to catch Integer-parsing exceptions
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 renamed it again
Co-authored-by: bjoern <r10s@b44t.com>
db7f641
to
af91cf7
Compare
To test the changes in this pull request, install this apk: |
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.
nice, with the option i think it is fine to get it in, even in 1.50.x
To test the changes in this pull request, install this apk: |
even if group is muted:
what is still unsolved:
if webxdc sends notification while the chat is open, there is no notification, if there is no info message there is no hint that there was a notification at all, and if there is info message that doesn't warranties that the notification was the same