Commit graph

130 commits

Author SHA1 Message Date
B. Petersen
ed9d0a9462 add getVerifierAddr/Id api 2023-09-26 10:46:37 +02:00
B. Petersen
0f09aba7af remove unused DcHttpResponse and related functions
they are replaced by jsonrpc in https://github.com/deltachat/deltachat-android/pull/2479
2023-09-25 21:14:36 +02:00
link2xt
72f2f8979e requestPtr 2023-04-22 22:53:57 +00:00
link2xt
070f2841cd Sending request works 2023-04-22 22:10:57 +00:00
link2xt
4f468a4b8f Add DcJsonrpcInstance class 2023-04-22 17:58:03 +00:00
link2xt
0e657eed56
Set WebView proxy to 0.0.0.0 when possible (#2539)
* Set WebView proxy to 0.0.0.0 when possible

* add DcHttpResponse to wrapper

* use new DcHttpResponse to show images in email-html-view

* null-encoding is fine for WebResourceResponse()

---------

Co-authored-by: B. Petersen <r10s@b44t.com>
2023-04-20 21:30:19 +02:00
bjoern
3cede346f3
add multi-device-setup (#2493)
* add DcBackupProvider add receiveBackup() wrappers

* add 'Add Another Device' item to settings

* add android-ifaddrs

core-rust uses getifaddrs() which is not available on android ndk.
pull in the code from https://github.com/morristech/android-ifaddrs
that provides an implementation.

* add BackupProviderActivity

* make SVG-hack reusable

* add BackupProviderFragment

* prepare scanning backup codes

* Revert "add android-ifaddrs"

This reverts commit 33b1424427620396f282805d37f8e05c67758546.

* more logging

* call receiveBackup() on scanning DC_QR_BACKUP

* Fixup for recvmmsg fallback

* protect BackupProviderActivity by system secret

* show transfer progress as provided form the core; hide qr-code once scanned

* add a permanent notification for the provider

* clarify what we are waiting for

* add a permanent notification for the receiver

* ask before finishing BackupProviderActivity

* it is fine to cancel the abort question by tapping outside the alert

* remove outdated comment from 'keep screen on'

* add and check TRANSFER_MODE

* rename BackupProviderActivity to BackupTransferActivity

* use our base activity

* start/stop IO in base activity

* use BackupTransferActivity also for scanning

* add BackupReceiverFragment

* show detailed transfer progress

* show details instead of percent during preparation, for now

* launch chatlist and remove welcome when transfer is done

* redirect to chatlist automatically after transfer succeeded

* reword

* make log accessible from send and receive activities

* bump version

* show error if backup provider creation fails

* remove unneeded format()

* show some context in the errors alerts, hide QR code sooner

* calculate transfer percentage as specified

* show a 'close' instead of a 'back' button to make visually clear, things are aborted (there is a quesion anyway)

* add option to copy backup-qr-code to clipboard

* remove vague retry statement, core will show a detailed error soon

* warn about QR codes on clipboard getting invalidated

* make basic strings translatable

* add troubleshooting menu item (once help is evolved, it may be a more visible button, may be localized, may be offline)

* rename to backup_transfer_fragment.xml

* add detailed instructions

* move 1,2,3 layout to the .xml

* fix layout

* use text size used elsewhere

* do best effort to show SSID on sending device

* make SSID code reusable for receiver

* adapt to otherwise used font style

* show ssid also for receiver

* minor refactorings

* make qr code subtitle translatable

* tune down 'same network hint' on scanning device

* add progress bar to provider

* add progress bar to receiver

* bump version

* use 'Add Second Device' wording

this seems slightly catchier as "Add Another Device"
and has less "A" esp. in "Add as Another Device" :)

also at least translation to german seems nicer ("Zweitgerät"),
most ppl will use max. two devices, but even if more,
that should still be fine.

this was also the first intuition also by other devs in their mockups,
so we'll give it a try.

* use "Exporting/Preparing/Prepared Account" wording

let's give that a try - "Account" is also widely used,
so that seems to make some sense.
even if not 100% fitting,
it seems better than introducing the new term "Collection".

* refine abort question

* Update res/layout/backup_provider_fragment.xml

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

* Update src/org/thoughtcrime/securesms/qr/BackupProviderFragment.java

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

* Update src/org/thoughtcrime/securesms/qr/BackupReceiverFragment.java

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

* Update src/org/thoughtcrime/securesms/qr/BackupTransferActivity.java

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

* Update src/org/thoughtcrime/securesms/qr/BackupReceiverFragment.java

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

* remove string duplicate

* refine 1,2,3

* simplify string ids

* focus on what matters

---------

Co-authored-by: link2xt <link2xt@testrun.org>
Co-authored-by: Hocuri <hocuri@gmx.de>
2023-03-24 15:22:26 +01:00
Asiel Díaz Benítez
1523e7bc07
add app icon to webxdc info messages (#2503)
* add app icon to webxdc info messages

* Update res/layout/conversation_item_update.xml

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

* check if info message type is DcMsg.DC_INFO_WEBXDC_INFO_MESSAGE before loading parent message

---------

Co-authored-by: Hocuri <hocuri@gmx.de>
2023-03-22 15:44:56 +01:00
link2xt
9b3d5df1fd
Add fallback implementations for sendmmsg, recvmmsg and getauxval (#2491)
These functions are not available in related NDK,
so we provide a fallback implementation for them.
2023-03-06 23:04:39 +01:00
link2xt
df58225192 Revert "add epoll_create fallback which is missing in API<21"
This reverts commit e29b6f9974.

Since update to `mio` 0.8.5, it does not require `epoll_create1()`
function to be present on Android anymore.
2023-02-24 12:55:45 +00:00
bjoern
2450bfc4bf
remove meanwhile superfluous data2IsString() (#2418) 2022-11-10 10:39:33 +01:00
bjoern
8a98da3c78
replace deprecated DcAccountsEventEmitter by DcEventEmitter (#2376) 2022-08-29 18:05:34 +02:00
bjoern
4b3382dab5
use dc_contact_was_seen_recently() (#2373)
* add DcContact.wasSeenRecently()

* use DcContact.wasSeenRecently() and remove isSeenRecently()

* remove now again unused imports
2022-08-26 23:13:56 +02:00
B. Petersen
9740607147 add DcChat::getMailinglistAddr 2022-07-26 22:45:29 +02:00
B. Petersen
97206a48d2 also emulate EPOLL_CLOEXEC 2022-06-27 23:18:32 +02:00
B. Petersen
e29b6f9974 add epoll_create fallback which is missing in API<21 2022-06-27 23:18:32 +02:00
B. Petersen
6b8f0842aa use new dc_provider_new_from_email_with_dns() api 2022-04-27 23:04:18 +02:00
B. Petersen
f047f1382e add resendMsgs() api 2022-04-26 21:00:47 +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
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
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
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
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
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
adbenitez
22fced3fa5 add DcContact.getLastSeen() 2021-11-22 21:16:54 -05:00
bjoern
e71f5d9bba
broadcasts android ui (#2060)
* add broadcasts ffi

* add 'broadcast' options to menu, chat, profile etc.

* generate initial broadcast names

* reword broadcast hint

* make 'Broadcasts Lists' experimental; while on that, also add a confirmation dialog to the location streaming switch (wording taken from ios)

* Update res/values/strings.xml

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

* comment on strings.xml

* tweak 'experimental' appearing, avoid the 'test tube'-emoji that is not supported on many devices

Co-authored-by: Hocuri <hocuri@gmx.de>
2021-09-30 15:44:17 +02:00
bjoern
beb601bc06
do not download large messages automatically (#2045)
* add download-ffi methods

* add 'Download' button for incomplete messages

* show 'downloading' animation

* make download_limit configurable

* set button to 'disabled' and text to 'Downloading...' on downloading; color does not really reflect that yet, but that can probably be tweaked by xml

* make 'download message body' translatable
2021-09-13 23:07:49 +02:00
B. Petersen
4c679053b9
add dc_accounts_t api to JNI 2021-07-26 18:37:49 +02:00
Hocuri
f941fd3c53
Remove Deaddrop chat (Android UI) (#1975)
See deltachat/deltachat-core-rust#2514

Fixes #1963
Fixes #1890

Before deleting a chat the user is asked for confirmation. Before blocking not, because blocking is not "destructive" (i.e. can be completely reverted by unblocking the contact). I'm wondering whether we should show a snackbar with an Undo button though, but we can probably wait for user feedback on this.

* Start removing deaddrop chat

* Generally works

* Fix the buttons

(it's not easy to not show one of the buttons in
ConstraintLayout; if problems turn up, we should probably
just not use ConstraintLayout)

* fix more things

* restartLoader() instead of notifyDataSetChanged() because the latter didn't do anything

* Archived badge

* Rename "Contact request" to "Request"

* oops

* Remove setStockTranslation(8, context.getString(R.string.chat_contact_request));

* Remove commented-out code, we probably won't need it

* Don't show "Delete" button for 1:1 chats

* Get rid of short flickering when declining a request

* Set the app's night mode to match the preference

This added 6ms to startup time, but I think that's OK, as
we will also be able to use more `-night` views in the future

* Make "Accept" text a bit brighter and easier to read in dark mode

* Check if the chattype is Group instead of members.length == 1
2021-07-26 13:01:59 +02:00
Hocuri
b3fea81bed Implement a basic connectivity view
The non-squashed original commits are available at 243bd3a56:

* First, quick and dirty version

* Basic HTML connectivity view

* Codestyle, automatically refresh

* Make it accessible from the settings

* Improve usability

I did some user-testing with my family, these are the results:
- Added an emoji to the html page (red dot for not connected, and so on)
- Adapted error messages for SMTP:
  "Not started" -> "(You did not try to send a message recently)"
  "🟢 Connected" -> "🟢 Your last message was sent successfully"
- "Not connected" is misleading, because they think that this means that there is no internet connection.
  But "Not connected" can have other causes, like, a not responding server or a changed-but-not-updated-in-DC password

  Possible solutions:
  - "Not connected" -> "Not connected with gmx.de" (or whatever comes after the '@' in configured_addr). The problem: some people have an own domain for their emails, but no own servers. "Not connected with <your domain>" and might make them think that the problem is that DC tries to connect to the server <your domain>, while the server is hosted at Strato.com.
  - We can ask the system whether there currently is network and then show another error message. The problem: Sometimes the system is wrong.

* Remove error_network

* Remove server_response string

* Move `getConnectivitySummary()` to `DcHelper`

* Implement the changes we agreed on

* Remove string error_no_network

* small fixes
2021-07-08 22:50:22 +02:00
B. Petersen
614516ff98 remove outdated header, we usually do not use a header in the source files at all 2021-03-09 20:49:58 +01:00
B. Petersen
4901d7c68f add getStatus() api 2021-03-09 01:59:17 +01:00
Hocuri
f6a5a24165 Use the message subject as the full-msg-view title
For long subject it's ellipsized (`…`) now, but I think that there is no need to show the full subject somewhere, it usually doesn't contain _that_ important information and can be seen in full in the normal chat view
2021-03-07 17:40:22 +01:00
bjoern
05287b50bf
remove dead code (#1820)
the number of blocked contacts is just the size of the array returned by getBlockedContacts()
2021-02-22 16:24:49 +01:00
Hocuri
3b8f3e7628 Show the correct sender name in mailing list messages 2021-02-10 21:33:18 +01:00
bjoern
c814885f5c
mailinglists3 (#1781)
* Adapt to mailing lists

* Change the question if this is a mailing list (untested)

* rm unused fn

* Adapt to getSenderName -> getOverrideSenderName (untested)

* Use dc_msg_get_sender_first_name() because sometimes the first name was not correctly shown in mailing lists

* Don't let the user modify mailing list groups

* Fix crash

* Make Unnamed newsletter translatable, make the subtitle of mailing lists "Mailing list"

* tweak and hide some controls for mailing lists

* Update src/com/b44t/messenger/DcChat.java

Co-authored-by: bjoern <r10s@b44t.com>

* adapt to new dc_msg_get_real_chat() api, remove dc_msg_get_sender_first_name()

* remove now dead code

* add mailing list name to contact-request-question

move question-creation to a helper class
to avoid duplicated code.

* fix DcMsg.getOverrideSenderName()

* adapt to new dc_decide_on_contact_request() api

* re-allow changing name+image for mailinglists, see recent discussions on PRs

* remove memberlist- and settings-tab from mailinglist profile until there is some use for them

* adapt to new DC_CHAT_TYPE_MAILINGLIST type

Co-authored-by: Hocuri <hocuri@gmx.de>
2021-02-07 23:39:48 +01:00
B. Petersen
9f2be9c56c use dc_get_chat_encr_info() where useful 2021-02-07 20:32:51 +01:00
bjoern
8d9c02dd7a
add option to view full (html) message (#1763)
* add get-mime-original apis

* remove unused control

* add 'Show full message' buttons

* split reusable WebViewActivity from LocalHelpActivity

* add FullMsgActivity

* load html via AsyncTask

* adapt to changed api

* handle mailto:-links in WebView

* block loading remote images by default, add user setting always/once/never

* do not hide 'Once' button in always-mode, playing around a day with hidden 'Once' that looks more like a bug :)

* wording: as 'Always' affects all messages, it is better to speak of multiple senders

* wording: use 'Load remote images'

this makes it easier for the user to find the option
if one sees, images are missing in the document.

* wording: shorten text.

* wording: change 'may' to 'can'. 'may' sounds a bit as if someone allows this.

* Don't use AsyncTask

* check 'once' if appropriate

* use lite-colored checkbox-emoji in dark-theme

* add comment about missing error logging

Co-authored-by: Hocuri <hocuri@gmx.de>
2021-01-28 22:53:15 +01:00
B. Petersen
3914bf7ff4
adapt to removed dc_contact_get_first_name() api
use dc_contact_get_display_name() instead
2021-01-23 19:52:23 +01:00
B. Petersen
5371f312ac remove unused isIoRunning() api
the api is about to be removed from core as well,
see https://github.com/deltachat/deltachat-core-rust/pull/2139
2021-01-15 06:49:39 +03:00
Hocuri
45aa3e5b82 Directly show error on msg tap
fix #1749
2020-12-13 18:06:44 +01:00
Hocuri
99d52f0be2
Remove updateDeviceChats (see https://github.com/deltachat/deltachat-core-rust/pull/1957) 2020-10-16 10:22:40 +02:00
B. Petersen
dde0247681
adapt to new protect-api 2020-10-13 22:07:08 +02:00
Hocuri
c720df5d5c Add swipe-to-reply quotes 2020-10-11 22:09:51 +03:00
B. Petersen
25ad9973af
catch new DC_EVENT_MSGS_NOTICED as needed 2020-09-25 22:41:08 +02:00
Alexander Krotov
e407a0dc53 Expand tabs in dc_wrapper.c 2020-09-15 23:57:22 +03:00
Alexander Krotov
cd48e56af4 Add EditorConfig
It documents indentation style for source files.

See https://editorconfig.org/ for more.
2020-09-15 22:23:44 +03:00
B. Petersen
6b11b60b84
add new videochat apis 2020-07-29 14:00:01 +02:00
Alexander Krotov
31e6b94683 Add ephemeral message timer API 2020-06-29 23:55:18 +03:00
Alexander Krotov
c877930b73 jni: use dc_array_get_id instead of dc_array_get_raw
dc_array_get_raw API prevents Rust code from storing IDs in other format
than an array of uint32_t.
2020-06-24 23:21:32 +03:00