Skip to content

api: Add unpublished flag for transports#7994

Merged
Hocuri merged 2 commits intomainfrom
hoc/unpublished-addrs
Mar 18, 2026
Merged

api: Add unpublished flag for transports#7994
Hocuri merged 2 commits intomainfrom
hoc/unpublished-addrs

Conversation

@Hocuri
Copy link
Collaborator

@Hocuri Hocuri commented Mar 15, 2026

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.

  • 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 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.

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?;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Hocuri Hocuri force-pushed the hoc/unpublished-addrs branch from b94d9f9 to 72c8c7b Compare March 17, 2026 15:18
@Hocuri Hocuri requested review from iequidoo and link2xt March 17, 2026 15:18
@Hocuri Hocuri changed the title [WIP] Add unpublished flag for transports Add unpublished flag for transports Mar 17, 2026
}
}

fn concat(slices: &[&[&'static str]]) -> Vec<&'static str> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can as well return BTreeSet since you always convert the vector into a set immediately.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

@iequidoo iequidoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Hocuri Hocuri force-pushed the hoc/unpublished-addrs branch from 544212d to a0ff35f Compare March 18, 2026 09:56
@Hocuri Hocuri changed the title Add unpublished flag for transports api: Add unpublished flag for transports Mar 18, 2026
@Hocuri Hocuri force-pushed the hoc/unpublished-addrs branch 3 times, most recently from 87977a3 to 047b4d1 Compare March 18, 2026 10:16
…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.
@Hocuri Hocuri force-pushed the hoc/unpublished-addrs branch from 047b4d1 to 8d999b7 Compare March 18, 2026 10:35
@Hocuri Hocuri merged commit 810dab1 into main Mar 18, 2026
30 checks passed
@Hocuri Hocuri deleted the hoc/unpublished-addrs branch March 18, 2026 11:14
Hocuri added a commit that referenced this pull request Mar 18, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to "unpublish" a relay

3 participants