api: Add unpublished flag for transports#7994
Conversation
09521f6 to
b94d9f9
Compare
| if context.get_config_bool(Config::BccSelf).await? | ||
| || msg.param.get_cmd() == SystemMessage::AutocryptSetupMessage | ||
| { | ||
| smtp::add_self_recipients(context, &mut recipients, rendered_msg.is_encrypted).await?; |
There was a problem hiding this comment.
This change actually fixes an unrelated bug, and is necessary for the tests to pass: We need to pass is_encrypted to add_self_recipients(), not needs_encryption
b94d9f9 to
72c8c7b
Compare
unpublished flag for transportsunpublished flag for transports
| } | ||
| } | ||
|
|
||
| fn concat(slices: &[&[&'static str]]) -> Vec<&'static str> { |
There was a problem hiding this comment.
This can as well return BTreeSet since you always convert the vector into a set immediately.
There was a problem hiding this comment.
Not always, I also use it for:
assert_eq!(
sent.recipients,
format!("bob@example.net {}", published_self_addrs.join(" ")),
[...]
)Just returning a Vec here seems easiest overall.
iequidoo
left a comment
There was a problem hiding this comment.
By default, transports are published, but when updating, all existing transports except for the primary one become unpublished in order not to break existing users that followed https://delta.chat/legacy-move
Btw, that guide says:
The option “Move automatically to DeltaChat Folder” as well as other legacy options will be removed in the next weeks.
But the guide itself doesn't have a publication date, so "next weeks" sounds unclear.
544212d to
a0ff35f
Compare
unpublished flag for transportsunpublished flag for transports
87977a3 to
047b4d1
Compare
…ctions Closes #7980. Unpublished transports are not advertised to contacts, and self-sent messages are not sent there, so that we don't cause extra messages to the corresponding inbox, but can still receive messages from contacts who don't know the new relay addresses yet. - This adds `list_transports_ex()` and `set_transport_unpublished()` JsonRPC functions - By default, transports are published, but when updating, all existing transports except for the primary one become unpublished in order not to break existing users that followed https://delta.chat/legacy-move - It is not possible to unpublish the primary transport, and setting a transport as primary automatically sets it to published An alternative would be to change the existing list_transports API rather than adding a new one list_transports_ex. But to be honest, I don't mind the _ex prefix that much, and I am wary about compatibility issues. But maybe it would be fine; see b08ba4b for how this would look.
047b4d1 to
8d999b7
Compare
Follow-up to #7994, in order to prevent clashes with other things that are called `Transport`, and in order to make the struct name more greppable
Closes #7980. First commit moves some code around, second commit implements the unpublished flag.
Unpublished transports are not advertised to contacts, and self-sent messages are not sent there, so that we don't cause extra messages to the corresponding inbox, but can still receive messages from contacts who don't know the new relay addresses yet.
list_transports_ex()andset_transport_unpublished()JsonRPC functionsAn optional TODO would be to maybe change the existing list_transports API rather than adding a new one list_transports_ex. But to be honest, I don't mind the _ex prefix that much, and I am wary about compatibility issues. But maybe it would be fine; see b08ba4b for how this would look.