Skip to content

Commit bb83934

Browse files
committed
Move a struct
1 parent b0687fd commit bb83934

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

src/statistics.rs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,23 @@ struct SecurejoinUIPaths {
120120
new_contact: u32,
121121
}
122122

123+
/// Some information on an invite-joining event
124+
/// (i.e. a qr scan or a clicked link).
125+
#[derive(Serialize)]
126+
struct JoinedInvite {
127+
/// Whether the contact was newly created right now.
128+
/// If this is false, then a contact existed already before.
129+
contact_created: bool,
130+
/// If a contact already existed,
131+
/// this tells us whether the contact was verified already.
132+
already_verified: bool,
133+
/// The type of the invite:
134+
/// "contact" for 1:1 invites that setup a verified contact,
135+
/// "group" for invites that invite to a group
136+
/// and also perform the contact verification 'along the way'.
137+
typ: String,
138+
}
139+
123140
/// Sends a message with statistics about the usage of Delta Chat,
124141
/// if the last time such a message was sent
125142
/// was more than a week ago.
@@ -513,8 +530,7 @@ async fn get_message_stats(
513530

514531
let unverified_encrypted = t.query_row(
515532
&format!(
516-
// (param GLOB '*\nc=1*' OR param GLOB 'c=1*')`
517-
// matches all messages that are end-to-end encrypted
533+
// (param GLOB '*\nc=1*' OR param GLOB 'c=1*') matches all messages that are end-to-end encrypted
518534
"SELECT COUNT(*) FROM msgs
519535
WHERE chat_id NOT IN temp.verified_chats AND chat_id NOT IN temp.empty_chats
520536
AND (param GLOB '*\nc=1*' OR param GLOB 'c=1*')
@@ -686,23 +702,6 @@ pub(crate) async fn count_securejoin_invite(context: &Context, invite: &QrInvite
686702
Ok(())
687703
}
688704

689-
/// Some information on an invite-joining event
690-
/// (i.e. a qr scan or a clicked link).
691-
#[derive(Serialize)]
692-
struct JoinedInvite {
693-
/// Whether the contact was newly created right now.
694-
/// If this is false, then a contact existed already before.
695-
contact_created: bool,
696-
/// If a contact already existed,
697-
/// this tells us whether the contact was verified already.
698-
already_verified: bool,
699-
/// The type of the invite:
700-
/// "contact" for 1:1 invites that setup a verified contact,
701-
/// "group" for invites that invite to a group
702-
/// and also perform the contact verification 'along the way'.
703-
typ: String,
704-
}
705-
706705
async fn get_securejoin_invite_stats(context: &Context) -> Result<Vec<JoinedInvite>> {
707706
let qr_scans: Vec<JoinedInvite> = context
708707
.sql

0 commit comments

Comments
 (0)