Skip to content

Commit fd2847b

Browse files
committed
Resolve some small TODOs
1 parent 39396ab commit fd2847b

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

src/chat/chat_tests.rs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2890,8 +2890,8 @@ async fn test_broadcast_joining_golden() -> Result<()> {
28902890
bob.golden_test_chat(bob_chat_id, "test_broadcast_joining_golden_bob")
28912891
.await;
28922892

2893-
let alice_bob_contact = alice.add_or_lookup_contact_id(bob).await;
2894-
let direct_chat = ChatIdBlocked::lookup_by_contact(alice, alice_bob_contact)
2893+
let alice_bob_contact = alice.add_or_lookup_contact_no_key(bob).await;
2894+
let direct_chat = ChatIdBlocked::lookup_by_contact(alice, alice_bob_contact.id)
28952895
.await?
28962896
.unwrap();
28972897
// The 1:1 chat with Bob should not be visible to the user:
@@ -2900,6 +2900,25 @@ async fn test_broadcast_joining_golden() -> Result<()> {
29002900
.golden_test_chat(direct_chat.id, "test_broadcast_joining_golden_alice_direct")
29012901
.await;
29022902

2903+
assert_eq!(
2904+
alice_bob_contact
2905+
.get_verifier_id(alice)
2906+
.await?
2907+
.unwrap()
2908+
.unwrap(),
2909+
ContactId::SELF
2910+
);
2911+
2912+
let bob_alice_contact = bob.add_or_lookup_contact_no_key(alice).await;
2913+
assert_eq!(
2914+
bob_alice_contact
2915+
.get_verifier_id(bob)
2916+
.await?
2917+
.unwrap()
2918+
.unwrap(),
2919+
ContactId::SELF
2920+
);
2921+
29032922
Ok(())
29042923
}
29052924

src/mimefactory.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,11 +580,13 @@ impl MimeFactory {
580580
step == "vg-request-with-auth"
581581
|| step == "vc-request-with-auth"
582582
|| step == "vb-request-with-auth"
583+
// Note that for "vg-member-added" and "vb-member-added",
584+
// get_cmd() returns `MemberAddedToGroup` rather than `SecurejoinMessage`,
585+
// so, it wouldn't actually be necessary to have them in the list here.
586+
// Still, they are here for completeness.
583587
|| step == "vg-member-added"
584588
|| step == "vb-member-added"
585589
|| step == "vc-contact-confirm"
586-
// TODO possibly add vb-member-added here
587-
// TODO wait... for member-added messages, Param::Arg doesn't even contain the step, but the email
588590
}
589591
}
590592

@@ -1183,7 +1185,6 @@ impl MimeFactory {
11831185

11841186
let shared_secret: Option<String> = match &self.loaded {
11851187
Loaded::Message { msg, .. } if should_encrypt_with_auth_token(msg) => {
1186-
// TODO rather than setting Arg2, bob.rs could set a param `Param::SharedSecretForEncryption` or similar
11871188
msg.param.get(Param::Arg2).map(|s| s.to_string())
11881189
}
11891190
Loaded::Message { chat, msg }

src/param.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ pub enum Param {
9999

100100
/// For Messages
101101
///
102-
/// For "MemberRemovedFromGroup" this is the email address
102+
/// For "MemberRemovedFromGroup", this is the email address
103103
/// removed from the group.
104104
///
105-
/// For "MemberAddedToGroup" this is the email address added to the group.
105+
/// For "MemberAddedToGroup", this is the email address added to the group.
106106
///
107107
/// For securejoin messages, this is the step,
108108
/// which is put into the `Secure-Join` header.

src/qr.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,6 @@ async fn decode_openpgp(context: &Context, qr: &str) -> Result<Qr> {
537537
(&addr, broadcast_name, grpid, authcode)
538538
{
539539
// This is a broadcast channel invite link.
540-
// TODO code duplication with the previous block
541-
// TODO at some point, we can mark this person as verified
542540
let addr = ContactAddress::new(addr)?;
543541
let (contact_id, _) = Contact::add_or_lookup_ex(
544542
context,

0 commit comments

Comments
 (0)