Alexander Krotov
61726168d6
examples/simple.rs: fix clippy warnings
2020-01-29 23:29:34 +03:00
Alexander Krotov
893eb8b73b
Move message size limits to constants
...
Corresponding C code:
https://github.com/deltachat/deltachat-core/blob/d31c82478c4410b6f575e501c565f627521e05a2/src/dc_context.h#L165
2020-01-28 23:32:38 +03:00
Alexander Krotov
07a5ee7d2c
mimeparser: construct MimeMessage at the end of from_bytes()
...
This reduces the scope of code dealing with mutable structures.
2020-01-28 17:46:16 +03:00
Alexander Krotov
c7a300be2f
mimeparser: split parse_headers() into multiple functions
2020-01-28 17:46:16 +03:00
Alexander Krotov
ef842fca89
Increase python test timeout to 90 seconds
2020-01-28 17:44:34 +03:00
Alexander Krotov
bdbe9e1ca5
fix(python): add more checks for _thread_quitflag
2020-01-28 17:44:34 +03:00
Alexander Krotov
0c7f65222c
fix(python): add workaround for interrupt_idle race condition
2020-01-28 17:44:34 +03:00
Alexander Krotov
cf7ccb5b8c
configure: do not format! an empty string
2020-01-26 16:51:51 +01:00
Alexander Krotov
b83e6f6e7c
Simplify MsgId.is_special()
2020-01-26 16:19:01 +01:00
Alexander Krotov
2687777a82
Remove unused EmailAddress::new()
2020-01-26 16:18:34 +01:00
Alexander Krotov
3a08929b05
Print "email" JSON-value if it has a wrong type
2020-01-26 12:28:42 +00:00
Alexander Krotov
033a44580c
Turn get_[fresh_]msg_cnt() into ChatId members
2020-01-25 22:11:13 +00:00
Alexander Krotov
4734bcfbb4
Update Chat.unarchive() comment
2020-01-25 22:11:13 +00:00
Alexander Krotov
099fe6f477
Rename Chat.set_blocking() into set_blocked()
2020-01-25 22:11:13 +00:00
Alexander Krotov
889327b5f6
Rename Chat.archive() into Chat.set_archived()
2020-01-25 22:11:13 +00:00
Alexander Krotov
a2845f44ab
Turn ChatId-related functions into methods
2020-01-25 22:11:13 +00:00
Alexander Krotov
a7477516d1
mimefactory: factor out get_location_kml_part
2020-01-25 17:44:19 +00:00
Alexander Krotov
bf3eab453c
Avoid panic in sanitise_name()
...
.truncate() is not safe because it panics if string length does not
lie on character boundary. We convert the string to characters and take
first n character instead.
2020-01-25 13:04:56 +01:00
Alexander Krotov
ebab893330
dc_tools: remove unused dc_derive_safe_stem_ext()
...
It had the same .truncate() bug as BlobObject::sanitise_name()
2020-01-25 13:04:56 +01:00
Alexander Krotov
4c67b3a118
Add failing test_sanitise_name() test
2020-01-25 13:04:56 +01:00
Alexander Krotov
64026fde7c
Store main part of the message outside of "parts" vector
2020-01-22 04:28:35 +00:00
Alexander Krotov
adcdae4abe
Factor get_message_kml_part out of render_message
2020-01-22 04:28:35 +00:00
Alexander Krotov
90a4303c8e
Make it possible to compile with stable Rust
2020-01-21 19:50:42 +03:00
Alexander Krotov
84a5276ab0
Fix build
...
0f52f63863 rebase broke the build
2020-01-21 17:17:51 +03:00
Alexander Krotov
1732c3b350
Reduce the scope of clippy exceptions
...
This prevents creation of new overly complex functions.
2020-01-21 14:49:53 +01:00
Alexander Krotov
0f52f63863
Add "Auto-Submitted: auto-replied" header to MDNs
...
This header is specified in RFC 3834.
2020-01-21 16:29:18 +03:00
Alexander Krotov
a3f2088046
Fix the message printed on job success
...
"Cannot be retried" does not make it clear if the job succeeded or failed.
2020-01-20 10:47:32 +01:00
Alexander Krotov
d8454d9da5
Deduplicate SendMdn and SendMsgToSmtp code
2020-01-20 00:35:11 +03:00
Alexander Krotov
318194a216
Rename Param::MessageId into Param::MsgId
...
MsgId refers to database ID, same as crate::message::MsgId newtype.
2020-01-20 00:35:11 +03:00
Alexander Krotov
b50d2358d3
Rename X-Additional-Message-IDs into Additional-Message-IDs
...
X- prefixes are deprecated in https://tools.ietf.org/html/rfc6648
2020-01-20 00:35:11 +03:00
Alexander Krotov
763587ffb4
Load only one job at a time
...
As a result of job, other jobs can be added or deleted. To avoid
processing deleted jobs and to process other jobs in the correct order,
we should reload them after performing each job.
However, we don't use "LIMIT 1" in SQL queries, because we want to be
able to skip over invalid jobs, and checking if job is invalid can only
be done in Rust.
2020-01-20 00:35:11 +03:00
Alexander Krotov
8a375c12e9
Mark two messages as seen in test_send_and_receive_message_markseen
...
This may or may not send a combined MDN out. We don't test for it,
but the test ensures that *if combined MDNs are sent in this case*,
then we receive them correctly.
2020-01-20 00:35:11 +03:00
Alexander Krotov
11afdb51f3
Log it when MDNs are combined
2020-01-20 00:35:11 +03:00
Alexander Krotov
e4353f4650
Aggregate SendMdn jobs
2020-01-20 00:35:11 +03:00
Alexander Krotov
9d4437a7f5
Make it possible to add X-Additional-Message-IDs to MDNs
2020-01-20 00:35:11 +03:00
Alexander Krotov
493bf5ed08
Parse additional message IDs in MDNs
2020-01-20 00:35:11 +03:00
Alexander Krotov
93800fd834
Construct list of recipients in SendMdn
...
There is always one recipient for MDNs, so it is easier to only handle
this case.
2020-01-20 00:35:11 +03:00
Alexander Krotov
79bc34ed76
Move check for blocked contact from mimefactory to SendMdn job
2020-01-20 00:35:11 +03:00
Alexander Krotov
b40ad7e87e
Store contact ID in SendMdn job foreign_id
...
This change makes it possible to find all pending MDNs for the contact
with an SQL query.
2020-01-20 00:35:11 +03:00
Alexander Krotov
1ab3fba212
Move check for enabled MDNs from message rendering to MDN job
2020-01-20 00:35:11 +03:00
Alexander Krotov
3cd0bbc0f4
Move foreign_id handling out of mimefactory
2020-01-20 00:35:11 +03:00
Alexander Krotov
a806728e43
Make a new job type for MDN sending
...
Now MDN is generated on every try instead of being stored in a blob.
2020-01-20 00:35:11 +03:00
Alexander Krotov
683037ca69
Remove no-op jobs SendMdnOld and SendMsgToSmtpOld
2020-01-20 00:35:11 +03:00
Alexander Krotov
a113127df1
Implement Display for MessageState
2020-01-20 00:35:11 +03:00
Alexander Krotov
fecfaaf812
Test MDN parsing
2020-01-20 00:35:11 +03:00
Alexander Krotov
8df8f1f6f7
Update deltachat_derive metadata
...
Same as core and FFI.
2020-01-19 21:40:22 +01:00
Alexander Krotov
5502ca5f58
Update deltachat_derive dependencies
2020-01-19 21:40:22 +01:00
Alexander Krotov
75b8cfa92e
Disable unnecessary image crate features
...
TIFF file format and parallel processing of JPEGs are not necessary to
recode avatars.
2020-01-18 00:30:52 +03:00
Alexander Krotov
08dd0e34d1
Make reqwest features "blocking" and "json" non-optional
2020-01-17 16:01:11 +03:00
Alexander Krotov
213c5df706
mimefactory: remove unused "increation" field
2020-01-16 23:37:53 +03:00
Alexander Krotov
df7253b13e
Document MessageState and fix some typos
2020-01-15 00:48:10 +03:00
Alexander Krotov
fcafd63f41
Remove NOTE about third-party libraries
...
"libs" directory has been removed during transition to Rust
2020-01-14 10:29:08 +03:00
Alexander Krotov
454c52f4ab
Use correct SPDX license identifier in Cargo.toml
2020-01-13 10:48:16 +00:00
Alexander Krotov
08bd16c1b6
Update rusqlite
2020-01-12 21:54:38 +00:00
Alexander Krotov
4f06c72798
Remove top_evil_rs.py
2020-01-12 09:02:30 +00:00
Alexander Krotov
166fe2a4e5
Forbid unsafe code in deltachat crate
2020-01-12 09:02:30 +00:00
Alexander Krotov
b7635a71c8
Do not call unsafe rusqlite::ffi::sqlite3_threadsafe()
...
rusqlite already checks that SQLite is safe to use in multi-threaded mode when it opens the database and returns rusqlite::Error::SqliteSingleThreadedMode otherwise.
2020-01-12 09:02:30 +00:00
Alexander Krotov
6ad4bdea83
Make get_parent_mime_headers() private
2020-01-12 09:12:24 +01:00
Alexander Krotov
efb9a11d22
Do not select drafts as parent message
...
Also create a common parent_query() function to make sure we use the
same message as a parent when determining if it is encrypted and when
actually replying to it.
2020-01-12 09:12:24 +01:00
Alexander Krotov
047d09bcb1
Do not pass &Sql to parent_is_encrypted()
2020-01-12 09:12:24 +01:00
Alexander Krotov
e1ca6b5181
Rename last_msg_in_chat_encrypted into parent_is_encrypted
2020-01-12 09:12:24 +01:00
Alexander Krotov
36a2569537
Make last_msg_in_chat_encrypted a member function
2020-01-12 09:12:24 +01:00
Alexander Krotov
10ceddfa67
Set draft in test_reply_encrypted test
...
Adding unencrypted draft to chat makes the job of determining whether
last message is encrypted harder.
2020-01-12 09:12:24 +01:00
Alexander Krotov
ee4adc1363
Return &str from extract_grpid
2020-01-11 14:59:53 +01:00
Alexander Krotov
c7b2bdfaac
mimeparser: simplify get_subject() and get_rfc724_mid
2020-01-11 14:59:53 +01:00
Alexander Krotov
fde8fb960b
oauth2: replace unwrap() and is_none() with "if let"
2020-01-11 14:59:53 +01:00
Alexander Krotov
9a43d26c60
dc_receive_imf: do not unwrap() Some(..) immediately after creation
2020-01-11 14:59:53 +01:00
Alexander Krotov
742f603b3b
Use if let to avoid unwrap() of peerstate
2020-01-11 14:59:53 +01:00
Alexander Krotov
a82f2a5df3
Simplify needs_encoding() and add a test
2020-01-11 14:59:53 +01:00
Alexander Krotov
06bc5513ae
Use Vec::first to avoid explicit is_empty() check
2020-01-11 14:59:53 +01:00
Alexander Krotov
47b937f880
Turn some enum Param comments into doc-comments
2020-01-11 15:27:09 +03:00
Alexander Krotov
775d27b6a9
Update group test
2020-01-10 15:20:23 +03:00
Alexander Krotov
6c838ab57c
Never reset gossip timestamp for all chats at the same time
2020-01-10 15:20:23 +03:00
Alexander Krotov
8eebd2aa67
Do not reset gossip timestamp when group members change
2020-01-10 15:20:23 +03:00
Alexander Krotov
fc78a08657
Fix inverted should_do_gossip condition
2020-01-10 15:20:23 +03:00
Alexander Krotov
7b3cc95ab7
Derive Debug for Loaded and MimeFactory
2020-01-10 06:42:36 +00:00
Alexander Krotov
bd70765b7d
Join recipients_names and recipients_addr into one vector
...
This change ensures on the type level that number of names and addresses
is the same.
2020-01-10 06:42:36 +00:00
Alexander Krotov
5b424aec22
Remove temporary variable "row"
2020-01-10 06:42:36 +00:00
Alexander Krotov
d6cc0694f0
Move Chat from MimeFactory to Loaded::Message
2020-01-10 06:42:36 +00:00
Alexander Krotov
9738515129
Construct immutable MimeFactory in from_msg
2020-01-10 06:42:36 +00:00
Alexander Krotov
b05ee10f41
Return Err from MimeFactory::from_msg on database errors
2020-01-10 06:42:36 +00:00
Alexander Krotov
67d85f0f86
Make all MimeFactory fields private
2020-01-10 06:42:36 +00:00
Alexander Krotov
2ddeef761f
Fix gossiped_timestamp documentation
2020-01-09 15:40:58 +03:00
Alexander Krotov
43e0109d44
Update reqwest to 0.10.0
2020-01-09 12:17:17 +03:00
Alexander Krotov
02bb41697d
Add MessengerMessage type for is_dc_message field
2020-01-08 19:00:45 +03:00
Alexander Krotov
12cd56e3e8
Rename type_0 into viewtype
2020-01-08 19:00:45 +03:00
Alexander Krotov
40dc180b88
Update mailparse to 0.10.2
...
It does not allow parsing emails without @
2020-01-08 16:52:27 +03:00
Alexander Krotov
4529c326c6
Restore newlines and remove semicolon in test_parse_first_addr
2020-01-07 17:23:59 +01:00
Alexander Krotov
f6660af014
Update test_mdn_asymmetric
...
MDNs are processed now even when MDNs are disabled
2020-01-07 17:23:19 +01:00
Alexander Krotov
a52131b574
cargo fmt
2020-01-07 17:23:19 +01:00
Alexander Krotov
a48d0492c8
Create only one MarkseenMdnOnImap job even if message has multiple reports
...
All created jobs have the same parameters and move the same message,
so it does not make sense to create more than one.
2020-01-07 17:23:19 +01:00
Alexander Krotov
2bba1be817
Show received MDNs even if user has disabled them
...
Delta Chat does not request MDNs if they are disabled, so this change
does not make much difference, but simplifies the logic.
2020-01-07 17:23:19 +01:00
Alexander Krotov
693ae9e8f2
Guess mimetype of .webm files as video/webm
2020-01-07 09:19:36 +00:00
Alexander Krotov
7aeddc63ac
Use DC_CHAT_ID_DEADDROP instead of constant "1"
2020-01-06 00:04:03 +00:00
Alexander Krotov
8702f290af
mimeparser: remove unused parsed_protected_headers field
2020-01-05 22:03:10 +01:00
Alexander Krotov
d0b5b7ba03
Turn handle_reports comment into documentation comment
2020-01-04 22:24:16 +01:00
Alexander Krotov
f3d68c6f25
Add requests dependency to python/README.rst
...
It is used in tests/conftest.py
2020-01-04 20:18:31 +01:00
Alexander Krotov
91100d3fac
Lowercase the addresses before gossip peerstate update
...
Normally it happens in addr_cmp function, but update_gossip_peerstates
forms a HashSet of addresses, so they should be lowercased beforehand.
Also adjust the mail_with_cc.txt to test for non-lowercase addresses.
2020-01-02 18:14:27 +00:00
Alexander Krotov
61833c32e5
Remove trailing space from deltachat.h
2020-01-01 23:05:08 +00:00
Alexander Krotov
1468f67b9b
Warn about multiple From addresses only when necessary
...
The message says "only using first" so it should be printed right before the first address is taken with .get_index(0) operation.
2020-01-01 21:03:28 +00:00