-
Notifications
You must be signed in to change notification settings - Fork 96
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
[Tracking issue] Webxdc notifications #6097
Comments
There were also privacy concerns, not only technical concerns about multi-email. On a related note adding access to avatars for webxdc's will be easy as soon as we have these unique id's. (virtual directory
malicious webxdc -> should not be possible to create. But we could say if chat is not contact request, then directly open it. The only attack without exploits that I can imagine right now is a spammer sending a phishing form.
mostly UI and specification work, and probably an additional field on info messages and notifications for the deep link in core.
core already reads the manifest from the webxdc archive. |
We could also add a |
on the note of translatable webxdc info messages: https://support.delta.chat/t/localised-info-messages/2728 But I think that's still out of scope for now. |
I edited my original post with the most important points, and included my own thoughts:
|
thanks for discussions and thoughs, i created new issues from that and from the things currently have priority; the issues directly referring here are linked above. all issues at a glance are in the project https://github.com/orgs/deltachat/projects/77/views/1 now closing this issue, discussion of course can continue here |
for translations: an alternative is to let the sender send all supported translations in the payload:
also for practise: translations are out of scope of adding notifications wrt M2/M3 proposal. as mentioned above, notifications do not add much to the existing issue. also, there are rarely any apps that support translations at all, so, there are more interesting fields to target to make webxdc more a thing side note for casual readers: translations are possible in general already today. the discussion is only about the case the sender and the receiver use different languages. a true issue. however in many cases receiver and sender, as being in the same chat, have some common languages, so that could also be solved socially. also this issue does not pop up often, as, as said vast majority of apps are english - without webxdc api reasons :) |
this PR adds support for the property `update.notify` to notify about changes in `update.info` or `update.summary`. the property can be set to an array of addresses [^1] core emits then the event `IncomingWebxdcNotify`, resulting in all UIs to display a system notification, maybe even via PUSH. for using the existing `update.info` and `update.summary`: the message is no secret and should be visible to all group members as usual, to not break the UX of having same group messages on all devices of all users - as known already from the normal messages. also, that way, there is no question what happens if user have disabled notifications as the change is presented in the chat as well doc counterpart at webxdc/website#90 closes #6217 [^1]: addresses come in either via the payload as currently or as an explicit sender in the future - this does not affect this PR. same for translations, see discussions at #6217 and #6097 --------- Co-authored-by: adb <[email protected]> Co-authored-by: l <[email protected]>
Summary
Webxdc apps should be able to show notifications. E.g. a chess app should be able to show a notification "Hocuri made a move" to my opponent. In a group, the chess app should be able to show the notification only to my opponent and not to everyone else.
In order to do this, when I make a move, the chess app can call
sendUpdate(payload: { ..., notifyUsers=[𝘰𝘱𝘱𝘰𝘯𝘦𝘯𝘵'𝘴 𝘶𝘴𝘦𝘳 𝘪𝘥] }, ...)
.Webxdc API design
New APIs:
selfID
or reuse the existing APIselfAddr
. Returns a unique identifier that can be used to address the current user. How it looks is up to the host implementation; in Delta Chat, it will be the public key fingerprint for the time being. Note: with multi-transport, this can't be the email address anymore, since email addresses will change from time to time.selfAddr
selfID
,selfAddr
will need to become an alias forselfID
sooner or later because there won't be stable email addresses anymore. So, I think we should just go for reusingselfAddr
.senderID
/senderAddr
on incoming status updates.selfAddr
is (e.g. making it a hash of the key and the app id) isn't a breaking change anymoresenderID
field on incoming status updates is valuable on its ownsendUpdate()
takes a new fieldnotifyUsers
, a list of user ids/addresses. The receiving side will then send a notification if the own user id is in the list.sendUpdate()
takes a new fieldnotificationText
that is shown in the notification on the receiving device; Alternative: reuse the existing fieldinfo
(info
is shown on the system messages that are posted in the chat already for every status update)info
, addingnotification_text
will be easy laterComplications
senderAddr
from DC's fingerprint with the XMPP user identifier.info
already, too, and there are also previous thoughts on how this might be fixed in the future.translatedNotificationText
instead ofnotificationText
that maps from the country code to the respective translation.translatedNotificationText
contains a label and parameters, e.g.label="opponent_made_points",parameters=["3"]
. Then, the receiving device will look up the the translation corresponding to the label in a file with a well-known name (e.g./translations.xml
), in our example that will be "Your opponent made %1$s points", and the parameters are substituted so that we get "Your opponent made 3 points".Implementation in DC between core & UIs
get_webxdc_self_addr()
or a new configwebxdc_self_addr
that returns the fingerprint or whatever we will use as the identifier in the future.senderAddr
to the payload of incoming status updates.notifyUsers
in the payload of incoming status updates, and check if it contains the self addr and whether the user ever sent out a status update for this webxdc (we don't want to allow sending notifications if the user never opened the app). Then, there are multiple ways to actually send the notifications:Alternatives
Future possibilities
/avatars/:id.jpg
) (@Simon-Laux: "sounds like fun, if I have time then, then I volunteer to add it").The text was updated successfully, but these errors were encountered: