debugging work

This commit is contained in:
Christien Rioux 2025-03-22 21:43:37 -04:00
parent 739df7c427
commit d6b1c20906
71 changed files with 4155 additions and 3616 deletions

View file

@ -1,3 +1,6 @@
import 'package:veilid_support/veilid_support.dart';
import 'veilidchat.pb.dart' as vcproto;
export 'package:veilid_support/dht_support/proto/proto.dart';
export 'package:veilid_support/proto/proto.dart';
@ -6,3 +9,292 @@ export 'veilidchat.pb.dart';
export 'veilidchat.pbenum.dart';
export 'veilidchat.pbjson.dart';
export 'veilidchat.pbserver.dart';
void registerVeilidchatProtoToDebug() {
dynamic toDebug(dynamic obj) {
if (obj is vcproto.DHTDataReference) {
return {
'dhtData': obj.dhtData,
'hash': obj.hash,
};
}
if (obj is vcproto.BlockStoreDataReference) {
return {
'block': obj.block,
};
}
if (obj is vcproto.DataReference) {
return {
'kind': obj.whichKind(),
if (obj.whichKind() == vcproto.DataReference_Kind.dhtData)
'dhtData': obj.dhtData,
if (obj.whichKind() == vcproto.DataReference_Kind.blockStoreData)
'blockStoreData': obj.blockStoreData,
};
}
if (obj is vcproto.Attachment) {
return {
'kind': obj.whichKind(),
if (obj.whichKind() == vcproto.Attachment_Kind.media)
'media': obj.media,
'signature': obj.signature,
};
}
if (obj is vcproto.AttachmentMedia) {
return {
'mime': obj.mime,
'name': obj.name,
'content': obj.content,
};
}
if (obj is vcproto.Permissions) {
return {
'canAddMembers': obj.canAddMembers,
'canEditInfo': obj.canEditInfo,
'moderated': obj.moderated,
};
}
if (obj is vcproto.Membership) {
return {
'watchers': obj.watchers,
'moderated': obj.moderated,
'talkers': obj.talkers,
'moderators': obj.moderators,
'admins': obj.admins,
};
}
if (obj is vcproto.ChatSettings) {
return {
'title': obj.title,
'description': obj.description,
'icon': obj.icon,
'defaultExpiration': obj.defaultExpiration,
};
}
if (obj is vcproto.ChatSettings) {
return {
'title': obj.title,
'description': obj.description,
'icon': obj.icon,
'defaultExpiration': obj.defaultExpiration,
};
}
if (obj is vcproto.Message) {
return {
'id': obj.id,
'author': obj.author,
'timestamp': obj.timestamp,
'kind': obj.whichKind(),
if (obj.whichKind() == vcproto.Message_Kind.text) 'text': obj.text,
if (obj.whichKind() == vcproto.Message_Kind.secret)
'secret': obj.secret,
if (obj.whichKind() == vcproto.Message_Kind.delete)
'delete': obj.delete,
if (obj.whichKind() == vcproto.Message_Kind.erase) 'erase': obj.erase,
if (obj.whichKind() == vcproto.Message_Kind.settings)
'settings': obj.settings,
if (obj.whichKind() == vcproto.Message_Kind.permissions)
'permissions': obj.permissions,
if (obj.whichKind() == vcproto.Message_Kind.membership)
'membership': obj.membership,
if (obj.whichKind() == vcproto.Message_Kind.moderation)
'moderation': obj.moderation,
'signature': obj.signature,
};
}
if (obj is vcproto.Message_Text) {
return {
'text': obj.text,
'topic': obj.topic,
'replyId': obj.replyId,
'expiration': obj.expiration,
'viewLimit': obj.viewLimit,
'attachments': obj.attachments,
};
}
if (obj is vcproto.Message_Secret) {
return {
'ciphertext': obj.ciphertext,
'expiration': obj.expiration,
};
}
if (obj is vcproto.Message_ControlDelete) {
return {
'ids': obj.ids,
};
}
if (obj is vcproto.Message_ControlErase) {
return {
'timestamp': obj.timestamp,
};
}
if (obj is vcproto.Message_ControlSettings) {
return {
'settings': obj.settings,
};
}
if (obj is vcproto.Message_ControlPermissions) {
return {
'permissions': obj.permissions,
};
}
if (obj is vcproto.Message_ControlMembership) {
return {
'membership': obj.membership,
};
}
if (obj is vcproto.Message_ControlModeration) {
return {
'acceptedIds': obj.acceptedIds,
'rejectdIds': obj.rejectedIds,
};
}
if (obj is vcproto.Message_ControlModeration) {
return {
'acceptedIds': obj.acceptedIds,
'rejectdIds': obj.rejectedIds,
};
}
if (obj is vcproto.Message_ControlReadReceipt) {
return {
'readIds': obj.readIds,
};
}
if (obj is vcproto.ReconciledMessage) {
return {
'content': obj.content,
'reconciledTime': obj.reconciledTime,
};
}
if (obj is vcproto.Conversation) {
return {
'profile': obj.profile,
'superIdentityJson': obj.superIdentityJson,
'messages': obj.messages
};
}
if (obj is vcproto.ChatMember) {
return {
'remoteIdentityPublicKey': obj.remoteIdentityPublicKey,
'remoteConversationRecordKey': obj.remoteConversationRecordKey,
};
}
if (obj is vcproto.DirectChat) {
return {
'settings': obj.settings,
'localConversationRecordKey': obj.localConversationRecordKey,
'remoteMember': obj.remoteMember,
};
}
if (obj is vcproto.GroupChat) {
return {
'settings': obj.settings,
'membership': obj.membership,
'permissions': obj.permissions,
'localConversationRecordKey': obj.localConversationRecordKey,
'remoteMembers': obj.remoteMembers,
};
}
if (obj is vcproto.Chat) {
return {
'kind': obj.whichKind(),
if (obj.whichKind() == vcproto.Chat_Kind.direct) 'direct': obj.direct,
if (obj.whichKind() == vcproto.Chat_Kind.group) 'group': obj.group,
};
}
if (obj is vcproto.Profile) {
return {
'name': obj.name,
'pronouns': obj.pronouns,
'about': obj.about,
'status': obj.status,
'availability': obj.availability,
'avatar': obj.avatar,
'timestamp': obj.timestamp,
};
}
if (obj is vcproto.Account) {
return {
'profile': obj.profile,
'invisible': obj.invisible,
'autoAwayTimeoutMin': obj.autoAwayTimeoutMin,
'contact_list': obj.contactList,
'contactInvitationRecords': obj.contactInvitationRecords,
'chatList': obj.chatList,
'groupChatList': obj.groupChatList,
'freeMessage': obj.freeMessage,
'busyMessage': obj.busyMessage,
'awayMessage': obj.awayMessage,
'autodetectAway': obj.autodetectAway,
};
}
if (obj is vcproto.Contact) {
return {
'nickname': obj.nickname,
'profile': obj.profile,
'superIdentityJson': obj.superIdentityJson,
'identityPublicKey': obj.identityPublicKey,
'remoteConversationRecordKey': obj.remoteConversationRecordKey,
'localConversationRecordKey': obj.localConversationRecordKey,
'showAvailability': obj.showAvailability,
'notes': obj.notes,
};
}
if (obj is vcproto.ContactInvitation) {
return {
'contactRequestInboxKey': obj.contactRequestInboxKey,
'writerSecret': obj.writerSecret,
};
}
if (obj is vcproto.SignedContactInvitation) {
return {
'contactInvitation': obj.contactInvitation,
'identitySignature': obj.identitySignature,
};
}
if (obj is vcproto.ContactRequest) {
return {
'encryptionKeyType': obj.encryptionKeyType,
'private': obj.private,
};
}
if (obj is vcproto.ContactRequestPrivate) {
return {
'writerKey': obj.writerKey,
'profile': obj.profile,
'superIdentityRecordKey': obj.superIdentityRecordKey,
'chatRecordKey': obj.chatRecordKey,
'expiration': obj.expiration,
};
}
if (obj is vcproto.ContactResponse) {
return {
'accept': obj.accept,
'superIdentityRecordKey': obj.superIdentityRecordKey,
'remoteConversationRecordKey': obj.remoteConversationRecordKey,
};
}
if (obj is vcproto.SignedContactResponse) {
return {
'contactResponse': obj.contactResponse,
'identitySignature': obj.identitySignature,
};
}
if (obj is vcproto.ContactInvitationRecord) {
return {
'contactRequestInbox': obj.contactRequestInbox,
'writerKey': obj.writerKey,
'writerSecret': obj.writerSecret,
'localConversationRecordKey': obj.localConversationRecordKey,
'expiration': obj.expiration,
'invitation': obj.invitation,
'message': obj.message,
'recipient': obj.recipient,
};
}
return obj;
}
DynamicDebug.registerToDebug(toDebug);
}

View file

@ -1216,6 +1216,7 @@ enum Message_Kind {
permissions,
membership,
moderation,
readReceipt,
notSet
}
@ -1234,6 +1235,7 @@ class Message extends $pb.GeneratedMessage {
Message_ControlMembership? membership,
Message_ControlModeration? moderation,
$0.Signature? signature,
Message_ControlReadReceipt? readReceipt,
}) {
final $result = create();
if (id != null) {
@ -1272,6 +1274,9 @@ class Message extends $pb.GeneratedMessage {
if (signature != null) {
$result.signature = signature;
}
if (readReceipt != null) {
$result.readReceipt = readReceipt;
}
return $result;
}
Message._() : super();
@ -1287,10 +1292,11 @@ class Message extends $pb.GeneratedMessage {
9 : Message_Kind.permissions,
10 : Message_Kind.membership,
11 : Message_Kind.moderation,
13 : Message_Kind.readReceipt,
0 : Message_Kind.notSet
};
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Message', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create)
..oo(0, [4, 5, 6, 7, 8, 9, 10, 11])
..oo(0, [4, 5, 6, 7, 8, 9, 10, 11, 13])
..a<$core.List<$core.int>>(1, _omitFieldNames ? '' : 'id', $pb.PbFieldType.OY)
..aOM<$0.TypedKey>(2, _omitFieldNames ? '' : 'author', subBuilder: $0.TypedKey.create)
..a<$fixnum.Int64>(3, _omitFieldNames ? '' : 'timestamp', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO)
@ -1303,6 +1309,7 @@ class Message extends $pb.GeneratedMessage {
..aOM<Message_ControlMembership>(10, _omitFieldNames ? '' : 'membership', subBuilder: Message_ControlMembership.create)
..aOM<Message_ControlModeration>(11, _omitFieldNames ? '' : 'moderation', subBuilder: Message_ControlModeration.create)
..aOM<$0.Signature>(12, _omitFieldNames ? '' : 'signature', subBuilder: $0.Signature.create)
..aOM<Message_ControlReadReceipt>(13, _omitFieldNames ? '' : 'readReceipt', protoName: 'readReceipt', subBuilder: Message_ControlReadReceipt.create)
..hasRequiredFields = false
;
@ -1462,6 +1469,17 @@ class Message extends $pb.GeneratedMessage {
void clearSignature() => clearField(12);
@$pb.TagNumber(12)
$0.Signature ensureSignature() => $_ensure(11);
@$pb.TagNumber(13)
Message_ControlReadReceipt get readReceipt => $_getN(12);
@$pb.TagNumber(13)
set readReceipt(Message_ControlReadReceipt v) { setField(13, v); }
@$pb.TagNumber(13)
$core.bool hasReadReceipt() => $_has(12);
@$pb.TagNumber(13)
void clearReadReceipt() => clearField(13);
@$pb.TagNumber(13)
Message_ControlReadReceipt ensureReadReceipt() => $_ensure(12);
}
/// Locally stored messages for chats

View file

@ -215,6 +215,7 @@ const Message$json = {
{'1': 'permissions', '3': 9, '4': 1, '5': 11, '6': '.veilidchat.Message.ControlPermissions', '9': 0, '10': 'permissions'},
{'1': 'membership', '3': 10, '4': 1, '5': 11, '6': '.veilidchat.Message.ControlMembership', '9': 0, '10': 'membership'},
{'1': 'moderation', '3': 11, '4': 1, '5': 11, '6': '.veilidchat.Message.ControlModeration', '9': 0, '10': 'moderation'},
{'1': 'readReceipt', '3': 13, '4': 1, '5': 11, '6': '.veilidchat.Message.ControlReadReceipt', '9': 0, '10': 'readReceipt'},
{'1': 'signature', '3': 12, '4': 1, '5': 11, '6': '.veilid.Signature', '10': 'signature'},
],
'3': [Message_Text$json, Message_Secret$json, Message_ControlDelete$json, Message_ControlErase$json, Message_ControlSettings$json, Message_ControlPermissions$json, Message_ControlMembership$json, Message_ControlModeration$json, Message_ControlReadReceipt$json],
@ -318,22 +319,24 @@ final $typed_data.Uint8List messageDescriptor = $convert.base64Decode(
'twZXJtaXNzaW9ucxgJIAEoCzImLnZlaWxpZGNoYXQuTWVzc2FnZS5Db250cm9sUGVybWlzc2lv'
'bnNIAFILcGVybWlzc2lvbnMSRwoKbWVtYmVyc2hpcBgKIAEoCzIlLnZlaWxpZGNoYXQuTWVzc2'
'FnZS5Db250cm9sTWVtYmVyc2hpcEgAUgptZW1iZXJzaGlwEkcKCm1vZGVyYXRpb24YCyABKAsy'
'JS52ZWlsaWRjaGF0Lk1lc3NhZ2UuQ29udHJvbE1vZGVyYXRpb25IAFIKbW9kZXJhdGlvbhIvCg'
'lzaWduYXR1cmUYDCABKAsyES52ZWlsaWQuU2lnbmF0dXJlUglzaWduYXR1cmUa5QEKBFRleHQS'
'EgoEdGV4dBgBIAEoCVIEdGV4dBIZCgV0b3BpYxgCIAEoCUgAUgV0b3BpY4gBARIeCghyZXBseV'
'9pZBgDIAEoDEgBUgdyZXBseUlkiAEBEh4KCmV4cGlyYXRpb24YBCABKARSCmV4cGlyYXRpb24S'
'HQoKdmlld19saW1pdBgFIAEoDVIJdmlld0xpbWl0EjgKC2F0dGFjaG1lbnRzGAYgAygLMhYudm'
'VpbGlkY2hhdC5BdHRhY2htZW50UgthdHRhY2htZW50c0IICgZfdG9waWNCCwoJX3JlcGx5X2lk'
'GkgKBlNlY3JldBIeCgpjaXBoZXJ0ZXh0GAEgASgMUgpjaXBoZXJ0ZXh0Eh4KCmV4cGlyYXRpb2'
'4YAiABKARSCmV4cGlyYXRpb24aIQoN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KA1SCXZpZXdMaW1pdBI4Cgth'
'dHRhY2htZW50cxgGIAMoCzIWLnZlaWxpZGNoYXQuQXR0YWNobWVudFILYXR0YWNobWVudHNCCA'
'oGX3RvcGljQgsKCV9yZXBseV9pZBpICgZTZWNyZXQSHgoKY2lwaGVydGV4dBgBIAEoDFIKY2lw'
'aGVydGV4dBIeCgpleHBpcmF0aW9uGAIgASgEUgpleHBpcmF0aW9uGiEKDUNvbnRyb2xEZWxldG'
'USEAoDaWRzGAEgAygMUgNpZHMaLAoMQ29udHJvbEVyYXNlEhwKCXRpbWVzdGFtcBgBIAEoBFIJ'
'dGltZXN0YW1wGkcKD0NvbnRyb2xTZXR0aW5ncxI0CghzZXR0aW5ncxgBIAEoCzIYLnZlaWxpZG'
'NoYXQuQ2hhdFNldHRpbmdzUghzZXR0aW5ncxpPChJDb250cm9sUGVybWlzc2lvbnMSOQoLcGVy'
'bWlzc2lvbnMYASABKAsyFy52ZWlsaWRjaGF0LlBlcm1pc3Npb25zUgtwZXJtaXNzaW9ucxpLCh'
'FDb250cm9sTWVtYmVyc2hpcBI2CgptZW1iZXJzaGlwGAEgASgLMhYudmVpbGlkY2hhdC5NZW1i'
'ZXJzaGlwUgptZW1iZXJzaGlwGlkKEUNvbnRyb2xNb2RlcmF0aW9uEiEKDGFjY2VwdGVkX2lkcx'
'gBIAMoDFILYWNjZXB0ZWRJZHMSIQoMcmVqZWN0ZWRfaWRzGAIgAygMUgtyZWplY3RlZElkcxov'
'ChJDb250cm9sUmVhZFJlY2VpcHQSGQoIcmVhZF9pZHMYASADKAxSB3JlYWRJZHNCBgoEa2luZA'
'==');
@$core.Deprecated('Use reconciledMessageDescriptor instead')
const ReconciledMessage$json = {

View file

@ -228,6 +228,7 @@ message Message {
ControlPermissions permissions = 9;
ControlMembership membership = 10;
ControlModeration moderation = 11;
ControlReadReceipt readReceipt = 13;
}
// Author signature over all of the fields and attachment signatures