Conversation
c830054 to
2f4c5cc
Compare
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
| /// 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. | ||
| /// | ||
| /// The default is true, but when updating, |
There was a problem hiding this comment.
The default is false, because it is "unpublished", not "published"
| /// 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. | ||
| /// | ||
| /// The default is true, but when updating, |
|
|
||
| let alice_fp = self_fingerprint(alice).await?; | ||
| let secret_for_encryption = dbg!(format!("securejoin/{alice_fp}/{authcode}")); | ||
| let secret_for_encryption = format!("securejoin/{alice_fp}/{authcode}"); |
| self.sql | ||
| .query_map_vec( | ||
| "SELECT addr FROM transports | ||
| WHERE is_published=1 |
There was a problem hiding this comment.
| WHERE is_published=1 | |
| WHERE is_published |
| "SELECT value FROM config WHERE keyname='configured_addr'", | ||
| (), | ||
| |row| row.get(0), | ||
| )?; |
There was a problem hiding this comment.
This needs .context() so we know what query fails if we at some point do something about "primary relay" (failover) and remove configured_addr. Or just someone calls this function on unconfigured context, this will fail because of no rows.
| } | ||
| } | ||
|
|
||
| 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.
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.