Adapt the rest of the code to the new QR code type

This commit is contained in:
Hocuri
2025-07-23 18:42:50 +02:00
parent 3389e93820
commit 5da7e45b2b
2 changed files with 46 additions and 8 deletions

View File

@@ -45,14 +45,18 @@ impl QrInvite {
/// translated to a contact ID.
pub fn contact_id(&self) -> ContactId {
match self {
Self::Contact { contact_id, .. } | Self::Group { contact_id, .. } => *contact_id,
Self::Contact { contact_id, .. }
| Self::Group { contact_id, .. }
| Self::Broadcast { contact_id, .. } => *contact_id,
}
}
/// The fingerprint of the inviter.
pub fn fingerprint(&self) -> &Fingerprint {
match self {
Self::Contact { fingerprint, .. } | Self::Group { fingerprint, .. } => fingerprint,
Self::Contact { fingerprint, .. }
| Self::Group { fingerprint, .. }
| Self::Broadcast { fingerprint, .. } => fingerprint,
}
}
@@ -60,6 +64,7 @@ impl QrInvite {
pub fn invitenumber(&self) -> &str {
match self {
Self::Contact { invitenumber, .. } | Self::Group { invitenumber, .. } => invitenumber,
Self::Broadcast { .. } => panic!("broadcast invite has no invite number"), // TODO panic
}
}
@@ -67,6 +72,7 @@ impl QrInvite {
pub fn authcode(&self) -> &str {
match self {
Self::Contact { authcode, .. } | Self::Group { authcode, .. } => authcode,
Self::Broadcast { .. } => panic!("broadcast invite has no authcode"), // TODO panic
}
}
}