Commit Graph

1991 Commits

Author SHA1 Message Date
adbenitez 98e6e73717 don't force dark mode in webpage for WebxdcActivity and FullMsgActivity webviews 2022-01-28 22:10:02 +01:00
bjoern ee47563f3d avoid caching resources between webxdc apps (#2205) 2022-01-27 12:07:34 +01:00
bjoern c205a1692e webxdc: warn when the app tries sendUpdate() and the user cannot send (#2199)
* show a warning when trying to sendUpdate() for contact requests or other chats the user cannot send to

* add missing 'Start...' translation
2022-01-22 22:11:29 +01:00
Hocuri 11ec547386 Make it possible to create an encrypted database (#2186)
- Before Android 6 (API 23), there was no KeyStore yet. Currently, you can still create an encrypted account, but the passphrase is stored in clear-text, because that's how Signal is doing things.
- There is no option to manually set the keyphrase or to unlock via fingerprint. This has the advantage that we never need user input for unlocking the accounts and can simply unlock all accounts on startup and the obvious disadvantage that anyone with access to the unlocked device can open DC.
- Each account is encrypted with a different passphrase.
- When importing, you can choose to encrypt the account.
2022-01-22 20:57:16 +01:00
Asiel Díaz Benítez eb25a5e78c add "developer mode" preference (#2196)
* add "developer mode" preference

* activate WebContentsDebugging also after restart

as the preference option is persisted,
we should call setWebContentsDebuggingEnabled() not only on flag changes.

* capitalize option name, shorter description

* prefer 'can' over 'may'; the latter is very formal

* add Prefs.isDeveloperModeEnabled()

Co-authored-by: B. Petersen <r10s@b44t.com>
2022-01-22 11:01:48 +01:00
bjoern a9a99047da move up when tapping webxdc info messages (#2194)
* add DcMsg.getParent() api

* factor out scrollSmoothToMsgId() and use that for both, quotes and webxdc-info-messages
2022-01-20 00:53:50 +01:00
bjoern b102026158 show errors when sending fails (#2193)
this happens only in rare cases as usually the message is always added
and errors happen far later.

but some conditions are checked very soon (webxdc sizes),
and these let an message not even being added.

note, that this pr only shows the error,
it does not change draft handling or so -
it would eg. be better if the message is re-converted to a draft,
however, that would be a larger refactoring and maybe not worth the effort.
2022-01-18 17:18:07 +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
Asiel Díaz Benítez 003ca291ac remove inbox_watch and mvbox_watch options from advanced settings (#2182)
* remove inbox_watch and mvbox_watch options from advanced settings

* don't show warning dialog when SENTBOX_WATCH is disabled
2022-01-09 17:49:39 +01:00
Asiel Díaz Benítez 45bb431bad don't allow to add POI if user can't send in current chat, e.g. is not a member anymore (#2178) 2021-12-27 15:05:54 +01:00
Hocuri f4c39273a5 Make ndk-make.sh debug builds (for just one arch) more usable (#2173)
Debug builds of the core (like `ndk-make.sh arm64-v8a`) take about a minute, while
a release bulid (`ndk-make.sh`) takes about 15 minutes.

But as most people seem not to use debug builds regularly because
they are tricky to use, here comes an improvement :) If you gave the wrong argument to `ndk-make.sh`, a warning dialog will now pop up inside the app, telling you what you did wrong and what you should do instead.

`ndk-make.sh` writes its argument into the file `ndkArch`.
`getNdkArch()` in `build.gradle` then reads this file and its content is assigned to
`BuildConfig.NDK_ARCH`. `checkNdkArchitecture()` then checks this.
2021-12-18 15:57:50 +01:00
bjoern 40bbfd6aa7 improve wording of one-to-one-chat hint (#2165)
* improve wording of one-to-one-chat hint

at #2134 we shortend the hint shown for an empty group massively,
removing greylisting hints and the hint that the recipient can user other mua.

the result of that shortening is that the creation of a one-to-one chat
is now way too long :)

i suggest shorten the hint in a similar way,
not much would be left then, however, that is maybe not bad :)

* re-add the aspect that the recipient does not need Delta Chat
2021-12-12 16:54:34 +01:00
Hocuri 836f7d9888 Fix unread count: Always show exactly the info that core gives us (#2164)
Fix #2163 by making the unread badge visible in the chatlist again. The
user can then go into this chat once in order to mark it as noticed.

Since https://github.com/deltachat/deltachat-core-rust/pull/2861,
the core will prevent the situation "the last message
is outgoing but there are fresh messages" from newly coming up, by
automatically marking the messages as noticed.

This PR removes all the logic that involved some "if the last message is
not fresh|noticed, the unread count should be 0" as this kind of logic
belongs to the core, because otherwise 1) have different behavior on
different platforms 2) issues like #2163 appear.

Now, if the _unread count_ is non-zero, the _unread badge_ is shown.

If the state of the _last message_ is "fresh", the line with the _last
message_ (called "subject line") is shown in bold.
2021-12-12 14:45:30 +01:00
adbenitez d5afe5f655 don't hide the attachment manager if not necessary 2021-11-29 20:19:18 -05:00
Hocuri 378f8e258c Remove duplicate event registration (#2155) 2021-11-29 21:28:11 +01:00
bjoern 09e0d7e4d0 prepare 1.26.0 (#2153)
* update changelog for 1.26.0

* add device message; as 1.24 is still pretty fresh, we also keep that message for now

* bump version to 1.26
2021-11-29 00:21:28 +01:00
bjoern c7e81d2bc2 synchronize unread-badge-color with desktop (#2148) 2021-11-28 21:22:44 +01:00
Asiel Díaz Benítez e90185a02e Merge pull request #2147 from deltachat/generated-avatar-improvements
make avatar letter bold and transform it to uppercase
2021-11-25 17:57:51 -05:00
bjoern 447e879bac use dc_get_last_error() api (#2109)
* add getLastError() api

* use getLastError() for QR code processing

* use getLastError() for import/export

* remove now unused getCapturedError()
2021-11-25 12:15:39 +01:00
bjoern 1b68e13d9c "scan qr code" wordings (#2146)
* pass qr-code strings to core (as qr code images are generated in core now)

* shorter wording of qr code hints

* quote group name as done in most other places
2021-11-25 12:09:10 +01:00
adbenitez 9a8b94c38b make avatar letter bold and transform it to uppercase 2021-11-24 19:59:16 -05:00
Asiel Díaz Benítez 23ad457fab [WIP] use the new SVG QR images generated in core (#2138)
* use the new SVG QR images generated in core

* hack y-offset of fallback-avatar-letter

the dominant-baseline=central and baseline=middle attributes are not working,
see https://github.com/deltachat/deltachat-core-rust/pull/2815#issuecomment-978067378
and source code comment for some more details.

Co-authored-by: B. Petersen <r10s@b44t.com>
2021-11-24 23:24:55 +01:00
bjoern ddda0750ba tweak wording for 'Last seen' (#2145) 2021-11-23 21:51:31 +01:00
Asiel Díaz Benítez 8b050f3b1e Merge pull request #2144 from deltachat/display-last-seen
Display last-seen info in profile
2021-11-23 12:18:36 -05:00
Asiel Díaz Benítez d798571786 Update src/org/thoughtcrime/securesms/ProfileSettingsAdapter.java
Co-authored-by: bjoern <r10s@b44t.com>
2021-11-23 11:41:19 -05:00
Hocuri 206929a63c Switch from Mapbox to Maplibre (#2143) 2021-11-23 10:29:33 +01:00
adbenitez b96560b19a show verification status in title 2021-11-22 23:48:52 -05:00
adbenitez c7956abbaf show last-seen info in profile 2021-11-22 23:11:42 -05:00
adbenitez 22fced3fa5 add DcContact.getLastSeen() 2021-11-22 21:16:54 -05:00
Hocuri a6be2f426c Don't set draft after creating group, instead improve group creation hint (#2134)
fix deltachat/deltachat-core-rust#2793

Also see deltachat/deltachat-core-rust#2805
2021-11-16 10:44:55 +01:00
cyberta 60f8c58d0d package names should always be lower cased 2021-11-10 15:43:05 +01:00
cyBerta 18c3306832 Merge pull request #2088 from deltachat/provider-app-support
provider app support
2021-11-10 14:54:01 +01:00
cyberta 502ff5c12a add a little coment about IPC 2021-11-10 14:35:19 +01:00
cyberta 287c344e74 change AndroidYggmail package name to chat.delta.AndroidYggmail 2021-11-10 13:48:50 +01:00
cyberta 981552a97d IPCAddAccountsService: switch to account instead of re-adding if account already exists 2021-11-08 13:19:20 +01:00
cyberta 4aee96254f No need to call super.handleMessage() as IncomingHandler directly inherits from Handler which has an empty handleMessage stub 2021-11-08 12:58:24 +01:00
adbenitez 68f09c6d68 fix NullPointerException in SaveAttachmentTask.onPostExecute() 2021-11-07 15:47:33 -05:00
bjoern 18ee751485 fix backups for android10 (#2122)
- Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
  was not writable for android10 (older and newer androids are okay)

- the import selectMediaType() showed up,
  however never did show the exported file on android10 (also here, older and newer androids are okay)

re-adding the flag `android:requestLegacyExternalStorage="true"` that was removed in #2087
fixed both problems, at least in the emulator.

seems as if the flag is still respected when running on sdk29 even when targeting sdk30;
when running on sdk30, however, the flag is ignored.

at least the following doc does not say that the flag is needless in sdk30:
https://developer.android.com/reference/android/R.attr#requestLegacyExternalStorage
2021-11-07 13:33:49 +01:00
Asiel Díaz Benítez 8774d05fda make toolbar's avatar visible if needed (#2117)
* make toolbar's avatar visible if needed

* make avatar visible when going back to chatlist after forwarding
2021-11-05 12:06:18 +01:00
bjoern 949f9b5b2f prepare 1.24.0 (#2104)
* update changelog for 1.24.0

* add device message

* add recent commits to changelog

* bump version to 1.24.0
2021-11-05 00:48:37 +01:00
Hocuri 7344b491af Fix photo view rail (#2113)
* Fix: Don't check for write permission when we don't need it

* Revert one of the changes from Signal
2021-11-04 22:09:44 +01:00
cyberta 357044764f add missing Intent flag 2021-11-04 21:26:06 +01:00
cyberta aab70f0f05 add a Toast showing the reason why the auto-configuration failed 2021-11-04 12:53:45 +01:00
cyberta a21c039f4d don't update UI wrt. provider info in companion app auto-configuration 2021-11-04 12:53:45 +01:00
cyberta a8f61ee23b little clean-up 2021-11-04 12:53:45 +01:00
cyberta a09321261f clear the activity stack if IPCAddAccountService starts the RegistrationActivity 2021-11-04 12:53:45 +01:00
cyberta f802cd18f0 send broadcast to request account data if no account has been yet configured 2021-11-04 12:53:33 +01:00
cyberta 1e3ee61325 auto-configure companion app accounts 2021-11-04 12:51:21 +01:00
cyberta f5d6112f07 initial IPCAddAccountService implementation: receive messages from other apps 2021-11-04 12:51:21 +01:00
Asiel Díaz Benítez be56cb380e QR activities improvements (#2103)
* allow to copy QR data and to read QR data from clipboard

* add share option

* allow to scan QR from gallery

* use menu_copy_to_clipboard instead of menu_copy_link_to_clipboard

* use AttachmentManager

* reuse Bitmap

* change REQUEST_CODE_IMAGE value

* use getCacheDir()

* replace handleOpenPgp4Fpr with handleQrData

* show error message if scanning QR failed

* use Log.e() instead of Log.w()

* Revert "use getCacheDir()"

This reverts commit 2a2a801b311e7c4929f5063d3340234413528b93.

the impact of this change is eaasily larger than expected,
see comments at https://github.com/deltachat/deltachat-android/pull/2103

if needed, we can discuss and re-add that in a separate, more focused pr.

Co-authored-by: B. Petersen <r10s@b44t.com>
2021-11-04 12:26:32 +01:00