mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-25 02:12:13 +00:00
add blue verification check to the user study
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
3acd207de6
commit
28fffbfce5
2 changed files with 22 additions and 0 deletions
|
|
@ -103,6 +103,25 @@ class KeyVerificationDao extends DatabaseAccessor<TwonlyDB>
|
|||
});
|
||||
}
|
||||
|
||||
Future<int> getTransferredTrustVerificationsCount() async {
|
||||
final kv = keyVerifications;
|
||||
final ur = userDiscoveryUserRelations;
|
||||
|
||||
final query = selectOnly(ur, distinct: true)
|
||||
..addColumns([ur.announcedUserId])
|
||||
..join([
|
||||
innerJoin(contacts, contacts.userId.equalsExp(ur.fromContactId)),
|
||||
innerJoin(kv, kv.contactId.equalsExp(ur.fromContactId)),
|
||||
])
|
||||
..where(
|
||||
ur.publicKeyVerifiedTimestamp.isNotNull() &
|
||||
ur.announcedUserId.equalsExp(ur.fromContactId).not(),
|
||||
);
|
||||
|
||||
final rows = await query.get();
|
||||
return rows.length;
|
||||
}
|
||||
|
||||
Stream<VerificationStatus> watchAllGroupMembersVerified(String groupId) {
|
||||
final gm = groupMembers;
|
||||
final directKv = alias(keyVerifications, 'directKv');
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ Future<void> handleUserStudyUpload() async {
|
|||
final contacts = await twonlyDB.contactsDao.getAllContacts();
|
||||
final verifications = await twonlyDB.keyVerificationDao
|
||||
.getFirstVerificationTypeByContacts();
|
||||
final udVerifiedByContactsCount = await twonlyDB.keyVerificationDao
|
||||
.getTransferredTrustVerificationsCount();
|
||||
|
||||
final udFriendsShared = await twonlyDB.contactsDao
|
||||
.getContactsAnnouncedViaUserDiscovery();
|
||||
|
|
@ -81,6 +83,7 @@ Future<void> handleUserStudyUpload() async {
|
|||
|
||||
'user_study_count_new_friends_via_suggestion':
|
||||
userService.currentUser.userStudyCountNewFriendsViaSuggestion,
|
||||
'user_discovery_count_verified_by_contacts': udVerifiedByContactsCount,
|
||||
|
||||
'accepted_contacts': contacts.where((c) => c.accepted).length,
|
||||
'verified_contacts': verifications.length,
|
||||
|
|
|
|||
Loading…
Reference in a new issue