Commit Graph

16 Commits

Author SHA1 Message Date
B. Petersen 42143519d7 remove ts fragments from webxdc.js
main reason is, that these annotations cover the code,
making it hard to follow what is going on.

maybe opionionated, however,
in general, .ts is not needed in small projects,
and an additional burden for devs.
2023-09-26 11:29:06 +02:00
adbenitez aaca1ea264 update res/raw/webxdc.js 2023-06-04 16:38:49 +02:00
adbenitez 0bb8e0a016 add webxdc.importFiles() API 2023-06-04 00:16:19 +02:00
bjoern c99ba34a4d unify and shorten sendToChat() errors (#2578)
* unify and shorten sendToChat() errors

* style: java script uses camelCase, not snake_case (these kind of issues tend to pile up and manifest then in the api somewhere, cmp max_serial - therefore better be strict :)
2023-06-03 10:16:32 +02:00
Simon Laux 1ee59ac662 webxdc update "send to chat" api 2023-06-01 20:46:20 +02:00
adbenitez 0c5cf151db update res/raw/webxdc.js 2023-06-01 11:12:18 +02:00
Asiel Díaz Benítez 7c6b0e5b50 Update res/raw/webxdc.js
Co-authored-by: bjoern <r10s@b44t.com>
2023-05-31 09:49:16 -04:00
adbenitez d51fef5318 add extra checks on the Java side and improve check in the JavaScript side 2023-05-30 23:43:54 +02:00
Simon Laux 39f85c55f1 Update res/raw/webxdc.js 2023-05-30 22:30:55 +02:00
adbenitez d100397530 update to recent changes in sendToChat API specs 2023-05-30 21:22:32 +02:00
adbenitez 3588c074f1 add webxdc.sendToChat() API 2023-05-29 17:03:44 +02:00
Simon Laux 188bb37763 webxdc: make setUpdateListener return a promise
see https://github.com/deltachat/deltachat-core-rust/issues/3203
2022-04-19 15:39:36 +02:00
Simon Laux c3315a2b65 fix setting update_listener
and show the deprecation notice of `getAllUpdates` to the user with console.error
2022-03-29 21:35:41 +02:00
bjoern adf02b50e5 adapt js to new webxdc-update-api (#2223)
* adapt js to new webxdc-update-api

* the stub implementation of getAllUpdates() must still return a Promise

* reword parameters of getStatusUpdates()
2022-03-04 20:23:56 +01:00
B. Petersen 1ccbb11bf6 adapt to new webxdc api 2022-01-28 21:11:50 +01:00
bjoern 9e70aa7cad webxdc (#2174)
* add new w30 APIs

* create the webview,
disable internet access,
inject deltachat.js

* connect deltachat to the webview

* promisify api

* use msgActionButton to start the w30 apps

* cleanup

- create observers in onCreate() to avoid memory leak,
- derive from WebViewActivity to easier deal with particularities
  and to saves >100 loc
- reorder some methods to reflect lifetimes

* make it more clear, which uri-part is 'domain' and which one is 'path'

* unify logging

* it is 'statusUpdate' not 'stateUpdate'; not sure if promise is needed at the end, we can readd that as needed, simple code for now

* use core implementation for status updates

* disable debugging enabled by default, streamline code

* use same name for InternalJSApi for both, js and java

* getStatusUpdates() always return an array

* call JSON.stringify() on payload

* fix typo, fix equal operator

* use shorter function names in js land

* adapt to new zipped w30 format

* load any file from w30 archives

* add fallback if getMimeTypeFromExtension() fails

* rename w30 to webxdc

* add selfName()

* return selfAddr() if selfName() is empty

* rename deltachat.js to webxdc.js

* observer correct event

* rename getBlobFromArchive() to getWebxdcBlob()

* show webxdc app name in title bar

* swap payload and descr in sendUpdate() (adapt to new core api)

* allow user-defined-texts for webxdc apps, make room for icon+name

* show webxdc icon and name in chats

* render webxdc drafts accordingly

* allow configuring drafts

* do not destroy webxdc-message to be sent out by removing it via setDraft(null)

* fix crash when replying to webxdc messages

* add webxdc messages to profile's document tab

* hide 'search menu' for webxdc apps

* show app summary beside app icon

* remove outdated comment

* add precautious WebView restrictions

* Update src/org/thoughtcrime/securesms/ConversationItem.java

Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>

* Update src/org/thoughtcrime/securesms/ConversationItem.java

Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>

* Update src/org/thoughtcrime/securesms/ConversationActivity.java

Co-authored-by: Hocuri <hocuri@gmx.de>

* Webxdc requires at least Android 5 Lollipop

see https://github.com/deltachat/deltachat-android/pull/2174#discussion_r785436874

* recognize .xdc files on android10

based on @Hocuri's findings in #2188

Co-authored-by: Simon Laux <mobile.info@simonlaux.de>
Co-authored-by: adbenitez <asieldbenitez@gmail.com>
Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>
Co-authored-by: Hocuri <hocuri@gmx.de>
2022-01-18 10:52:09 +01:00