add user discovery settings view

This commit is contained in:
otsmr 2026-04-19 22:57:24 +02:00
parent cd2a254d23
commit 1629b8b1a9
21 changed files with 13992 additions and 50 deletions

View file

@ -134,6 +134,17 @@ class ContactsDao extends DatabaseAccessor<TwonlyDB> with _$ContactsDaoMixin {
.watch(); .watch();
} }
Stream<List<Contact>> watchContactsAnnouncedViaUserDiscovery() {
return (select(contacts)..where(
(t) =>
t.userDiscoveryVersion.isNotNull() &
t.mediaSendCounter.isBiggerOrEqualValue(
gUser.minimumRequiredImagesExchanged,
),
))
.watch();
}
Stream<List<Contact>> watchAllContacts() { Stream<List<Contact>> watchAllContacts() {
return select(contacts).watch(); return select(contacts).watch();
} }

File diff suppressed because it is too large Load diff

View file

@ -26,6 +26,10 @@ class Contacts extends Table {
// contact_versions: HashMap<UserID, Vec<u8>>, // contact_versions: HashMap<UserID, Vec<u8>>,
BlobColumn get userDiscoveryVersion => blob().nullable()(); BlobColumn get userDiscoveryVersion => blob().nullable()();
IntColumn get mediaSendCounter => integer().withDefault(const Constant(0))();
IntColumn get mediaReceivedCounter =>
integer().withDefault(const Constant(0))();
@override @override
Set<Column> get primaryKey => {userId}; Set<Column> get primaryKey => {userId};
} }

View file

@ -72,7 +72,7 @@ class TwonlyDB extends _$TwonlyDB {
TwonlyDB.forTesting(DatabaseConnection super.connection); TwonlyDB.forTesting(DatabaseConnection super.connection);
@override @override
int get schemaVersion => 12; int get schemaVersion => 13;
static QueryExecutor _openConnection() { static QueryExecutor _openConnection() {
return driftDatabase( return driftDatabase(
@ -181,6 +181,16 @@ class TwonlyDB extends _$TwonlyDB {
schema.contacts.userDiscoveryVersion, schema.contacts.userDiscoveryVersion,
); );
}, },
from12To13: (m, schema) async {
await m.addColumn(
schema.contacts,
schema.contacts.mediaReceivedCounter,
);
await m.addColumn(
schema.contacts,
schema.contacts.mediaSendCounter,
);
},
)(m, from, to); )(m, from, to);
}, },
); );

View file

@ -185,6 +185,29 @@ class $ContactsTable extends Contacts with TableInfo<$ContactsTable, Contact> {
type: DriftSqlType.blob, type: DriftSqlType.blob,
requiredDuringInsert: false, requiredDuringInsert: false,
); );
static const VerificationMeta _mediaSendCounterMeta = const VerificationMeta(
'mediaSendCounter',
);
@override
late final GeneratedColumn<int> mediaSendCounter = GeneratedColumn<int>(
'media_send_counter',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(0),
);
static const VerificationMeta _mediaReceivedCounterMeta =
const VerificationMeta('mediaReceivedCounter');
@override
late final GeneratedColumn<int> mediaReceivedCounter = GeneratedColumn<int>(
'media_received_counter',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(0),
);
@override @override
List<GeneratedColumn> get $columns => [ List<GeneratedColumn> get $columns => [
userId, userId,
@ -201,6 +224,8 @@ class $ContactsTable extends Contacts with TableInfo<$ContactsTable, Contact> {
accountDeleted, accountDeleted,
createdAt, createdAt,
userDiscoveryVersion, userDiscoveryVersion,
mediaSendCounter,
mediaReceivedCounter,
]; ];
@override @override
String get aliasedName => _alias ?? actualTableName; String get aliasedName => _alias ?? actualTableName;
@ -318,6 +343,24 @@ class $ContactsTable extends Contacts with TableInfo<$ContactsTable, Contact> {
), ),
); );
} }
if (data.containsKey('media_send_counter')) {
context.handle(
_mediaSendCounterMeta,
mediaSendCounter.isAcceptableOrUnknown(
data['media_send_counter']!,
_mediaSendCounterMeta,
),
);
}
if (data.containsKey('media_received_counter')) {
context.handle(
_mediaReceivedCounterMeta,
mediaReceivedCounter.isAcceptableOrUnknown(
data['media_received_counter']!,
_mediaReceivedCounterMeta,
),
);
}
return context; return context;
} }
@ -383,6 +426,14 @@ class $ContactsTable extends Contacts with TableInfo<$ContactsTable, Contact> {
DriftSqlType.blob, DriftSqlType.blob,
data['${effectivePrefix}user_discovery_version'], data['${effectivePrefix}user_discovery_version'],
), ),
mediaSendCounter: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}media_send_counter'],
)!,
mediaReceivedCounter: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}media_received_counter'],
)!,
); );
} }
@ -407,6 +458,8 @@ class Contact extends DataClass implements Insertable<Contact> {
final bool accountDeleted; final bool accountDeleted;
final DateTime createdAt; final DateTime createdAt;
final Uint8List? userDiscoveryVersion; final Uint8List? userDiscoveryVersion;
final int mediaSendCounter;
final int mediaReceivedCounter;
const Contact({ const Contact({
required this.userId, required this.userId,
required this.username, required this.username,
@ -422,6 +475,8 @@ class Contact extends DataClass implements Insertable<Contact> {
required this.accountDeleted, required this.accountDeleted,
required this.createdAt, required this.createdAt,
this.userDiscoveryVersion, this.userDiscoveryVersion,
required this.mediaSendCounter,
required this.mediaReceivedCounter,
}); });
@override @override
Map<String, Expression> toColumns(bool nullToAbsent) { Map<String, Expression> toColumns(bool nullToAbsent) {
@ -448,6 +503,8 @@ class Contact extends DataClass implements Insertable<Contact> {
if (!nullToAbsent || userDiscoveryVersion != null) { if (!nullToAbsent || userDiscoveryVersion != null) {
map['user_discovery_version'] = Variable<Uint8List>(userDiscoveryVersion); map['user_discovery_version'] = Variable<Uint8List>(userDiscoveryVersion);
} }
map['media_send_counter'] = Variable<int>(mediaSendCounter);
map['media_received_counter'] = Variable<int>(mediaReceivedCounter);
return map; return map;
} }
@ -475,6 +532,8 @@ class Contact extends DataClass implements Insertable<Contact> {
userDiscoveryVersion: userDiscoveryVersion == null && nullToAbsent userDiscoveryVersion: userDiscoveryVersion == null && nullToAbsent
? const Value.absent() ? const Value.absent()
: Value(userDiscoveryVersion), : Value(userDiscoveryVersion),
mediaSendCounter: Value(mediaSendCounter),
mediaReceivedCounter: Value(mediaReceivedCounter),
); );
} }
@ -504,6 +563,10 @@ class Contact extends DataClass implements Insertable<Contact> {
userDiscoveryVersion: serializer.fromJson<Uint8List?>( userDiscoveryVersion: serializer.fromJson<Uint8List?>(
json['userDiscoveryVersion'], json['userDiscoveryVersion'],
), ),
mediaSendCounter: serializer.fromJson<int>(json['mediaSendCounter']),
mediaReceivedCounter: serializer.fromJson<int>(
json['mediaReceivedCounter'],
),
); );
} }
@override @override
@ -526,6 +589,8 @@ class Contact extends DataClass implements Insertable<Contact> {
'userDiscoveryVersion': serializer.toJson<Uint8List?>( 'userDiscoveryVersion': serializer.toJson<Uint8List?>(
userDiscoveryVersion, userDiscoveryVersion,
), ),
'mediaSendCounter': serializer.toJson<int>(mediaSendCounter),
'mediaReceivedCounter': serializer.toJson<int>(mediaReceivedCounter),
}; };
} }
@ -544,6 +609,8 @@ class Contact extends DataClass implements Insertable<Contact> {
bool? accountDeleted, bool? accountDeleted,
DateTime? createdAt, DateTime? createdAt,
Value<Uint8List?> userDiscoveryVersion = const Value.absent(), Value<Uint8List?> userDiscoveryVersion = const Value.absent(),
int? mediaSendCounter,
int? mediaReceivedCounter,
}) => Contact( }) => Contact(
userId: userId ?? this.userId, userId: userId ?? this.userId,
username: username ?? this.username, username: username ?? this.username,
@ -563,6 +630,8 @@ class Contact extends DataClass implements Insertable<Contact> {
userDiscoveryVersion: userDiscoveryVersion.present userDiscoveryVersion: userDiscoveryVersion.present
? userDiscoveryVersion.value ? userDiscoveryVersion.value
: this.userDiscoveryVersion, : this.userDiscoveryVersion,
mediaSendCounter: mediaSendCounter ?? this.mediaSendCounter,
mediaReceivedCounter: mediaReceivedCounter ?? this.mediaReceivedCounter,
); );
Contact copyWithCompanion(ContactsCompanion data) { Contact copyWithCompanion(ContactsCompanion data) {
return Contact( return Contact(
@ -592,6 +661,12 @@ class Contact extends DataClass implements Insertable<Contact> {
userDiscoveryVersion: data.userDiscoveryVersion.present userDiscoveryVersion: data.userDiscoveryVersion.present
? data.userDiscoveryVersion.value ? data.userDiscoveryVersion.value
: this.userDiscoveryVersion, : this.userDiscoveryVersion,
mediaSendCounter: data.mediaSendCounter.present
? data.mediaSendCounter.value
: this.mediaSendCounter,
mediaReceivedCounter: data.mediaReceivedCounter.present
? data.mediaReceivedCounter.value
: this.mediaReceivedCounter,
); );
} }
@ -611,7 +686,9 @@ class Contact extends DataClass implements Insertable<Contact> {
..write('verified: $verified, ') ..write('verified: $verified, ')
..write('accountDeleted: $accountDeleted, ') ..write('accountDeleted: $accountDeleted, ')
..write('createdAt: $createdAt, ') ..write('createdAt: $createdAt, ')
..write('userDiscoveryVersion: $userDiscoveryVersion') ..write('userDiscoveryVersion: $userDiscoveryVersion, ')
..write('mediaSendCounter: $mediaSendCounter, ')
..write('mediaReceivedCounter: $mediaReceivedCounter')
..write(')')) ..write(')'))
.toString(); .toString();
} }
@ -632,6 +709,8 @@ class Contact extends DataClass implements Insertable<Contact> {
accountDeleted, accountDeleted,
createdAt, createdAt,
$driftBlobEquality.hash(userDiscoveryVersion), $driftBlobEquality.hash(userDiscoveryVersion),
mediaSendCounter,
mediaReceivedCounter,
); );
@override @override
bool operator ==(Object other) => bool operator ==(Object other) =>
@ -656,7 +735,9 @@ class Contact extends DataClass implements Insertable<Contact> {
$driftBlobEquality.equals( $driftBlobEquality.equals(
other.userDiscoveryVersion, other.userDiscoveryVersion,
this.userDiscoveryVersion, this.userDiscoveryVersion,
)); ) &&
other.mediaSendCounter == this.mediaSendCounter &&
other.mediaReceivedCounter == this.mediaReceivedCounter);
} }
class ContactsCompanion extends UpdateCompanion<Contact> { class ContactsCompanion extends UpdateCompanion<Contact> {
@ -674,6 +755,8 @@ class ContactsCompanion extends UpdateCompanion<Contact> {
final Value<bool> accountDeleted; final Value<bool> accountDeleted;
final Value<DateTime> createdAt; final Value<DateTime> createdAt;
final Value<Uint8List?> userDiscoveryVersion; final Value<Uint8List?> userDiscoveryVersion;
final Value<int> mediaSendCounter;
final Value<int> mediaReceivedCounter;
const ContactsCompanion({ const ContactsCompanion({
this.userId = const Value.absent(), this.userId = const Value.absent(),
this.username = const Value.absent(), this.username = const Value.absent(),
@ -689,6 +772,8 @@ class ContactsCompanion extends UpdateCompanion<Contact> {
this.accountDeleted = const Value.absent(), this.accountDeleted = const Value.absent(),
this.createdAt = const Value.absent(), this.createdAt = const Value.absent(),
this.userDiscoveryVersion = const Value.absent(), this.userDiscoveryVersion = const Value.absent(),
this.mediaSendCounter = const Value.absent(),
this.mediaReceivedCounter = const Value.absent(),
}); });
ContactsCompanion.insert({ ContactsCompanion.insert({
this.userId = const Value.absent(), this.userId = const Value.absent(),
@ -705,6 +790,8 @@ class ContactsCompanion extends UpdateCompanion<Contact> {
this.accountDeleted = const Value.absent(), this.accountDeleted = const Value.absent(),
this.createdAt = const Value.absent(), this.createdAt = const Value.absent(),
this.userDiscoveryVersion = const Value.absent(), this.userDiscoveryVersion = const Value.absent(),
this.mediaSendCounter = const Value.absent(),
this.mediaReceivedCounter = const Value.absent(),
}) : username = Value(username); }) : username = Value(username);
static Insertable<Contact> custom({ static Insertable<Contact> custom({
Expression<int>? userId, Expression<int>? userId,
@ -721,6 +808,8 @@ class ContactsCompanion extends UpdateCompanion<Contact> {
Expression<bool>? accountDeleted, Expression<bool>? accountDeleted,
Expression<DateTime>? createdAt, Expression<DateTime>? createdAt,
Expression<Uint8List>? userDiscoveryVersion, Expression<Uint8List>? userDiscoveryVersion,
Expression<int>? mediaSendCounter,
Expression<int>? mediaReceivedCounter,
}) { }) {
return RawValuesInsertable({ return RawValuesInsertable({
if (userId != null) 'user_id': userId, if (userId != null) 'user_id': userId,
@ -740,6 +829,9 @@ class ContactsCompanion extends UpdateCompanion<Contact> {
if (createdAt != null) 'created_at': createdAt, if (createdAt != null) 'created_at': createdAt,
if (userDiscoveryVersion != null) if (userDiscoveryVersion != null)
'user_discovery_version': userDiscoveryVersion, 'user_discovery_version': userDiscoveryVersion,
if (mediaSendCounter != null) 'media_send_counter': mediaSendCounter,
if (mediaReceivedCounter != null)
'media_received_counter': mediaReceivedCounter,
}); });
} }
@ -758,6 +850,8 @@ class ContactsCompanion extends UpdateCompanion<Contact> {
Value<bool>? accountDeleted, Value<bool>? accountDeleted,
Value<DateTime>? createdAt, Value<DateTime>? createdAt,
Value<Uint8List?>? userDiscoveryVersion, Value<Uint8List?>? userDiscoveryVersion,
Value<int>? mediaSendCounter,
Value<int>? mediaReceivedCounter,
}) { }) {
return ContactsCompanion( return ContactsCompanion(
userId: userId ?? this.userId, userId: userId ?? this.userId,
@ -774,6 +868,8 @@ class ContactsCompanion extends UpdateCompanion<Contact> {
accountDeleted: accountDeleted ?? this.accountDeleted, accountDeleted: accountDeleted ?? this.accountDeleted,
createdAt: createdAt ?? this.createdAt, createdAt: createdAt ?? this.createdAt,
userDiscoveryVersion: userDiscoveryVersion ?? this.userDiscoveryVersion, userDiscoveryVersion: userDiscoveryVersion ?? this.userDiscoveryVersion,
mediaSendCounter: mediaSendCounter ?? this.mediaSendCounter,
mediaReceivedCounter: mediaReceivedCounter ?? this.mediaReceivedCounter,
); );
} }
@ -826,6 +922,12 @@ class ContactsCompanion extends UpdateCompanion<Contact> {
userDiscoveryVersion.value, userDiscoveryVersion.value,
); );
} }
if (mediaSendCounter.present) {
map['media_send_counter'] = Variable<int>(mediaSendCounter.value);
}
if (mediaReceivedCounter.present) {
map['media_received_counter'] = Variable<int>(mediaReceivedCounter.value);
}
return map; return map;
} }
@ -845,7 +947,9 @@ class ContactsCompanion extends UpdateCompanion<Contact> {
..write('verified: $verified, ') ..write('verified: $verified, ')
..write('accountDeleted: $accountDeleted, ') ..write('accountDeleted: $accountDeleted, ')
..write('createdAt: $createdAt, ') ..write('createdAt: $createdAt, ')
..write('userDiscoveryVersion: $userDiscoveryVersion') ..write('userDiscoveryVersion: $userDiscoveryVersion, ')
..write('mediaSendCounter: $mediaSendCounter, ')
..write('mediaReceivedCounter: $mediaReceivedCounter')
..write(')')) ..write(')'))
.toString(); .toString();
} }
@ -11241,6 +11345,8 @@ typedef $$ContactsTableCreateCompanionBuilder =
Value<bool> accountDeleted, Value<bool> accountDeleted,
Value<DateTime> createdAt, Value<DateTime> createdAt,
Value<Uint8List?> userDiscoveryVersion, Value<Uint8List?> userDiscoveryVersion,
Value<int> mediaSendCounter,
Value<int> mediaReceivedCounter,
}); });
typedef $$ContactsTableUpdateCompanionBuilder = typedef $$ContactsTableUpdateCompanionBuilder =
ContactsCompanion Function({ ContactsCompanion Function({
@ -11258,6 +11364,8 @@ typedef $$ContactsTableUpdateCompanionBuilder =
Value<bool> accountDeleted, Value<bool> accountDeleted,
Value<DateTime> createdAt, Value<DateTime> createdAt,
Value<Uint8List?> userDiscoveryVersion, Value<Uint8List?> userDiscoveryVersion,
Value<int> mediaSendCounter,
Value<int> mediaReceivedCounter,
}); });
final class $$ContactsTableReferences final class $$ContactsTableReferences
@ -11632,6 +11740,16 @@ class $$ContactsTableFilterComposer
builder: (column) => ColumnFilters(column), builder: (column) => ColumnFilters(column),
); );
ColumnFilters<int> get mediaSendCounter => $composableBuilder(
column: $table.mediaSendCounter,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get mediaReceivedCounter => $composableBuilder(
column: $table.mediaReceivedCounter,
builder: (column) => ColumnFilters(column),
);
Expression<bool> messagesRefs( Expression<bool> messagesRefs(
Expression<bool> Function($$MessagesTableFilterComposer f) f, Expression<bool> Function($$MessagesTableFilterComposer f) f,
) { ) {
@ -12019,6 +12137,16 @@ class $$ContactsTableOrderingComposer
column: $table.userDiscoveryVersion, column: $table.userDiscoveryVersion,
builder: (column) => ColumnOrderings(column), builder: (column) => ColumnOrderings(column),
); );
ColumnOrderings<int> get mediaSendCounter => $composableBuilder(
column: $table.mediaSendCounter,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get mediaReceivedCounter => $composableBuilder(
column: $table.mediaReceivedCounter,
builder: (column) => ColumnOrderings(column),
);
} }
class $$ContactsTableAnnotationComposer class $$ContactsTableAnnotationComposer
@ -12084,6 +12212,16 @@ class $$ContactsTableAnnotationComposer
builder: (column) => column, builder: (column) => column,
); );
GeneratedColumn<int> get mediaSendCounter => $composableBuilder(
column: $table.mediaSendCounter,
builder: (column) => column,
);
GeneratedColumn<int> get mediaReceivedCounter => $composableBuilder(
column: $table.mediaReceivedCounter,
builder: (column) => column,
);
Expression<T> messagesRefs<T extends Object>( Expression<T> messagesRefs<T extends Object>(
Expression<T> Function($$MessagesTableAnnotationComposer a) f, Expression<T> Function($$MessagesTableAnnotationComposer a) f,
) { ) {
@ -12453,6 +12591,8 @@ class $$ContactsTableTableManager
Value<bool> accountDeleted = const Value.absent(), Value<bool> accountDeleted = const Value.absent(),
Value<DateTime> createdAt = const Value.absent(), Value<DateTime> createdAt = const Value.absent(),
Value<Uint8List?> userDiscoveryVersion = const Value.absent(), Value<Uint8List?> userDiscoveryVersion = const Value.absent(),
Value<int> mediaSendCounter = const Value.absent(),
Value<int> mediaReceivedCounter = const Value.absent(),
}) => ContactsCompanion( }) => ContactsCompanion(
userId: userId, userId: userId,
username: username, username: username,
@ -12468,6 +12608,8 @@ class $$ContactsTableTableManager
accountDeleted: accountDeleted, accountDeleted: accountDeleted,
createdAt: createdAt, createdAt: createdAt,
userDiscoveryVersion: userDiscoveryVersion, userDiscoveryVersion: userDiscoveryVersion,
mediaSendCounter: mediaSendCounter,
mediaReceivedCounter: mediaReceivedCounter,
), ),
createCompanionCallback: createCompanionCallback:
({ ({
@ -12485,6 +12627,8 @@ class $$ContactsTableTableManager
Value<bool> accountDeleted = const Value.absent(), Value<bool> accountDeleted = const Value.absent(),
Value<DateTime> createdAt = const Value.absent(), Value<DateTime> createdAt = const Value.absent(),
Value<Uint8List?> userDiscoveryVersion = const Value.absent(), Value<Uint8List?> userDiscoveryVersion = const Value.absent(),
Value<int> mediaSendCounter = const Value.absent(),
Value<int> mediaReceivedCounter = const Value.absent(),
}) => ContactsCompanion.insert( }) => ContactsCompanion.insert(
userId: userId, userId: userId,
username: username, username: username,
@ -12500,6 +12644,8 @@ class $$ContactsTableTableManager
accountDeleted: accountDeleted, accountDeleted: accountDeleted,
createdAt: createdAt, createdAt: createdAt,
userDiscoveryVersion: userDiscoveryVersion, userDiscoveryVersion: userDiscoveryVersion,
mediaSendCounter: mediaSendCounter,
mediaReceivedCounter: mediaReceivedCounter,
), ),
withReferenceMapper: (p0) => p0 withReferenceMapper: (p0) => p0
.map( .map(

View file

@ -6479,6 +6479,459 @@ i1.GeneratedColumn<i2.Uint8List> _column_227(String aliasedName) =>
type: i1.DriftSqlType.blob, type: i1.DriftSqlType.blob,
$customConstraints: 'NOT NULL', $customConstraints: 'NOT NULL',
); );
final class Schema13 extends i0.VersionedSchema {
Schema13({required super.database}) : super(version: 13);
@override
late final List<i1.DatabaseSchemaEntity> entities = [
contacts,
groups,
mediaFiles,
messages,
messageHistories,
reactions,
groupMembers,
receipts,
receivedReceipts,
signalIdentityKeyStores,
signalPreKeyStores,
signalSenderKeyStores,
signalSessionStores,
messageActions,
groupHistories,
keyVerifications,
verificationTokens,
userDiscoveryAnnouncedUsers,
userDiscoveryUserRelations,
userDiscoveryOtherPromotions,
userDiscoveryOwnPromotions,
userDiscoveryShares,
];
late final Shape47 contacts = Shape47(
source: i0.VersionedTable(
entityName: 'contacts',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(user_id)'],
columns: [
_column_106,
_column_107,
_column_108,
_column_109,
_column_110,
_column_111,
_column_112,
_column_113,
_column_114,
_column_115,
_column_116,
_column_117,
_column_118,
_column_211,
_column_228,
_column_229,
],
attachedDatabase: database,
),
alias: null,
);
late final Shape23 groups = Shape23(
source: i0.VersionedTable(
entityName: 'groups',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(group_id)'],
columns: [
_column_119,
_column_120,
_column_121,
_column_122,
_column_123,
_column_124,
_column_125,
_column_126,
_column_127,
_column_128,
_column_129,
_column_130,
_column_131,
_column_132,
_column_133,
_column_134,
_column_118,
_column_135,
_column_136,
_column_137,
_column_138,
_column_139,
_column_140,
_column_141,
_column_142,
],
attachedDatabase: database,
),
alias: null,
);
late final Shape36 mediaFiles = Shape36(
source: i0.VersionedTable(
entityName: 'media_files',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(media_id)'],
columns: [
_column_143,
_column_144,
_column_145,
_column_146,
_column_147,
_column_148,
_column_149,
_column_207,
_column_150,
_column_151,
_column_152,
_column_153,
_column_154,
_column_155,
_column_156,
_column_157,
_column_118,
],
attachedDatabase: database,
),
alias: null,
);
late final Shape25 messages = Shape25(
source: i0.VersionedTable(
entityName: 'messages',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(message_id)'],
columns: [
_column_158,
_column_159,
_column_160,
_column_144,
_column_161,
_column_162,
_column_163,
_column_164,
_column_165,
_column_153,
_column_166,
_column_167,
_column_168,
_column_169,
_column_118,
_column_170,
_column_171,
_column_172,
],
attachedDatabase: database,
),
alias: null,
);
late final Shape26 messageHistories = Shape26(
source: i0.VersionedTable(
entityName: 'message_histories',
withoutRowId: false,
isStrict: false,
tableConstraints: [],
columns: [
_column_173,
_column_174,
_column_175,
_column_161,
_column_118,
],
attachedDatabase: database,
),
alias: null,
);
late final Shape27 reactions = Shape27(
source: i0.VersionedTable(
entityName: 'reactions',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(message_id, sender_id, emoji)'],
columns: [_column_174, _column_176, _column_177, _column_118],
attachedDatabase: database,
),
alias: null,
);
late final Shape38 groupMembers = Shape38(
source: i0.VersionedTable(
entityName: 'group_members',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(group_id, contact_id)'],
columns: [
_column_158,
_column_178,
_column_179,
_column_180,
_column_209,
_column_210,
_column_181,
_column_118,
],
attachedDatabase: database,
),
alias: null,
);
late final Shape37 receipts = Shape37(
source: i0.VersionedTable(
entityName: 'receipts',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(receipt_id)'],
columns: [
_column_182,
_column_183,
_column_184,
_column_185,
_column_186,
_column_208,
_column_187,
_column_188,
_column_189,
_column_190,
_column_191,
_column_118,
],
attachedDatabase: database,
),
alias: null,
);
late final Shape30 receivedReceipts = Shape30(
source: i0.VersionedTable(
entityName: 'received_receipts',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(receipt_id)'],
columns: [_column_182, _column_118],
attachedDatabase: database,
),
alias: null,
);
late final Shape31 signalIdentityKeyStores = Shape31(
source: i0.VersionedTable(
entityName: 'signal_identity_key_stores',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(device_id, name)'],
columns: [_column_192, _column_193, _column_194, _column_118],
attachedDatabase: database,
),
alias: null,
);
late final Shape32 signalPreKeyStores = Shape32(
source: i0.VersionedTable(
entityName: 'signal_pre_key_stores',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(pre_key_id)'],
columns: [_column_195, _column_196, _column_118],
attachedDatabase: database,
),
alias: null,
);
late final Shape11 signalSenderKeyStores = Shape11(
source: i0.VersionedTable(
entityName: 'signal_sender_key_stores',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(sender_key_name)'],
columns: [_column_197, _column_198],
attachedDatabase: database,
),
alias: null,
);
late final Shape33 signalSessionStores = Shape33(
source: i0.VersionedTable(
entityName: 'signal_session_stores',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(device_id, name)'],
columns: [_column_192, _column_193, _column_199, _column_118],
attachedDatabase: database,
),
alias: null,
);
late final Shape34 messageActions = Shape34(
source: i0.VersionedTable(
entityName: 'message_actions',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(message_id, contact_id, type)'],
columns: [_column_174, _column_183, _column_144, _column_200],
attachedDatabase: database,
),
alias: null,
);
late final Shape35 groupHistories = Shape35(
source: i0.VersionedTable(
entityName: 'group_histories',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(group_history_id)'],
columns: [
_column_201,
_column_158,
_column_202,
_column_203,
_column_204,
_column_205,
_column_206,
_column_144,
_column_200,
],
attachedDatabase: database,
),
alias: null,
);
late final Shape40 keyVerifications = Shape40(
source: i0.VersionedTable(
entityName: 'key_verifications',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(contact_id)'],
columns: [_column_183, _column_144, _column_118],
attachedDatabase: database,
),
alias: null,
);
late final Shape41 verificationTokens = Shape41(
source: i0.VersionedTable(
entityName: 'verification_tokens',
withoutRowId: false,
isStrict: false,
tableConstraints: [],
columns: [_column_212, _column_213, _column_118],
attachedDatabase: database,
),
alias: null,
);
late final Shape42 userDiscoveryAnnouncedUsers = Shape42(
source: i0.VersionedTable(
entityName: 'user_discovery_announced_users',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(announced_user_id)'],
columns: [_column_214, _column_215, _column_216],
attachedDatabase: database,
),
alias: null,
);
late final Shape43 userDiscoveryUserRelations = Shape43(
source: i0.VersionedTable(
entityName: 'user_discovery_user_relations',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(announced_user_id, from_contact_id)'],
columns: [_column_217, _column_218, _column_219],
attachedDatabase: database,
),
alias: null,
);
late final Shape44 userDiscoveryOtherPromotions = Shape44(
source: i0.VersionedTable(
entityName: 'user_discovery_other_promotions',
withoutRowId: false,
isStrict: false,
tableConstraints: ['PRIMARY KEY(from_contact_id, promotion_id)'],
columns: [
_column_218,
_column_220,
_column_221,
_column_222,
_column_223,
_column_219,
],
attachedDatabase: database,
),
alias: null,
);
late final Shape45 userDiscoveryOwnPromotions = Shape45(
source: i0.VersionedTable(
entityName: 'user_discovery_own_promotions',
withoutRowId: false,
isStrict: false,
tableConstraints: [],
columns: [_column_224, _column_183, _column_225],
attachedDatabase: database,
),
alias: null,
);
late final Shape46 userDiscoveryShares = Shape46(
source: i0.VersionedTable(
entityName: 'user_discovery_shares',
withoutRowId: false,
isStrict: false,
tableConstraints: [],
columns: [_column_226, _column_227, _column_175],
attachedDatabase: database,
),
alias: null,
);
}
class Shape47 extends i0.VersionedTable {
Shape47({required super.source, required super.alias}) : super.aliased();
i1.GeneratedColumn<int> get userId =>
columnsByName['user_id']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<String> get username =>
columnsByName['username']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<String> get displayName =>
columnsByName['display_name']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<String> get nickName =>
columnsByName['nick_name']! as i1.GeneratedColumn<String>;
i1.GeneratedColumn<i2.Uint8List> get avatarSvgCompressed =>
columnsByName['avatar_svg_compressed']!
as i1.GeneratedColumn<i2.Uint8List>;
i1.GeneratedColumn<int> get senderProfileCounter =>
columnsByName['sender_profile_counter']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get accepted =>
columnsByName['accepted']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get deletedByUser =>
columnsByName['deleted_by_user']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get requested =>
columnsByName['requested']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get blocked =>
columnsByName['blocked']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get verified =>
columnsByName['verified']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get accountDeleted =>
columnsByName['account_deleted']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get createdAt =>
columnsByName['created_at']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<i2.Uint8List> get userDiscoveryVersion =>
columnsByName['user_discovery_version']!
as i1.GeneratedColumn<i2.Uint8List>;
i1.GeneratedColumn<int> get mediaSendCounter =>
columnsByName['media_send_counter']! as i1.GeneratedColumn<int>;
i1.GeneratedColumn<int> get mediaReceivedCounter =>
columnsByName['media_received_counter']! as i1.GeneratedColumn<int>;
}
i1.GeneratedColumn<int> _column_228(String aliasedName) =>
i1.GeneratedColumn<int>(
'media_send_counter',
aliasedName,
false,
type: i1.DriftSqlType.int,
$customConstraints: 'NOT NULL DEFAULT 0',
defaultValue: const i1.CustomExpression('0'),
);
i1.GeneratedColumn<int> _column_229(String aliasedName) =>
i1.GeneratedColumn<int>(
'media_received_counter',
aliasedName,
false,
type: i1.DriftSqlType.int,
$customConstraints: 'NOT NULL DEFAULT 0',
defaultValue: const i1.CustomExpression('0'),
);
i0.MigrationStepWithVersion migrationSteps({ i0.MigrationStepWithVersion migrationSteps({
required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2, required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2,
required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3, required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3,
@ -6491,6 +6944,7 @@ i0.MigrationStepWithVersion migrationSteps({
required Future<void> Function(i1.Migrator m, Schema10 schema) from9To10, required Future<void> Function(i1.Migrator m, Schema10 schema) from9To10,
required Future<void> Function(i1.Migrator m, Schema11 schema) from10To11, required Future<void> Function(i1.Migrator m, Schema11 schema) from10To11,
required Future<void> Function(i1.Migrator m, Schema12 schema) from11To12, required Future<void> Function(i1.Migrator m, Schema12 schema) from11To12,
required Future<void> Function(i1.Migrator m, Schema13 schema) from12To13,
}) { }) {
return (currentVersion, database) async { return (currentVersion, database) async {
switch (currentVersion) { switch (currentVersion) {
@ -6549,6 +7003,11 @@ i0.MigrationStepWithVersion migrationSteps({
final migrator = i1.Migrator(database, schema); final migrator = i1.Migrator(database, schema);
await from11To12(migrator, schema); await from11To12(migrator, schema);
return 12; return 12;
case 12:
final schema = Schema13(database: database);
final migrator = i1.Migrator(database, schema);
await from12To13(migrator, schema);
return 13;
default: default:
throw ArgumentError.value('Unknown migration from $currentVersion'); throw ArgumentError.value('Unknown migration from $currentVersion');
} }
@ -6567,6 +7026,7 @@ i1.OnUpgrade stepByStep({
required Future<void> Function(i1.Migrator m, Schema10 schema) from9To10, required Future<void> Function(i1.Migrator m, Schema10 schema) from9To10,
required Future<void> Function(i1.Migrator m, Schema11 schema) from10To11, required Future<void> Function(i1.Migrator m, Schema11 schema) from10To11,
required Future<void> Function(i1.Migrator m, Schema12 schema) from11To12, required Future<void> Function(i1.Migrator m, Schema12 schema) from11To12,
required Future<void> Function(i1.Migrator m, Schema13 schema) from12To13,
}) => i0.VersionedSchema.stepByStepHelper( }) => i0.VersionedSchema.stepByStepHelper(
step: migrationSteps( step: migrationSteps(
from1To2: from1To2, from1To2: from1To2,
@ -6580,5 +7040,6 @@ i1.OnUpgrade stepByStep({
from9To10: from9To10, from9To10: from9To10,
from10To11: from10To11, from10To11: from10To11,
from11To12: from11To12, from11To12: from11To12,
from12To13: from12To13,
), ),
); );

View file

@ -96,9 +96,12 @@ class UserData {
@JsonKey(defaultValue: false) @JsonKey(defaultValue: false)
bool isUserDiscoveryEnabled = false; bool isUserDiscoveryEnabled = false;
@JsonKey(defaultValue: false) @JsonKey(defaultValue: 4)
int minimumRequiredImagesExchanged = 4; int minimumRequiredImagesExchanged = 4;
@JsonKey(defaultValue: 2)
int userDiscoveryThreshold = 2;
// -- Custom DATA -- // -- Custom DATA --
@JsonKey(defaultValue: 100_000) @JsonKey(defaultValue: 100_000)

View file

@ -63,6 +63,10 @@ UserData _$UserDataFromJson(Map<String, dynamic> json) =>
..screenLockEnabled = json['screenLockEnabled'] as bool? ?? false ..screenLockEnabled = json['screenLockEnabled'] as bool? ?? false
..isUserDiscoveryEnabled = ..isUserDiscoveryEnabled =
json['isUserDiscoveryEnabled'] as bool? ?? false json['isUserDiscoveryEnabled'] as bool? ?? false
..minimumRequiredImagesExchanged =
(json['minimumRequiredImagesExchanged'] as num?)?.toInt() ?? 4
..userDiscoveryThreshold =
(json['userDiscoveryThreshold'] as num?)?.toInt() ?? 2
..currentPreKeyIndexStart = ..currentPreKeyIndexStart =
(json['currentPreKeyIndexStart'] as num?)?.toInt() ?? 100000 (json['currentPreKeyIndexStart'] as num?)?.toInt() ?? 100000
..currentSignedPreKeyIndexStart = ..currentSignedPreKeyIndexStart =
@ -126,6 +130,8 @@ Map<String, dynamic> _$UserDataToJson(UserData instance) => <String, dynamic>{
'allowErrorTrackingViaSentry': instance.allowErrorTrackingViaSentry, 'allowErrorTrackingViaSentry': instance.allowErrorTrackingViaSentry,
'screenLockEnabled': instance.screenLockEnabled, 'screenLockEnabled': instance.screenLockEnabled,
'isUserDiscoveryEnabled': instance.isUserDiscoveryEnabled, 'isUserDiscoveryEnabled': instance.isUserDiscoveryEnabled,
'minimumRequiredImagesExchanged': instance.minimumRequiredImagesExchanged,
'userDiscoveryThreshold': instance.userDiscoveryThreshold,
'currentPreKeyIndexStart': instance.currentPreKeyIndexStart, 'currentPreKeyIndexStart': instance.currentPreKeyIndexStart,
'currentSignedPreKeyIndexStart': instance.currentSignedPreKeyIndexStart, 'currentSignedPreKeyIndexStart': instance.currentSignedPreKeyIndexStart,
'lastChangeLogHash': instance.lastChangeLogHash, 'lastChangeLogHash': instance.lastChangeLogHash,

View file

@ -0,0 +1,695 @@
// This is a generated file - do not edit.
//
// Generated from types.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names
import 'dart:core' as $core;
import 'package:fixnum/fixnum.dart' as $fixnum;
import 'package:protobuf/protobuf.dart' as $pb;
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
class UserDiscoveryVersion extends $pb.GeneratedMessage {
factory UserDiscoveryVersion({
$core.int? announcement,
$core.int? promotion,
}) {
final result = create();
if (announcement != null) result.announcement = announcement;
if (promotion != null) result.promotion = promotion;
return result;
}
UserDiscoveryVersion._();
factory UserDiscoveryVersion.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory UserDiscoveryVersion.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'UserDiscoveryVersion',
package: const $pb.PackageName(_omitMessageNames ? '' : 'user_discovery'),
createEmptyInstance: create)
..a<$core.int>(
1, _omitFieldNames ? '' : 'announcement', $pb.PbFieldType.OU3)
..a<$core.int>(2, _omitFieldNames ? '' : 'promotion', $pb.PbFieldType.OU3)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryVersion clone() =>
UserDiscoveryVersion()..mergeFromMessage(this);
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryVersion copyWith(void Function(UserDiscoveryVersion) updates) =>
super.copyWith((message) => updates(message as UserDiscoveryVersion))
as UserDiscoveryVersion;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UserDiscoveryVersion create() => UserDiscoveryVersion._();
@$core.override
UserDiscoveryVersion createEmptyInstance() => create();
static $pb.PbList<UserDiscoveryVersion> createRepeated() =>
$pb.PbList<UserDiscoveryVersion>();
@$core.pragma('dart2js:noInline')
static UserDiscoveryVersion getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<UserDiscoveryVersion>(create);
static UserDiscoveryVersion? _defaultInstance;
@$pb.TagNumber(1)
$core.int get announcement => $_getIZ(0);
@$pb.TagNumber(1)
set announcement($core.int value) => $_setUnsignedInt32(0, value);
@$pb.TagNumber(1)
$core.bool hasAnnouncement() => $_has(0);
@$pb.TagNumber(1)
void clearAnnouncement() => $_clearField(1);
@$pb.TagNumber(2)
$core.int get promotion => $_getIZ(1);
@$pb.TagNumber(2)
set promotion($core.int value) => $_setUnsignedInt32(1, value);
@$pb.TagNumber(2)
$core.bool hasPromotion() => $_has(1);
@$pb.TagNumber(2)
void clearPromotion() => $_clearField(2);
}
class UserDiscoveryMessage_UserDiscoveryAnnouncement
extends $pb.GeneratedMessage {
factory UserDiscoveryMessage_UserDiscoveryAnnouncement({
$fixnum.Int64? publicId,
$core.int? threshold,
$core.List<$core.int>? announcementShare,
$core.Iterable<$core.List<$core.int>>? verificationShares,
}) {
final result = create();
if (publicId != null) result.publicId = publicId;
if (threshold != null) result.threshold = threshold;
if (announcementShare != null) result.announcementShare = announcementShare;
if (verificationShares != null)
result.verificationShares.addAll(verificationShares);
return result;
}
UserDiscoveryMessage_UserDiscoveryAnnouncement._();
factory UserDiscoveryMessage_UserDiscoveryAnnouncement.fromBuffer(
$core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory UserDiscoveryMessage_UserDiscoveryAnnouncement.fromJson(
$core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'UserDiscoveryMessage.UserDiscoveryAnnouncement',
package: const $pb.PackageName(_omitMessageNames ? '' : 'user_discovery'),
createEmptyInstance: create)
..aInt64(1, _omitFieldNames ? '' : 'publicId')
..a<$core.int>(2, _omitFieldNames ? '' : 'threshold', $pb.PbFieldType.OU3)
..a<$core.List<$core.int>>(
4, _omitFieldNames ? '' : 'announcementShare', $pb.PbFieldType.OY)
..p<$core.List<$core.int>>(
6, _omitFieldNames ? '' : 'verificationShares', $pb.PbFieldType.PY)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage_UserDiscoveryAnnouncement clone() =>
UserDiscoveryMessage_UserDiscoveryAnnouncement()..mergeFromMessage(this);
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage_UserDiscoveryAnnouncement copyWith(
void Function(UserDiscoveryMessage_UserDiscoveryAnnouncement)
updates) =>
super.copyWith((message) => updates(
message as UserDiscoveryMessage_UserDiscoveryAnnouncement))
as UserDiscoveryMessage_UserDiscoveryAnnouncement;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage_UserDiscoveryAnnouncement create() =>
UserDiscoveryMessage_UserDiscoveryAnnouncement._();
@$core.override
UserDiscoveryMessage_UserDiscoveryAnnouncement createEmptyInstance() =>
create();
static $pb.PbList<UserDiscoveryMessage_UserDiscoveryAnnouncement>
createRepeated() =>
$pb.PbList<UserDiscoveryMessage_UserDiscoveryAnnouncement>();
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage_UserDiscoveryAnnouncement getDefault() =>
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<
UserDiscoveryMessage_UserDiscoveryAnnouncement>(create);
static UserDiscoveryMessage_UserDiscoveryAnnouncement? _defaultInstance;
@$pb.TagNumber(1)
$fixnum.Int64 get publicId => $_getI64(0);
@$pb.TagNumber(1)
set publicId($fixnum.Int64 value) => $_setInt64(0, value);
@$pb.TagNumber(1)
$core.bool hasPublicId() => $_has(0);
@$pb.TagNumber(1)
void clearPublicId() => $_clearField(1);
@$pb.TagNumber(2)
$core.int get threshold => $_getIZ(1);
@$pb.TagNumber(2)
set threshold($core.int value) => $_setUnsignedInt32(1, value);
@$pb.TagNumber(2)
$core.bool hasThreshold() => $_has(1);
@$pb.TagNumber(2)
void clearThreshold() => $_clearField(2);
@$pb.TagNumber(4)
$core.List<$core.int> get announcementShare => $_getN(2);
@$pb.TagNumber(4)
set announcementShare($core.List<$core.int> value) => $_setBytes(2, value);
@$pb.TagNumber(4)
$core.bool hasAnnouncementShare() => $_has(2);
@$pb.TagNumber(4)
void clearAnnouncementShare() => $_clearField(4);
@$pb.TagNumber(6)
$pb.PbList<$core.List<$core.int>> get verificationShares => $_getList(3);
}
class UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData
extends $pb.GeneratedMessage {
factory UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData({
$fixnum.Int64? publicId,
$fixnum.Int64? userId,
$core.List<$core.int>? publicKey,
}) {
final result = create();
if (publicId != null) result.publicId = publicId;
if (userId != null) result.userId = userId;
if (publicKey != null) result.publicKey = publicKey;
return result;
}
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData._();
factory UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData.fromBuffer(
$core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData.fromJson(
$core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames
? ''
: 'UserDiscoveryMessage.UserDiscoveryPromotion.AnnouncementShareDecrypted.SignedData',
package: const $pb.PackageName(_omitMessageNames ? '' : 'user_discovery'),
createEmptyInstance: create)
..aInt64(1, _omitFieldNames ? '' : 'publicId')
..aInt64(2, _omitFieldNames ? '' : 'userId')
..a<$core.List<$core.int>>(
3, _omitFieldNames ? '' : 'publicKey', $pb.PbFieldType.OY)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData
clone() =>
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData()
..mergeFromMessage(this);
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData copyWith(
void Function(
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData)
updates) =>
super.copyWith((message) => updates(message
as UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData))
as UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData
create() =>
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData
._();
@$core.override
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData
createEmptyInstance() => create();
static $pb.PbList<
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData>
createRepeated() => $pb.PbList<
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData>();
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData
getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData>(
create);
static UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData?
_defaultInstance;
@$pb.TagNumber(1)
$fixnum.Int64 get publicId => $_getI64(0);
@$pb.TagNumber(1)
set publicId($fixnum.Int64 value) => $_setInt64(0, value);
@$pb.TagNumber(1)
$core.bool hasPublicId() => $_has(0);
@$pb.TagNumber(1)
void clearPublicId() => $_clearField(1);
@$pb.TagNumber(2)
$fixnum.Int64 get userId => $_getI64(1);
@$pb.TagNumber(2)
set userId($fixnum.Int64 value) => $_setInt64(1, value);
@$pb.TagNumber(2)
$core.bool hasUserId() => $_has(1);
@$pb.TagNumber(2)
void clearUserId() => $_clearField(2);
@$pb.TagNumber(3)
$core.List<$core.int> get publicKey => $_getN(2);
@$pb.TagNumber(3)
set publicKey($core.List<$core.int> value) => $_setBytes(2, value);
@$pb.TagNumber(3)
$core.bool hasPublicKey() => $_has(2);
@$pb.TagNumber(3)
void clearPublicKey() => $_clearField(3);
}
class UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted
extends $pb.GeneratedMessage {
factory UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted({
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData?
signedData,
$core.List<$core.int>? signature,
}) {
final result = create();
if (signedData != null) result.signedData = signedData;
if (signature != null) result.signature = signature;
return result;
}
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted._();
factory UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted.fromBuffer(
$core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted.fromJson(
$core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames
? ''
: 'UserDiscoveryMessage.UserDiscoveryPromotion.AnnouncementShareDecrypted',
package: const $pb.PackageName(_omitMessageNames ? '' : 'user_discovery'),
createEmptyInstance: create)
..aOM<UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData>(
1, _omitFieldNames ? '' : 'signedData',
subBuilder:
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData
.create)
..a<$core.List<$core.int>>(
2, _omitFieldNames ? '' : 'signature', $pb.PbFieldType.OY)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted
clone() =>
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted()
..mergeFromMessage(this);
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted copyWith(
void Function(
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted)
updates) =>
super.copyWith((message) => updates(message
as UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted))
as UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted
create() =>
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted
._();
@$core.override
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted
createEmptyInstance() => create();
static $pb.PbList<
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted>
createRepeated() => $pb.PbList<
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted>();
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted
getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted>(
create);
static UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted?
_defaultInstance;
@$pb.TagNumber(1)
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData
get signedData => $_getN(0);
@$pb.TagNumber(1)
set signedData(
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData
value) =>
$_setField(1, value);
@$pb.TagNumber(1)
$core.bool hasSignedData() => $_has(0);
@$pb.TagNumber(1)
void clearSignedData() => $_clearField(1);
@$pb.TagNumber(1)
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData
ensureSignedData() => $_ensure(0);
@$pb.TagNumber(2)
$core.List<$core.int> get signature => $_getN(1);
@$pb.TagNumber(2)
set signature($core.List<$core.int> value) => $_setBytes(1, value);
@$pb.TagNumber(2)
$core.bool hasSignature() => $_has(1);
@$pb.TagNumber(2)
void clearSignature() => $_clearField(2);
}
class UserDiscoveryMessage_UserDiscoveryPromotion extends $pb.GeneratedMessage {
factory UserDiscoveryMessage_UserDiscoveryPromotion({
$core.int? promotionId,
$fixnum.Int64? publicId,
$core.int? threshold,
$core.List<$core.int>? announcementShare,
$fixnum.Int64? publicKeyVerifiedTimestamp,
}) {
final result = create();
if (promotionId != null) result.promotionId = promotionId;
if (publicId != null) result.publicId = publicId;
if (threshold != null) result.threshold = threshold;
if (announcementShare != null) result.announcementShare = announcementShare;
if (publicKeyVerifiedTimestamp != null)
result.publicKeyVerifiedTimestamp = publicKeyVerifiedTimestamp;
return result;
}
UserDiscoveryMessage_UserDiscoveryPromotion._();
factory UserDiscoveryMessage_UserDiscoveryPromotion.fromBuffer(
$core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory UserDiscoveryMessage_UserDiscoveryPromotion.fromJson(
$core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'UserDiscoveryMessage.UserDiscoveryPromotion',
package: const $pb.PackageName(_omitMessageNames ? '' : 'user_discovery'),
createEmptyInstance: create)
..a<$core.int>(1, _omitFieldNames ? '' : 'promotionId', $pb.PbFieldType.OU3)
..aInt64(2, _omitFieldNames ? '' : 'publicId')
..a<$core.int>(3, _omitFieldNames ? '' : 'threshold', $pb.PbFieldType.OU3)
..a<$core.List<$core.int>>(
5, _omitFieldNames ? '' : 'announcementShare', $pb.PbFieldType.OY)
..aInt64(6, _omitFieldNames ? '' : 'publicKeyVerifiedTimestamp')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage_UserDiscoveryPromotion clone() =>
UserDiscoveryMessage_UserDiscoveryPromotion()..mergeFromMessage(this);
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage_UserDiscoveryPromotion copyWith(
void Function(UserDiscoveryMessage_UserDiscoveryPromotion) updates) =>
super.copyWith((message) =>
updates(message as UserDiscoveryMessage_UserDiscoveryPromotion))
as UserDiscoveryMessage_UserDiscoveryPromotion;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage_UserDiscoveryPromotion create() =>
UserDiscoveryMessage_UserDiscoveryPromotion._();
@$core.override
UserDiscoveryMessage_UserDiscoveryPromotion createEmptyInstance() => create();
static $pb.PbList<UserDiscoveryMessage_UserDiscoveryPromotion>
createRepeated() =>
$pb.PbList<UserDiscoveryMessage_UserDiscoveryPromotion>();
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage_UserDiscoveryPromotion getDefault() =>
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<
UserDiscoveryMessage_UserDiscoveryPromotion>(create);
static UserDiscoveryMessage_UserDiscoveryPromotion? _defaultInstance;
@$pb.TagNumber(1)
$core.int get promotionId => $_getIZ(0);
@$pb.TagNumber(1)
set promotionId($core.int value) => $_setUnsignedInt32(0, value);
@$pb.TagNumber(1)
$core.bool hasPromotionId() => $_has(0);
@$pb.TagNumber(1)
void clearPromotionId() => $_clearField(1);
@$pb.TagNumber(2)
$fixnum.Int64 get publicId => $_getI64(1);
@$pb.TagNumber(2)
set publicId($fixnum.Int64 value) => $_setInt64(1, value);
@$pb.TagNumber(2)
$core.bool hasPublicId() => $_has(1);
@$pb.TagNumber(2)
void clearPublicId() => $_clearField(2);
@$pb.TagNumber(3)
$core.int get threshold => $_getIZ(2);
@$pb.TagNumber(3)
set threshold($core.int value) => $_setUnsignedInt32(2, value);
@$pb.TagNumber(3)
$core.bool hasThreshold() => $_has(2);
@$pb.TagNumber(3)
void clearThreshold() => $_clearField(3);
@$pb.TagNumber(5)
$core.List<$core.int> get announcementShare => $_getN(3);
@$pb.TagNumber(5)
set announcementShare($core.List<$core.int> value) => $_setBytes(3, value);
@$pb.TagNumber(5)
$core.bool hasAnnouncementShare() => $_has(3);
@$pb.TagNumber(5)
void clearAnnouncementShare() => $_clearField(5);
@$pb.TagNumber(6)
$fixnum.Int64 get publicKeyVerifiedTimestamp => $_getI64(4);
@$pb.TagNumber(6)
set publicKeyVerifiedTimestamp($fixnum.Int64 value) => $_setInt64(4, value);
@$pb.TagNumber(6)
$core.bool hasPublicKeyVerifiedTimestamp() => $_has(4);
@$pb.TagNumber(6)
void clearPublicKeyVerifiedTimestamp() => $_clearField(6);
}
class UserDiscoveryMessage_UserDiscoveryRecall extends $pb.GeneratedMessage {
factory UserDiscoveryMessage_UserDiscoveryRecall({
$fixnum.Int64? promotionId,
}) {
final result = create();
if (promotionId != null) result.promotionId = promotionId;
return result;
}
UserDiscoveryMessage_UserDiscoveryRecall._();
factory UserDiscoveryMessage_UserDiscoveryRecall.fromBuffer(
$core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory UserDiscoveryMessage_UserDiscoveryRecall.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'UserDiscoveryMessage.UserDiscoveryRecall',
package: const $pb.PackageName(_omitMessageNames ? '' : 'user_discovery'),
createEmptyInstance: create)
..aInt64(1, _omitFieldNames ? '' : 'promotionId')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage_UserDiscoveryRecall clone() =>
UserDiscoveryMessage_UserDiscoveryRecall()..mergeFromMessage(this);
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage_UserDiscoveryRecall copyWith(
void Function(UserDiscoveryMessage_UserDiscoveryRecall) updates) =>
super.copyWith((message) =>
updates(message as UserDiscoveryMessage_UserDiscoveryRecall))
as UserDiscoveryMessage_UserDiscoveryRecall;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage_UserDiscoveryRecall create() =>
UserDiscoveryMessage_UserDiscoveryRecall._();
@$core.override
UserDiscoveryMessage_UserDiscoveryRecall createEmptyInstance() => create();
static $pb.PbList<UserDiscoveryMessage_UserDiscoveryRecall>
createRepeated() =>
$pb.PbList<UserDiscoveryMessage_UserDiscoveryRecall>();
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage_UserDiscoveryRecall getDefault() =>
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<
UserDiscoveryMessage_UserDiscoveryRecall>(create);
static UserDiscoveryMessage_UserDiscoveryRecall? _defaultInstance;
@$pb.TagNumber(1)
$fixnum.Int64 get promotionId => $_getI64(0);
@$pb.TagNumber(1)
set promotionId($fixnum.Int64 value) => $_setInt64(0, value);
@$pb.TagNumber(1)
$core.bool hasPromotionId() => $_has(0);
@$pb.TagNumber(1)
void clearPromotionId() => $_clearField(1);
}
class UserDiscoveryMessage extends $pb.GeneratedMessage {
factory UserDiscoveryMessage({
UserDiscoveryVersion? version,
UserDiscoveryMessage_UserDiscoveryAnnouncement? userDiscoveryAnnouncement,
UserDiscoveryMessage_UserDiscoveryPromotion? userDiscoveryPromotion,
UserDiscoveryMessage_UserDiscoveryRecall? userDiscoveryRecall,
}) {
final result = create();
if (version != null) result.version = version;
if (userDiscoveryAnnouncement != null)
result.userDiscoveryAnnouncement = userDiscoveryAnnouncement;
if (userDiscoveryPromotion != null)
result.userDiscoveryPromotion = userDiscoveryPromotion;
if (userDiscoveryRecall != null)
result.userDiscoveryRecall = userDiscoveryRecall;
return result;
}
UserDiscoveryMessage._();
factory UserDiscoveryMessage.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory UserDiscoveryMessage.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'UserDiscoveryMessage',
package: const $pb.PackageName(_omitMessageNames ? '' : 'user_discovery'),
createEmptyInstance: create)
..aOM<UserDiscoveryVersion>(1, _omitFieldNames ? '' : 'version',
subBuilder: UserDiscoveryVersion.create)
..aOM<UserDiscoveryMessage_UserDiscoveryAnnouncement>(
2, _omitFieldNames ? '' : 'userDiscoveryAnnouncement',
subBuilder: UserDiscoveryMessage_UserDiscoveryAnnouncement.create)
..aOM<UserDiscoveryMessage_UserDiscoveryPromotion>(
3, _omitFieldNames ? '' : 'userDiscoveryPromotion',
subBuilder: UserDiscoveryMessage_UserDiscoveryPromotion.create)
..aOM<UserDiscoveryMessage_UserDiscoveryRecall>(
4, _omitFieldNames ? '' : 'userDiscoveryRecall',
subBuilder: UserDiscoveryMessage_UserDiscoveryRecall.create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage clone() =>
UserDiscoveryMessage()..mergeFromMessage(this);
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
UserDiscoveryMessage copyWith(void Function(UserDiscoveryMessage) updates) =>
super.copyWith((message) => updates(message as UserDiscoveryMessage))
as UserDiscoveryMessage;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage create() => UserDiscoveryMessage._();
@$core.override
UserDiscoveryMessage createEmptyInstance() => create();
static $pb.PbList<UserDiscoveryMessage> createRepeated() =>
$pb.PbList<UserDiscoveryMessage>();
@$core.pragma('dart2js:noInline')
static UserDiscoveryMessage getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<UserDiscoveryMessage>(create);
static UserDiscoveryMessage? _defaultInstance;
@$pb.TagNumber(1)
UserDiscoveryVersion get version => $_getN(0);
@$pb.TagNumber(1)
set version(UserDiscoveryVersion value) => $_setField(1, value);
@$pb.TagNumber(1)
$core.bool hasVersion() => $_has(0);
@$pb.TagNumber(1)
void clearVersion() => $_clearField(1);
@$pb.TagNumber(1)
UserDiscoveryVersion ensureVersion() => $_ensure(0);
@$pb.TagNumber(2)
UserDiscoveryMessage_UserDiscoveryAnnouncement
get userDiscoveryAnnouncement => $_getN(1);
@$pb.TagNumber(2)
set userDiscoveryAnnouncement(
UserDiscoveryMessage_UserDiscoveryAnnouncement value) =>
$_setField(2, value);
@$pb.TagNumber(2)
$core.bool hasUserDiscoveryAnnouncement() => $_has(1);
@$pb.TagNumber(2)
void clearUserDiscoveryAnnouncement() => $_clearField(2);
@$pb.TagNumber(2)
UserDiscoveryMessage_UserDiscoveryAnnouncement
ensureUserDiscoveryAnnouncement() => $_ensure(1);
@$pb.TagNumber(3)
UserDiscoveryMessage_UserDiscoveryPromotion get userDiscoveryPromotion =>
$_getN(2);
@$pb.TagNumber(3)
set userDiscoveryPromotion(
UserDiscoveryMessage_UserDiscoveryPromotion value) =>
$_setField(3, value);
@$pb.TagNumber(3)
$core.bool hasUserDiscoveryPromotion() => $_has(2);
@$pb.TagNumber(3)
void clearUserDiscoveryPromotion() => $_clearField(3);
@$pb.TagNumber(3)
UserDiscoveryMessage_UserDiscoveryPromotion ensureUserDiscoveryPromotion() =>
$_ensure(2);
@$pb.TagNumber(4)
UserDiscoveryMessage_UserDiscoveryRecall get userDiscoveryRecall => $_getN(3);
@$pb.TagNumber(4)
set userDiscoveryRecall(UserDiscoveryMessage_UserDiscoveryRecall value) =>
$_setField(4, value);
@$pb.TagNumber(4)
$core.bool hasUserDiscoveryRecall() => $_has(3);
@$pb.TagNumber(4)
void clearUserDiscoveryRecall() => $_clearField(4);
@$pb.TagNumber(4)
UserDiscoveryMessage_UserDiscoveryRecall ensureUserDiscoveryRecall() =>
$_ensure(3);
}
const $core.bool _omitFieldNames =
$core.bool.fromEnvironment('protobuf.omit_field_names');
const $core.bool _omitMessageNames =
$core.bool.fromEnvironment('protobuf.omit_message_names');

View file

@ -0,0 +1,11 @@
// This is a generated file - do not edit.
//
// Generated from types.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names

View file

@ -0,0 +1,207 @@
// This is a generated file - do not edit.
//
// Generated from types.proto.
// @dart = 3.3
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names, unused_import
import 'dart:convert' as $convert;
import 'dart:core' as $core;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use userDiscoveryVersionDescriptor instead')
const UserDiscoveryVersion$json = {
'1': 'UserDiscoveryVersion',
'2': [
{'1': 'announcement', '3': 1, '4': 1, '5': 13, '10': 'announcement'},
{'1': 'promotion', '3': 2, '4': 1, '5': 13, '10': 'promotion'},
],
};
/// Descriptor for `UserDiscoveryVersion`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List userDiscoveryVersionDescriptor = $convert.base64Decode(
'ChRVc2VyRGlzY292ZXJ5VmVyc2lvbhIiCgxhbm5vdW5jZW1lbnQYASABKA1SDGFubm91bmNlbW'
'VudBIcCglwcm9tb3Rpb24YAiABKA1SCXByb21vdGlvbg==');
@$core.Deprecated('Use userDiscoveryMessageDescriptor instead')
const UserDiscoveryMessage$json = {
'1': 'UserDiscoveryMessage',
'2': [
{
'1': 'version',
'3': 1,
'4': 1,
'5': 11,
'6': '.user_discovery.UserDiscoveryVersion',
'10': 'version'
},
{
'1': 'user_discovery_announcement',
'3': 2,
'4': 1,
'5': 11,
'6': '.user_discovery.UserDiscoveryMessage.UserDiscoveryAnnouncement',
'9': 0,
'10': 'userDiscoveryAnnouncement',
'17': true
},
{
'1': 'user_discovery_promotion',
'3': 3,
'4': 1,
'5': 11,
'6': '.user_discovery.UserDiscoveryMessage.UserDiscoveryPromotion',
'9': 1,
'10': 'userDiscoveryPromotion',
'17': true
},
{
'1': 'user_discovery_recall',
'3': 4,
'4': 1,
'5': 11,
'6': '.user_discovery.UserDiscoveryMessage.UserDiscoveryRecall',
'9': 2,
'10': 'userDiscoveryRecall',
'17': true
},
],
'3': [
UserDiscoveryMessage_UserDiscoveryAnnouncement$json,
UserDiscoveryMessage_UserDiscoveryPromotion$json,
UserDiscoveryMessage_UserDiscoveryRecall$json
],
'8': [
{'1': '_user_discovery_announcement'},
{'1': '_user_discovery_promotion'},
{'1': '_user_discovery_recall'},
],
};
@$core.Deprecated('Use userDiscoveryMessageDescriptor instead')
const UserDiscoveryMessage_UserDiscoveryAnnouncement$json = {
'1': 'UserDiscoveryAnnouncement',
'2': [
{'1': 'public_id', '3': 1, '4': 1, '5': 3, '10': 'publicId'},
{'1': 'threshold', '3': 2, '4': 1, '5': 13, '10': 'threshold'},
{
'1': 'announcement_share',
'3': 4,
'4': 1,
'5': 12,
'10': 'announcementShare'
},
{
'1': 'verification_shares',
'3': 6,
'4': 3,
'5': 12,
'10': 'verificationShares'
},
],
};
@$core.Deprecated('Use userDiscoveryMessageDescriptor instead')
const UserDiscoveryMessage_UserDiscoveryPromotion$json = {
'1': 'UserDiscoveryPromotion',
'2': [
{'1': 'promotion_id', '3': 1, '4': 1, '5': 13, '10': 'promotionId'},
{'1': 'public_id', '3': 2, '4': 1, '5': 3, '10': 'publicId'},
{'1': 'threshold', '3': 3, '4': 1, '5': 13, '10': 'threshold'},
{
'1': 'announcement_share',
'3': 5,
'4': 1,
'5': 12,
'10': 'announcementShare'
},
{
'1': 'public_key_verified_timestamp',
'3': 6,
'4': 1,
'5': 3,
'9': 0,
'10': 'publicKeyVerifiedTimestamp',
'17': true
},
],
'3': [
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted$json
],
'8': [
{'1': '_public_key_verified_timestamp'},
],
};
@$core.Deprecated('Use userDiscoveryMessageDescriptor instead')
const UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted$json =
{
'1': 'AnnouncementShareDecrypted',
'2': [
{
'1': 'signed_data',
'3': 1,
'4': 1,
'5': 11,
'6':
'.user_discovery.UserDiscoveryMessage.UserDiscoveryPromotion.AnnouncementShareDecrypted.SignedData',
'10': 'signedData'
},
{'1': 'signature', '3': 2, '4': 1, '5': 12, '10': 'signature'},
],
'3': [
UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData$json
],
};
@$core.Deprecated('Use userDiscoveryMessageDescriptor instead')
const UserDiscoveryMessage_UserDiscoveryPromotion_AnnouncementShareDecrypted_SignedData$json =
{
'1': 'SignedData',
'2': [
{'1': 'public_id', '3': 1, '4': 1, '5': 3, '10': 'publicId'},
{'1': 'user_id', '3': 2, '4': 1, '5': 3, '10': 'userId'},
{'1': 'public_key', '3': 3, '4': 1, '5': 12, '10': 'publicKey'},
],
};
@$core.Deprecated('Use userDiscoveryMessageDescriptor instead')
const UserDiscoveryMessage_UserDiscoveryRecall$json = {
'1': 'UserDiscoveryRecall',
'2': [
{'1': 'promotion_id', '3': 1, '4': 1, '5': 3, '10': 'promotionId'},
],
};
/// Descriptor for `UserDiscoveryMessage`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List userDiscoveryMessageDescriptor = $convert.base64Decode(
'ChRVc2VyRGlzY292ZXJ5TWVzc2FnZRI+Cgd2ZXJzaW9uGAEgASgLMiQudXNlcl9kaXNjb3Zlcn'
'kuVXNlckRpc2NvdmVyeVZlcnNpb25SB3ZlcnNpb24SgwEKG3VzZXJfZGlzY292ZXJ5X2Fubm91'
'bmNlbWVudBgCIAEoCzI+LnVzZXJfZGlzY292ZXJ5LlVzZXJEaXNjb3ZlcnlNZXNzYWdlLlVzZX'
'JEaXNjb3ZlcnlBbm5vdW5jZW1lbnRIAFIZdXNlckRpc2NvdmVyeUFubm91bmNlbWVudIgBARJ6'
'Chh1c2VyX2Rpc2NvdmVyeV9wcm9tb3Rpb24YAyABKAsyOy51c2VyX2Rpc2NvdmVyeS5Vc2VyRG'
'lzY292ZXJ5TWVzc2FnZS5Vc2VyRGlzY292ZXJ5UHJvbW90aW9uSAFSFnVzZXJEaXNjb3ZlcnlQ'
'cm9tb3Rpb26IAQEScQoVdXNlcl9kaXNjb3ZlcnlfcmVjYWxsGAQgASgLMjgudXNlcl9kaXNjb3'
'ZlcnkuVXNlckRpc2NvdmVyeU1lc3NhZ2UuVXNlckRpc2NvdmVyeVJlY2FsbEgCUhN1c2VyRGlz'
'Y292ZXJ5UmVjYWxsiAEBGrYBChlVc2VyRGlzY292ZXJ5QW5ub3VuY2VtZW50EhsKCXB1YmxpY1'
'9pZBgBIAEoA1IIcHVibGljSWQSHAoJdGhyZXNob2xkGAIgASgNUgl0aHJlc2hvbGQSLQoSYW5u'
'b3VuY2VtZW50X3NoYXJlGAQgASgMUhFhbm5vdW5jZW1lbnRTaGFyZRIvChN2ZXJpZmljYXRpb2'
'5fc2hhcmVzGAYgAygMUhJ2ZXJpZmljYXRpb25TaGFyZXMatAQKFlVzZXJEaXNjb3ZlcnlQcm9t'
'b3Rpb24SIQoMcHJvbW90aW9uX2lkGAEgASgNUgtwcm9tb3Rpb25JZBIbCglwdWJsaWNfaWQYAi'
'ABKANSCHB1YmxpY0lkEhwKCXRocmVzaG9sZBgDIAEoDVIJdGhyZXNob2xkEi0KEmFubm91bmNl'
'bWVudF9zaGFyZRgFIAEoDFIRYW5ub3VuY2VtZW50U2hhcmUSRgodcHVibGljX2tleV92ZXJpZm'
'llZF90aW1lc3RhbXAYBiABKANIAFIacHVibGljS2V5VmVyaWZpZWRUaW1lc3RhbXCIAQEaogIK'
'GkFubm91bmNlbWVudFNoYXJlRGVjcnlwdGVkEoIBCgtzaWduZWRfZGF0YRgBIAEoCzJhLnVzZX'
'JfZGlzY292ZXJ5LlVzZXJEaXNjb3ZlcnlNZXNzYWdlLlVzZXJEaXNjb3ZlcnlQcm9tb3Rpb24u'
'QW5ub3VuY2VtZW50U2hhcmVEZWNyeXB0ZWQuU2lnbmVkRGF0YVIKc2lnbmVkRGF0YRIcCglzaW'
'duYXR1cmUYAiABKAxSCXNpZ25hdHVyZRphCgpTaWduZWREYXRhEhsKCXB1YmxpY19pZBgBIAEo'
'A1IIcHVibGljSWQSFwoHdXNlcl9pZBgCIAEoA1IGdXNlcklkEh0KCnB1YmxpY19rZXkYAyABKA'
'xSCXB1YmxpY0tleUIgCh5fcHVibGljX2tleV92ZXJpZmllZF90aW1lc3RhbXAaOAoTVXNlckRp'
'c2NvdmVyeVJlY2FsbBIhCgxwcm9tb3Rpb25faWQYASABKANSC3Byb21vdGlvbklkQh4KHF91c2'
'VyX2Rpc2NvdmVyeV9hbm5vdW5jZW1lbnRCGwoZX3VzZXJfZGlzY292ZXJ5X3Byb21vdGlvbkIY'
'ChZfdXNlcl9kaXNjb3ZlcnlfcmVjYWxs');

View file

@ -89,6 +89,25 @@ Future<void> incFlameCounter(
final group = await twonlyDB.groupsDao.getGroup(groupId); final group = await twonlyDB.groupsDao.getGroup(groupId);
if (group == null) return; if (group == null) return;
if (group.isDirectChat) {
final contacts = await twonlyDB.groupsDao.getGroupContact(
group.groupId,
);
if (contacts.length == 1) {
await twonlyDB.contactsDao.updateContact(
contacts.first.userId,
ContactsCompanion(
mediaReceivedCounter: Value(
contacts.first.mediaReceivedCounter + (received ? 1 : 0),
),
mediaSendCounter: Value(
contacts.first.mediaSendCounter + (received ? 0 : 1),
),
),
);
}
}
final totalMediaCounter = group.totalMediaCounter + 1; final totalMediaCounter = group.totalMediaCounter + 1;
var flameCounter = group.flameCounter; var flameCounter = group.flameCounter;
var maxFlameCounter = group.maxFlameCounter; var maxFlameCounter = group.maxFlameCounter;

View file

@ -1,13 +1,17 @@
import 'dart:typed_data';
import 'package:twonly/core/bridge/wrapper/user_discovery.dart'; import 'package:twonly/core/bridge/wrapper/user_discovery.dart';
import 'package:twonly/globals.dart'; import 'package:twonly/globals.dart';
import 'package:twonly/src/model/protobuf/client/generated/user_discovery/types.pb.dart';
import 'package:twonly/src/utils/log.dart'; import 'package:twonly/src/utils/log.dart';
import 'package:twonly/src/utils/qr.dart'; import 'package:twonly/src/utils/qr.dart';
import 'package:twonly/src/utils/storage.dart'; import 'package:twonly/src/utils/storage.dart';
Future<void> initializeOrUpdateUserDiscovery({ class UserDiscoveryService {
static Future<void> initializeOrUpdate({
required int threshold, required int threshold,
required int minimumRequiredImagesExchanged, required int minimumRequiredImagesExchanged,
}) async { }) async {
try { try {
await FlutterUserDiscovery.initializeOrUpdate( await FlutterUserDiscovery.initializeOrUpdate(
threshold: threshold, threshold: threshold,
@ -23,4 +27,27 @@ Future<void> initializeOrUpdateUserDiscovery({
} catch (e) { } catch (e) {
Log.error(e); Log.error(e);
} }
}
static Future<Uint8List?> getCurrentVersion() async {
try {
return await FlutterUserDiscovery.getCurrentVersion();
} catch (e) {
Log.error(e);
return null;
}
}
static Future<UserDiscoveryVersion?> getCurrentVersionTyped() async {
final version = await getCurrentVersion();
if (version == null) return null;
return UserDiscoveryVersion.fromBuffer(version);
}
static Future<void> disable() async {
await updateUserdata((u) {
u.isUserDiscoveryEnabled = false;
return u;
});
}
} }

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:twonly/src/utils/misc.dart';
final primaryColor = const Color(0xFF57CC99); const primaryColor = Color(0xFF57CC99);
final ThemeData lightTheme = ThemeData( final ThemeData lightTheme = ThemeData(
colorScheme: ColorScheme.fromSeed( colorScheme: ColorScheme.fromSeed(
@ -15,18 +16,18 @@ final ButtonStyle primaryColorButtonStyle = FilledButton.styleFrom(
backgroundColor: primaryColor, backgroundColor: primaryColor,
foregroundColor: Colors.black87, foregroundColor: Colors.black87,
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16),
// Adjusting the border radius (default is usually 20+)
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), // Lower number = sharper corners borderRadius: BorderRadius.circular(8),
), ),
); );
final ButtonStyle secondaryGreyButtonStyle = FilledButton.styleFrom( ButtonStyle secondaryGreyButtonStyle(BuildContext context) {
backgroundColor: Colors.grey[200], return FilledButton.styleFrom(
foregroundColor: Colors.black87, backgroundColor: isDarkMode(context) ? Colors.grey[800] : Colors.grey[200],
foregroundColor: isDarkMode(context) ? Colors.white : Colors.black87,
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16),
// Adjusting the border radius (default is usually 20+)
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), // Lower number = sharper corners borderRadius: BorderRadius.circular(8),
), ),
); );
}

View file

@ -419,7 +419,6 @@ List<TextSpan> formattedText(String input) {
spans.add( spans.add(
TextSpan( TextSpan(
text: input.substring(lastMatchEnd, match.start), text: input.substring(lastMatchEnd, match.start),
style: const TextStyle(color: Colors.black),
), ),
); );
} }
@ -431,7 +430,6 @@ List<TextSpan> formattedText(String input) {
text: match.group(1), text: match.group(1),
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black,
), ),
), ),
); );
@ -444,7 +442,6 @@ List<TextSpan> formattedText(String input) {
spans.add( spans.add(
TextSpan( TextSpan(
text: input.substring(lastMatchEnd), text: input.substring(lastMatchEnd),
style: const TextStyle(color: Colors.black),
), ),
); );
} }

View file

@ -16,7 +16,7 @@ class UserDiscoveryDisabledComponent extends StatefulWidget {
class _UserDiscoveryDisabledComponentState class _UserDiscoveryDisabledComponentState
extends State<UserDiscoveryDisabledComponent> { extends State<UserDiscoveryDisabledComponent> {
Future<void> initializeUserDiscoveryWithDefaultSettings() async { Future<void> initializeUserDiscoveryWithDefaultSettings() async {
await initializeOrUpdateUserDiscovery( await UserDiscoveryService.initializeOrUpdate(
threshold: 2, threshold: 2,
minimumRequiredImagesExchanged: 4, minimumRequiredImagesExchanged: 4,
); );
@ -73,7 +73,7 @@ class _UserDiscoveryDisabledComponentState
padding: const EdgeInsets.symmetric(horizontal: 24), padding: const EdgeInsets.symmetric(horizontal: 24),
child: FilledButton( child: FilledButton(
onPressed: () {}, onPressed: () {},
style: secondaryGreyButtonStyle, style: secondaryGreyButtonStyle(context),
child: const Text('Einstellungen anpassen'), child: const Text('Einstellungen anpassen'),
), ),
), ),
@ -82,7 +82,7 @@ class _UserDiscoveryDisabledComponentState
padding: const EdgeInsets.symmetric(horizontal: 24), padding: const EdgeInsets.symmetric(horizontal: 24),
child: FilledButton( child: FilledButton(
onPressed: () {}, onPressed: () {},
style: secondaryGreyButtonStyle, style: secondaryGreyButtonStyle(context),
child: const Text('Mehr erfahren'), child: const Text('Mehr erfahren'),
), ),
), ),

View file

@ -1,4 +1,13 @@
import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:twonly/globals.dart';
import 'package:twonly/src/database/daos/contacts.dao.dart';
import 'package:twonly/src/database/twonly.db.dart';
import 'package:twonly/src/model/protobuf/client/generated/user_discovery/types.pb.dart';
import 'package:twonly/src/services/user_discovery.service.dart';
import 'package:twonly/src/utils/misc.dart';
import 'package:twonly/src/views/components/alert_dialog.dart';
import 'package:twonly/src/views/settings/privacy/user_discovery/user_discovery_settings.view.dart';
class UserDiscoveryEnabledComponent extends StatefulWidget { class UserDiscoveryEnabledComponent extends StatefulWidget {
const UserDiscoveryEnabledComponent({required this.onUpdate, super.key}); const UserDiscoveryEnabledComponent({required this.onUpdate, super.key});
@ -12,31 +21,109 @@ class UserDiscoveryEnabledComponent extends StatefulWidget {
class _UserDiscoveryEnabledComponentState class _UserDiscoveryEnabledComponentState
extends State<UserDiscoveryEnabledComponent> { extends State<UserDiscoveryEnabledComponent> {
UserDiscoveryVersion? _version;
List<Contact> _contactsGettingAnnounced = [];
late StreamSubscription<List<Contact>> _contactsGettingAnnouncedStream;
@override
void initState() {
_contactsGettingAnnouncedStream = twonlyDB.contactsDao
.watchContactsAnnouncedViaUserDiscovery()
.listen((contacts) {
setState(() {
_contactsGettingAnnounced = contacts;
});
});
_initAsync();
super.initState();
}
@override
void dispose() {
_contactsGettingAnnouncedStream.cancel();
super.dispose();
}
Future<void> _initAsync() async {
final version = await UserDiscoveryService.getCurrentVersionTyped();
if (mounted) {
setState(() {
_version = version;
});
}
}
Future<void> _disableUserDiscovery() async {
final ok = await showAlertDialog(
context,
'Wirklich deaktivieren?',
'Wenn du das Feature „Freunde finden“ deaktivierst, werden dir keine Vorschläge mehr angezeigt. Du teilst neuen Kontakten dann auch nicht mehr deine Freunde.',
);
if (ok) {
await UserDiscoveryService.disable();
}
// This will show the DisabledComponent as the gUser has been updated...
widget.onUpdate();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.only(top: 10), padding: const EdgeInsets.only(top: 10),
child: ListView( child: ListView(
children: [ children: [
const ExpansionTile( ExpansionTile(
shape: RoundedRectangleBorder(), shape: const RoundedRectangleBorder(),
collapsedShape: RoundedRectangleBorder(), backgroundColor: context.color.surfaceContainer,
tilePadding: EdgeInsets.symmetric(horizontal: 17), collapsedShape: const RoundedRectangleBorder(),
title: Text('Freunde die du teilst'), tilePadding: const EdgeInsets.symmetric(horizontal: 17),
subtitle: Text( title: const Text('Freunde die du teilst'),
subtitle: const Text(
'Du teilst nur Freunde, die diese Funktion ebenfalls aktiviert haben und die den von dir festgelegten Schwellenwert erreicht haben.', 'Du teilst nur Freunde, die diese Funktion ebenfalls aktiviert haben und die den von dir festgelegten Schwellenwert erreicht haben.',
style: TextStyle(fontSize: 10), style: TextStyle(fontSize: 10),
), ),
children: [], children: _contactsGettingAnnounced.isEmpty
? [
const Padding(
padding: EdgeInsetsGeometry.symmetric(vertical: 12),
child: Text(
'Bisher teilst du noch niemanden.',
),
),
]
: _contactsGettingAnnounced.map((contact) {
return Text(getContactDisplayName(contact));
}).toList(),
), ),
ListTile( ListTile(
title: Text('Einstellungen ändern'), title: const Text('Einstellungen ändern'),
// onTap: () {}, onTap: () async {
await context.navPush(const UserDiscoverySettingsView());
await _initAsync();
},
),
const Divider(),
const ListTile(
title: Text('Mehr erfahren'),
subtitle: Text(
'In unserem FAQ erklären wir dir wie das Feature "Freunde finden" funktioniert.',
),
// onTap: _disableUserDiscovery,
), ),
const Divider(), const Divider(),
ListTile( ListTile(
title: Text('Deaktivieren'), title: const Text('Deaktivieren'),
onTap: () {}, onTap: _disableUserDiscovery,
),
if (_version != null)
ListTile(
title: Text(
'Your version: ${_version!.announcement}.${_version!.promotion}',
style: const TextStyle(color: Colors.grey, fontSize: 13),
),
), ),
], ],
), ),

View file

@ -0,0 +1,137 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:twonly/globals.dart';
import 'package:twonly/src/services/user_discovery.service.dart';
import 'package:twonly/src/themes/light.dart';
import 'package:twonly/src/utils/storage.dart';
class UserDiscoverySettingsView extends StatefulWidget {
const UserDiscoverySettingsView({super.key});
@override
State<UserDiscoverySettingsView> createState() =>
_UserDiscoverySettingsViewState();
}
class _UserDiscoverySettingsViewState extends State<UserDiscoverySettingsView> {
int _minimumRequiredImagesExchanged = 0;
int _userDiscoveryThreshold = 0;
@override
void initState() {
_minimumRequiredImagesExchanged = gUser.minimumRequiredImagesExchanged;
_userDiscoveryThreshold = gUser.userDiscoveryThreshold;
super.initState();
}
Future<void> _saveChanges() async {
final requiresNewInitialization =
gUser.userDiscoveryThreshold != _userDiscoveryThreshold;
await updateUserdata((u) {
u
..minimumRequiredImagesExchanged = _minimumRequiredImagesExchanged
..userDiscoveryThreshold = _userDiscoveryThreshold;
return u;
});
if (requiresNewInitialization) {
await UserDiscoveryService.initializeOrUpdate(
threshold: gUser.userDiscoveryThreshold,
minimumRequiredImagesExchanged: gUser.minimumRequiredImagesExchanged,
);
}
if (mounted) Navigator.pop(context);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Freunde finden'),
),
body: Padding(
padding: const EdgeInsets.only(top: 10),
child: ListView(
children: [
ListTile(
title: const Text('Anzahl an geteilten Bildern'),
subtitle: const Text(
'Wähle die Mindestanzahl an Bildern, die du mit einer Person ausgetauscht haben musst, bevor du ihr deine Freunde sicher teilst.',
),
trailing: SizedBox(
width: 60,
child: CupertinoPicker(
magnification: 1.22,
squeeze: 1.2,
useMagnifier: true,
itemExtent: 32,
scrollController: FixedExtentScrollController(
initialItem: _minimumRequiredImagesExchanged,
),
onSelectedItemChanged: (selectedItem) {
_minimumRequiredImagesExchanged = selectedItem;
setState(() {});
},
children: List.generate(
9,
(index) => Center(child: Text('$index')),
),
),
),
),
ListTile(
title: const Text('Anzahl an gemeinsame Freunde'),
subtitle: const Text(
'Wähle aus, wie viele gemeinsame Freunde eine Person haben muss, damit du ihr vorgeschlagen wirst.',
),
trailing: SizedBox(
width: 60,
child: CupertinoPicker(
magnification: 1.22,
squeeze: 1.2,
useMagnifier: true,
itemExtent: 32,
scrollController: FixedExtentScrollController(
initialItem: _userDiscoveryThreshold - 2,
),
onSelectedItemChanged: (selectedItem) {
_userDiscoveryThreshold = selectedItem + 2;
setState(() {});
},
children: List.generate(
9,
(index) => Center(child: Text('${index + 2}')),
),
),
),
),
const SizedBox(
height: 30,
),
if (_minimumRequiredImagesExchanged !=
gUser.minimumRequiredImagesExchanged ||
_userDiscoveryThreshold != gUser.userDiscoveryThreshold)
Padding(
padding: const EdgeInsets.all(17),
child: FilledButton(
onPressed: _saveChanges,
style: primaryColorButtonStyle.merge(
FilledButton.styleFrom(
padding: EdgeInsets.symmetric(
horizontal: 32,
vertical: 24,
),
),
),
child: const Text('Änderungen übernehmen'),
),
),
],
),
),
);
}
}

View file

@ -17,6 +17,9 @@ protoc --proto_path="$CLIENT_DIR" --dart_out="$GENERATED_DIR" "groups.proto"
protoc --proto_path="$CLIENT_DIR" --dart_out="$GENERATED_DIR" "qr.proto" protoc --proto_path="$CLIENT_DIR" --dart_out="$GENERATED_DIR" "qr.proto"
protoc --proto_path="$CLIENT_DIR" --dart_out="$GENERATED_DIR" "data.proto" protoc --proto_path="$CLIENT_DIR" --dart_out="$GENERATED_DIR" "data.proto"
mkdir "$GENERATED_DIR/user_discovery/" &>/dev/null
protoc --proto_path="./rust_dependencies/protocols/src/user_discovery/" --dart_out="$GENERATED_DIR/user_discovery/" "types.proto"
protoc --proto_path="$CLIENT_DIR" --dart_out="$GENERATED_DIR" "push_notification.proto" protoc --proto_path="$CLIENT_DIR" --dart_out="$GENERATED_DIR" "push_notification.proto"
protoc --proto_path="$CLIENT_DIR" --swift_out="./ios/NotificationService/" "push_notification.proto" protoc --proto_path="$CLIENT_DIR" --swift_out="./ios/NotificationService/" "push_notification.proto"

View file

@ -16,6 +16,7 @@ import 'schema_v9.dart' as v9;
import 'schema_v10.dart' as v10; import 'schema_v10.dart' as v10;
import 'schema_v11.dart' as v11; import 'schema_v11.dart' as v11;
import 'schema_v12.dart' as v12; import 'schema_v12.dart' as v12;
import 'schema_v13.dart' as v13;
class GeneratedHelper implements SchemaInstantiationHelper { class GeneratedHelper implements SchemaInstantiationHelper {
@override @override
@ -45,10 +46,12 @@ class GeneratedHelper implements SchemaInstantiationHelper {
return v11.DatabaseAtV11(db); return v11.DatabaseAtV11(db);
case 12: case 12:
return v12.DatabaseAtV12(db); return v12.DatabaseAtV12(db);
case 13:
return v13.DatabaseAtV13(db);
default: default:
throw MissingSchemaException(version, versions); throw MissingSchemaException(version, versions);
} }
} }
static const versions = const [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; static const versions = const [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
} }

File diff suppressed because it is too large Load diff