clean up context locators

This commit is contained in:
Christien Rioux 2024-06-15 23:29:15 -04:00
parent 751022e743
commit 2ccad50f9a
31 changed files with 603 additions and 542 deletions

View file

@ -29,3 +29,8 @@ extension MessageExt on proto.Message {
static int compareTimestamp(proto.Message a, proto.Message b) =>
a.timestamp.compareTo(b.timestamp);
}
extension ContactExt on proto.Contact {
String get displayName =>
nickname.isNotEmpty ? '$nickname (${profile.name})' : profile.name;
}

View file

@ -1606,13 +1606,14 @@ class Contact extends $pb.GeneratedMessage {
factory Contact.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Contact', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create)
..aOM<Profile>(1, _omitFieldNames ? '' : 'editedProfile', subBuilder: Profile.create)
..aOM<Profile>(2, _omitFieldNames ? '' : 'remoteProfile', subBuilder: Profile.create)
..aOS(1, _omitFieldNames ? '' : 'nickname')
..aOM<Profile>(2, _omitFieldNames ? '' : 'profile', subBuilder: Profile.create)
..aOS(3, _omitFieldNames ? '' : 'superIdentityJson')
..aOM<$0.TypedKey>(4, _omitFieldNames ? '' : 'identityPublicKey', subBuilder: $0.TypedKey.create)
..aOM<$0.TypedKey>(5, _omitFieldNames ? '' : 'remoteConversationRecordKey', subBuilder: $0.TypedKey.create)
..aOM<$0.TypedKey>(6, _omitFieldNames ? '' : 'localConversationRecordKey', subBuilder: $0.TypedKey.create)
..aOB(7, _omitFieldNames ? '' : 'showAvailability')
..aOS(8, _omitFieldNames ? '' : 'notes')
..hasRequiredFields = false
;
@ -1638,26 +1639,24 @@ class Contact extends $pb.GeneratedMessage {
static Contact? _defaultInstance;
@$pb.TagNumber(1)
Profile get editedProfile => $_getN(0);
$core.String get nickname => $_getSZ(0);
@$pb.TagNumber(1)
set editedProfile(Profile v) { setField(1, v); }
set nickname($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasEditedProfile() => $_has(0);
$core.bool hasNickname() => $_has(0);
@$pb.TagNumber(1)
void clearEditedProfile() => clearField(1);
@$pb.TagNumber(1)
Profile ensureEditedProfile() => $_ensure(0);
void clearNickname() => clearField(1);
@$pb.TagNumber(2)
Profile get remoteProfile => $_getN(1);
Profile get profile => $_getN(1);
@$pb.TagNumber(2)
set remoteProfile(Profile v) { setField(2, v); }
set profile(Profile v) { setField(2, v); }
@$pb.TagNumber(2)
$core.bool hasRemoteProfile() => $_has(1);
$core.bool hasProfile() => $_has(1);
@$pb.TagNumber(2)
void clearRemoteProfile() => clearField(2);
void clearProfile() => clearField(2);
@$pb.TagNumber(2)
Profile ensureRemoteProfile() => $_ensure(1);
Profile ensureProfile() => $_ensure(1);
@$pb.TagNumber(3)
$core.String get superIdentityJson => $_getSZ(2);
@ -1709,6 +1708,15 @@ class Contact extends $pb.GeneratedMessage {
$core.bool hasShowAvailability() => $_has(6);
@$pb.TagNumber(7)
void clearShowAvailability() => clearField(7);
@$pb.TagNumber(8)
$core.String get notes => $_getSZ(7);
@$pb.TagNumber(8)
set notes($core.String v) { $_setString(7, v); }
@$pb.TagNumber(8)
$core.bool hasNotes() => $_has(7);
@$pb.TagNumber(8)
void clearNotes() => clearField(8);
}
class ContactInvitation extends $pb.GeneratedMessage {

View file

@ -455,27 +455,27 @@ final $typed_data.Uint8List accountDescriptor = $convert.base64Decode(
const Contact$json = {
'1': 'Contact',
'2': [
{'1': 'edited_profile', '3': 1, '4': 1, '5': 11, '6': '.veilidchat.Profile', '10': 'editedProfile'},
{'1': 'remote_profile', '3': 2, '4': 1, '5': 11, '6': '.veilidchat.Profile', '10': 'remoteProfile'},
{'1': 'nickname', '3': 1, '4': 1, '5': 9, '10': 'nickname'},
{'1': 'profile', '3': 2, '4': 1, '5': 11, '6': '.veilidchat.Profile', '10': 'profile'},
{'1': 'super_identity_json', '3': 3, '4': 1, '5': 9, '10': 'superIdentityJson'},
{'1': 'identity_public_key', '3': 4, '4': 1, '5': 11, '6': '.veilid.TypedKey', '10': 'identityPublicKey'},
{'1': 'remote_conversation_record_key', '3': 5, '4': 1, '5': 11, '6': '.veilid.TypedKey', '10': 'remoteConversationRecordKey'},
{'1': 'local_conversation_record_key', '3': 6, '4': 1, '5': 11, '6': '.veilid.TypedKey', '10': 'localConversationRecordKey'},
{'1': 'show_availability', '3': 7, '4': 1, '5': 8, '10': 'showAvailability'},
{'1': 'notes', '3': 8, '4': 1, '5': 9, '10': 'notes'},
],
};
/// Descriptor for `Contact`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List contactDescriptor = $convert.base64Decode(
'CgdDb250YWN0EjoKDmVkaXRlZF9wcm9maWxlGAEgASgLMhMudmVpbGlkY2hhdC5Qcm9maWxlUg'
'1lZGl0ZWRQcm9maWxlEjoKDnJlbW90ZV9wcm9maWxlGAIgASgLMhMudmVpbGlkY2hhdC5Qcm9m'
'aWxlUg1yZW1vdGVQcm9maWxlEi4KE3N1cGVyX2lkZW50aXR5X2pzb24YAyABKAlSEXN1cGVySW'
'RlbnRpdHlKc29uEkAKE2lkZW50aXR5X3B1YmxpY19rZXkYBCABKAsyEC52ZWlsaWQuVHlwZWRL'
'ZXlSEWlkZW50aXR5UHVibGljS2V5ElUKHnJlbW90ZV9jb252ZXJzYXRpb25fcmVjb3JkX2tleR'
'gFIAEoCzIQLnZlaWxpZC5UeXBlZEtleVIbcmVtb3RlQ29udmVyc2F0aW9uUmVjb3JkS2V5ElMK'
'HWxvY2FsX2NvbnZlcnNhdGlvbl9yZWNvcmRfa2V5GAYgASgLMhAudmVpbGlkLlR5cGVkS2V5Uh'
'psb2NhbENvbnZlcnNhdGlvblJlY29yZEtleRIrChFzaG93X2F2YWlsYWJpbGl0eRgHIAEoCFIQ'
'c2hvd0F2YWlsYWJpbGl0eQ==');
'CgdDb250YWN0EhoKCG5pY2tuYW1lGAEgASgJUghuaWNrbmFtZRItCgdwcm9maWxlGAIgASgLMh'
'MudmVpbGlkY2hhdC5Qcm9maWxlUgdwcm9maWxlEi4KE3N1cGVyX2lkZW50aXR5X2pzb24YAyAB'
'KAlSEXN1cGVySWRlbnRpdHlKc29uEkAKE2lkZW50aXR5X3B1YmxpY19rZXkYBCABKAsyEC52ZW'
'lsaWQuVHlwZWRLZXlSEWlkZW50aXR5UHVibGljS2V5ElUKHnJlbW90ZV9jb252ZXJzYXRpb25f'
'cmVjb3JkX2tleRgFIAEoCzIQLnZlaWxpZC5UeXBlZEtleVIbcmVtb3RlQ29udmVyc2F0aW9uUm'
'Vjb3JkS2V5ElMKHWxvY2FsX2NvbnZlcnNhdGlvbl9yZWNvcmRfa2V5GAYgASgLMhAudmVpbGlk'
'LlR5cGVkS2V5Uhpsb2NhbENvbnZlcnNhdGlvblJlY29yZEtleRIrChFzaG93X2F2YWlsYWJpbG'
'l0eRgHIAEoCFIQc2hvd0F2YWlsYWJpbGl0eRIUCgVub3RlcxgIIAEoCVIFbm90ZXM=');
@$core.Deprecated('Use contactInvitationDescriptor instead')
const ContactInvitation$json = {

View file

@ -349,10 +349,10 @@ message Account {
//
// Stored in ContactList DHTList
message Contact {
// Friend's profile as locally edited
Profile edited_profile = 1;
// Friend's nickname
string nickname = 1;
// Copy of friend's profile from remote conversation
Profile remote_profile = 2;
Profile profile = 2;
// Copy of friend's SuperIdentity in JSON from remote conversation
string super_identity_json = 3;
// Copy of friend's most recent identity public key from their identityMaster
@ -363,6 +363,8 @@ message Contact {
veilid.TypedKey local_conversation_record_key = 6;
// Show availability to this contact
bool show_availability = 7;
// Notes about this friend
string notes = 8;
}
////////////////////////////////////////////////////////////////////////////////////