mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
Resolve some small TODOs
This commit is contained in:
@@ -2904,8 +2904,8 @@ async fn test_broadcast_joining_golden() -> Result<()> {
|
|||||||
bob.golden_test_chat(bob_chat_id, "test_broadcast_joining_golden_bob")
|
bob.golden_test_chat(bob_chat_id, "test_broadcast_joining_golden_bob")
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
let alice_bob_contact = alice.add_or_lookup_contact_id(bob).await;
|
let alice_bob_contact = alice.add_or_lookup_contact_no_key(bob).await;
|
||||||
let direct_chat = ChatIdBlocked::lookup_by_contact(alice, alice_bob_contact)
|
let direct_chat = ChatIdBlocked::lookup_by_contact(alice, alice_bob_contact.id)
|
||||||
.await?
|
.await?
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// The 1:1 chat with Bob should not be visible to the user:
|
// The 1:1 chat with Bob should not be visible to the user:
|
||||||
@@ -2914,6 +2914,25 @@ async fn test_broadcast_joining_golden() -> Result<()> {
|
|||||||
.golden_test_chat(direct_chat.id, "test_broadcast_joining_golden_alice_direct")
|
.golden_test_chat(direct_chat.id, "test_broadcast_joining_golden_alice_direct")
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
alice_bob_contact
|
||||||
|
.get_verifier_id(alice)
|
||||||
|
.await?
|
||||||
|
.unwrap()
|
||||||
|
.unwrap(),
|
||||||
|
ContactId::SELF
|
||||||
|
);
|
||||||
|
|
||||||
|
let bob_alice_contact = bob.add_or_lookup_contact_no_key(alice).await;
|
||||||
|
assert_eq!(
|
||||||
|
bob_alice_contact
|
||||||
|
.get_verifier_id(bob)
|
||||||
|
.await?
|
||||||
|
.unwrap()
|
||||||
|
.unwrap(),
|
||||||
|
ContactId::SELF
|
||||||
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -580,11 +580,13 @@ impl MimeFactory {
|
|||||||
step == "vg-request-with-auth"
|
step == "vg-request-with-auth"
|
||||||
|| step == "vc-request-with-auth"
|
|| step == "vc-request-with-auth"
|
||||||
|| step == "vb-request-with-auth"
|
|| step == "vb-request-with-auth"
|
||||||
|
// Note that for "vg-member-added" and "vb-member-added",
|
||||||
|
// get_cmd() returns `MemberAddedToGroup` rather than `SecurejoinMessage`,
|
||||||
|
// so, it wouldn't actually be necessary to have them in the list here.
|
||||||
|
// Still, they are here for completeness.
|
||||||
|| step == "vg-member-added"
|
|| step == "vg-member-added"
|
||||||
|| step == "vb-member-added"
|
|| step == "vb-member-added"
|
||||||
|| step == "vc-contact-confirm"
|
|| step == "vc-contact-confirm"
|
||||||
// TODO possibly add vb-member-added here
|
|
||||||
// TODO wait... for member-added messages, Param::Arg doesn't even contain the step, but the email
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1183,7 +1185,6 @@ impl MimeFactory {
|
|||||||
|
|
||||||
let shared_secret: Option<String> = match &self.loaded {
|
let shared_secret: Option<String> = match &self.loaded {
|
||||||
Loaded::Message { msg, .. } if should_encrypt_with_auth_token(msg) => {
|
Loaded::Message { msg, .. } if should_encrypt_with_auth_token(msg) => {
|
||||||
// TODO rather than setting Arg2, bob.rs could set a param `Param::SharedSecretForEncryption` or similar
|
|
||||||
msg.param.get(Param::Arg2).map(|s| s.to_string())
|
msg.param.get(Param::Arg2).map(|s| s.to_string())
|
||||||
}
|
}
|
||||||
Loaded::Message { chat, msg }
|
Loaded::Message { chat, msg }
|
||||||
|
|||||||
@@ -99,10 +99,10 @@ pub enum Param {
|
|||||||
|
|
||||||
/// For Messages
|
/// For Messages
|
||||||
///
|
///
|
||||||
/// For "MemberRemovedFromGroup" this is the email address
|
/// For "MemberRemovedFromGroup", this is the email address
|
||||||
/// removed from the group.
|
/// removed from the group.
|
||||||
///
|
///
|
||||||
/// For "MemberAddedToGroup" this is the email address added to the group.
|
/// For "MemberAddedToGroup", this is the email address added to the group.
|
||||||
///
|
///
|
||||||
/// For securejoin messages, this is the step,
|
/// For securejoin messages, this is the step,
|
||||||
/// which is put into the `Secure-Join` header.
|
/// which is put into the `Secure-Join` header.
|
||||||
|
|||||||
@@ -537,8 +537,6 @@ async fn decode_openpgp(context: &Context, qr: &str) -> Result<Qr> {
|
|||||||
(&addr, broadcast_name, grpid, authcode)
|
(&addr, broadcast_name, grpid, authcode)
|
||||||
{
|
{
|
||||||
// This is a broadcast channel invite link.
|
// This is a broadcast channel invite link.
|
||||||
// TODO code duplication with the previous block
|
|
||||||
// TODO at some point, we can mark this person as verified
|
|
||||||
let addr = ContactAddress::new(addr)?;
|
let addr = ContactAddress::new(addr)?;
|
||||||
let (contact_id, _) = Contact::add_or_lookup_ex(
|
let (contact_id, _) = Contact::add_or_lookup_ex(
|
||||||
context,
|
context,
|
||||||
|
|||||||
Reference in New Issue
Block a user