Floris Bruynooghe
9d7b756ddb
Unify some testing interfaces
...
This tidies up our testing tools a little bit. We had several
functions which through various changes ended up doing the same and
some more which did very similar stuff, so I merged them to have
things simpler. Also moved towards methods on the TestContext struct
while cleaning this up anyway, seems like this structure is going to
stay around for a bit anyway.
The intersting change is in `test_utils.rs`, everything else is just
updating callers. A few tests used example.org which I moved to
example.com to be able to re-use more configuration of the test
context.
2020-06-20 14:37:41 +02:00
Hocuri
ffb6a84b1f
Warn instead of error
2020-06-13 10:18:16 +02:00
Hocuri
bd2a7a3d40
Correct failed recipient
2020-06-13 10:18:13 +02:00
Hocuri
98b5f768b6
Improve test, fixed compile errors from rebasing
2020-06-13 10:18:13 +02:00
Hocuri
8350729cbb
Improve errors
2020-06-13 10:18:11 +02:00
Alexander Krotov
7de23f86b1
Do not reply to messages that can't be decrypted
...
This commit fixes the test broken in previous commit.
2020-06-08 23:16:35 +02:00
bjoern
17283c86a3
Update src/chat.rs
...
Co-authored-by: Hocuri <hocuri@gmx.de >
2020-06-08 10:37:13 +02:00
B. Petersen
d5ea4f9b1a
make clippy happy
2020-06-08 10:37:12 +02:00
B. Petersen
191009372b
basically recode images
2020-06-08 10:37:12 +02:00
Alexander Krotov
f0f020d9d2
chat: get rid of ChatId.is_error()
...
get_rowid should not return 0, as we have inserted a row right above.
And using is_error() instead of comparing row_id to 0 is a strange way
to check this condition.
As all functions that actually returned 0 chat ID to indicate error have
been removed, the function is gone too.
2020-06-06 19:49:57 +03:00
dignifiedquire
0ea442ca36
feat: add chat::send_msg_sync
2020-05-23 18:56:45 +02:00
Friedel Ziegelmayer
014d2946b2
feat: use EventEmitter for events
2020-05-22 21:03:01 +02:00
dignifiedquire
28ef5164ce
happy clippy
2020-05-22 11:37:12 +02:00
dignifiedquire
e8e82d9760
improve error handling and fix sleeps
2020-05-21 14:35:07 +02:00
dignifiedquire
133ff4914d
first pass at resolving CR
2020-05-19 17:26:22 +02:00
dignifiedquire
af56ebb04e
Merge remote-tracking branch 'origin/master' into feat/async-jobs
2020-05-19 12:07:34 +02:00
Alexander Krotov
3e2bfc35e3
Delete hidden expired messages
...
The condition remains from the time when expired messages were hidden
instead of being moved into trash chat. As a result, old hidden
messages, such as location messages, were not deleted.
2020-05-15 20:46:41 +03:00
dignifiedquire
8a7923c974
Merge remote-tracking branch 'origin/master' into feat/async-jobs
2020-05-13 18:29:22 +02:00
Simon Laux
c2c0c81f1c
cargo fmt
2020-05-11 11:51:40 +02:00
Simon Laux
fe23907eb3
fix muting dm chats
...
and rewrite the erroro message so that it makes more sense
2020-05-11 11:51:40 +02:00
Alexander Krotov
2dbb1bbbea
Do not reply to hidden messages
...
Especially with read receipts, it is wrong, because they are never
encrypted and their Message-IDs are not known to other users in a group.
2020-05-09 19:11:23 +03:00
bjoern
30be5e33d7
Merge pull request #1410 from deltachat/remove_addremove
...
remove all member_added/remove_events
2020-04-23 00:59:09 +02:00
bjoern
7846c23edd
Merge pull request #1411 from deltachat/delete-no-hide
...
Delete expired messages instead of hiding them
2020-04-20 18:04:30 +02:00
Alexander Krotov
6c0dd8543d
Delete expired messages instead of hiding them
...
For hidden messages, blobs are not deleted during housekeeping. To
actually free the space used by media files, messages should be moved to
trash instead of being hidden.
2020-04-20 02:29:55 +03:00
holger krekel
70c082a1b1
remove all member_added/remove_events
2020-04-19 21:15:45 +02:00
holger krekel
9eda710538
refine member-added and member-removed plugin hooks to signal the sender (who added/removed a contact )
...
add ac_chat_modified hook event
add account.get_contact_by_addr (thanks @r10s)
2020-04-19 21:00:55 +02:00
B. Petersen
0b6b8ced92
remove unused dc_chat_get_subtitle() api
2020-04-16 22:08:17 +02:00
Alexander Krotov
3a91c87c73
clippy: use as_deref()
2020-04-13 23:02:57 +03:00
Alexander Krotov
5f574cf283
get_next_media: replace indexing with .get()
2020-04-13 23:02:57 +03:00
Alexander Krotov
92f1e6da1e
get_next_media: enumerate() instead of indexing
2020-04-13 23:02:57 +03:00
holger krekel
1855f84fe0
fix bug in that remove-contact failed on new groups where we didn't have the peerstate of the removed-contact yet
2020-04-13 17:39:31 +02:00
holger krekel
a1d5120e58
sipmlify plugins and tests and remove superflous core event
2020-04-13 17:39:31 +02:00
holger krekel
f38386d164
fix member_added/member_removed event with tests and and provide a group-tracking example
2020-04-13 17:39:31 +02:00
holger krekel
d66829702f
fix #164 add MEMBER_REMOVED event and member_removed plugin python hook
2020-04-13 17:39:31 +02:00
holger krekel
84f17b7539
emit "DC_EVENT_MEMBER_ADDED" and python plugin event "member_added" for securejoin or non-securejoin additions of a contact to a chat. also fixup some docs
2020-04-13 17:39:31 +02:00
Alexander Krotov
e9967c32e6
chat: filter parent messages by state instead of UID
...
Since introduction of server message deletion, message may not have
server UID even when it is not a draft or pending message. To handle
such messages correctly, we explicitly check message state.
2020-04-13 17:38:42 +02:00
Alexander Krotov
f65dbee74b
Add basic test for ChatId.parent_is_encrypted()
2020-04-13 17:38:42 +02:00
Alexander Krotov
f51fd1267f
chat: move parent_query() and related methods from Chat to ChatId
2020-04-13 17:38:42 +02:00
Friedel Ziegelmayer
24f4cbbb27
refactor: replace failure
...
- failure is deprecated
- thiserror for deriving Error impl
- anyhow for highlevel error handling
2020-04-10 22:39:28 +02:00
dignifiedquire
307a3e078e
Merge remote-tracking branch 'origin/master' into feat/async-jobs
2020-04-09 23:41:34 +02:00
Alexander Krotov
916fab7d4b
hide_device_expired_messages: allow missing self or device chat
2020-04-03 12:12:56 +03:00
Alexander Krotov
4e0a08106d
ChatId.get_param: remove unnecessary type annotation
2020-04-01 20:06:27 +03:00
Alexander Krotov
fc57cbfb49
Refactor hiding of expired messages
...
Now there is only one function: hide_device_expired_messages().
If any messages are hidden event DC_EVENT_MSGS_CHANGED(0,0) is emitted
now, which is more correct than DC_EVENT_CHAT_MODIFIED and also triggers
chatlist reload.
2020-04-01 20:06:27 +03:00
Alexander Krotov
7522fec044
Do not emit "chat modified" events when loading chatlist
...
Otherwise chatlist will be loaded twice, once right after hiding expired
messages, and once in response to event emitted by try_load().
2020-04-01 20:06:27 +03:00
Alexander Krotov
237dabb907
Do not hide hidden messages in ChatId.delete_device_expired_messages()
...
This prevents infinite event loop, when chatlist is reloaded in response
to event, and event is emitted by hiding messages before chatlist reload.
2020-04-01 20:06:27 +03:00
Alexander Krotov
3686048ab6
chatlist: hide all expired messages before loading
2020-04-01 20:06:27 +03:00
Alexander Krotov
2bf4c5d7e7
Emit "chat modified" event when messages expire
2020-04-01 20:06:27 +03:00
Alexander Krotov
051d80b2f3
Move delete_device_expired_messages() to ChatId
...
This allows to check if chat is a self-talk or device chat.
Messages are deleted only in viewed chats now.
2020-04-01 20:06:27 +03:00
Alexander Krotov
adaa1e856c
chat: add ChatId.is_self_talk() and ChatId.is_device_talk()
2020-04-01 20:06:27 +03:00
Alexander Krotov
4daa57c98e
delete_device_expired_messages: set text to DELETED for hidden messages
...
This makes debugging easier: DELETED messages should never be shown.
2020-04-01 20:06:27 +03:00