adding usermessage answer_to_usermessage in status
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc 2024-03-02 18:05:13 +01:00
parent 1ba84dcefc
commit cba13ad91a
3 changed files with 49 additions and 36 deletions

View File

@ -103,7 +103,8 @@ func (p *Peer) BuildSimpleUserMessage(message []byte) (*meowlib.UserMessage, err
msg.Data = message msg.Data = message
msg.Type = "1" msg.Type = "1"
msg.Status = &meowlib.ConversationStatus{} msg.Status = &meowlib.ConversationStatus{}
msg.Status.LocalUuid = uuid.New().String() msg.Status.Uuid = uuid.New().String()
return &msg, nil return &msg, nil
} }
@ -144,7 +145,7 @@ func (p *Peer) BuildSingleFileMessage(filename string, message []byte) ([]meowli
msg.Type = "2" msg.Type = "2"
if chunk == 0 { if chunk == 0 {
msg.Status = &meowlib.ConversationStatus{} msg.Status = &meowlib.ConversationStatus{}
msg.Status.LocalUuid = uuid.New().String() msg.Status.Uuid = uuid.New().String()
} }
msgs = append(msgs, msg) msgs = append(msgs, msg)
chunk++ chunk++

View File

@ -1034,13 +1034,14 @@ type ConversationStatus struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
LocalUuid string `protobuf:"bytes,1,opt,name=localUuid,proto3" json:"localUuid,omitempty"` Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
LocalSequence uint64 `protobuf:"varint,2,opt,name=localSequence,proto3" json:"localSequence,omitempty"` AnswerToUuid string `protobuf:"bytes,2,opt,name=answer_to_uuid,json=answerToUuid,proto3" json:"answer_to_uuid,omitempty"` // message is an answer to another one, specify uuid here
Sent uint64 `protobuf:"varint,3,opt,name=sent,proto3" json:"sent,omitempty"` LocalSequence uint64 `protobuf:"varint,3,opt,name=localSequence,proto3" json:"localSequence,omitempty"`
Received uint64 `protobuf:"varint,4,opt,name=received,proto3" json:"received,omitempty"` Sent uint64 `protobuf:"varint,4,opt,name=sent,proto3" json:"sent,omitempty"`
Processed uint64 `protobuf:"varint,5,opt,name=processed,proto3" json:"processed,omitempty"` Received uint64 `protobuf:"varint,5,opt,name=received,proto3" json:"received,omitempty"`
MyNextIdentity *ContactCard `protobuf:"bytes,6,opt,name=myNextIdentity,proto3" json:"myNextIdentity,omitempty"` Processed uint64 `protobuf:"varint,6,opt,name=processed,proto3" json:"processed,omitempty"`
PeerNextIdentityAck int32 `protobuf:"varint,7,opt,name=peerNextIdentityAck,proto3" json:"peerNextIdentityAck,omitempty"` // version of the new peer accepted id MyNextIdentity *ContactCard `protobuf:"bytes,7,opt,name=my_next_identity,json=myNextIdentity,proto3" json:"my_next_identity,omitempty"`
PeerNextIdentityAck int32 `protobuf:"varint,8,opt,name=peer_next_identityAck,json=peerNextIdentityAck,proto3" json:"peer_next_identityAck,omitempty"` // version of the new peer accepted id
} }
func (x *ConversationStatus) Reset() { func (x *ConversationStatus) Reset() {
@ -1075,9 +1076,16 @@ func (*ConversationStatus) Descriptor() ([]byte, []int) {
return file_messages_proto_rawDescGZIP(), []int{12} return file_messages_proto_rawDescGZIP(), []int{12}
} }
func (x *ConversationStatus) GetLocalUuid() string { func (x *ConversationStatus) GetUuid() string {
if x != nil { if x != nil {
return x.LocalUuid return x.Uuid
}
return ""
}
func (x *ConversationStatus) GetAnswerToUuid() string {
if x != nil {
return x.AnswerToUuid
} }
return "" return ""
} }
@ -1737,23 +1745,25 @@ var file_messages_proto_rawDesc = []byte{
0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x28, 0x0a, 0x0f,
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18,
0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, 0x6d,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x96, 0x02, 0x0a, 0x12, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xb6, 0x02, 0x0a, 0x12, 0x43, 0x6f, 0x6e, 0x76, 0x65,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a,
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x55, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69,
0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x55, 0x75, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x5f, 0x75,
0x6f, 0x63, 0x61, 0x6c, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x6e, 0x73, 0x77, 0x65,
0x28, 0x04, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x72, 0x54, 0x6f, 0x55, 0x75, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d,
0x04, 0x73, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a,
0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x04, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x65, 0x6e,
0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x05, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20,
0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x12, 0x01, 0x28, 0x04, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x1c, 0x0a,
0x3c, 0x0a, 0x0e, 0x6d, 0x79, 0x4e, 0x65, 0x78, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04,
0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x12, 0x3e, 0x0a, 0x10, 0x6d,
0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x52, 0x0e, 0x6d, 0x79, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18,
0x79, 0x4e, 0x65, 0x78, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x30, 0x0a, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e,
0x13, 0x70, 0x65, 0x65, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x52, 0x0e, 0x6d, 0x79, 0x4e,
0x79, 0x41, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, 0x70, 0x65, 0x65, 0x72, 0x65, 0x78, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x32, 0x0a, 0x15, 0x70,
0x65, 0x65, 0x72, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74,
0x79, 0x41, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, 0x70, 0x65, 0x65, 0x72,
0x4e, 0x65, 0x78, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x63, 0x6b, 0x22, 0x4e, 0x65, 0x78, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x63, 0x6b, 0x22,
0x4b, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x4b, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x07,
@ -1881,7 +1891,7 @@ var file_messages_proto_depIdxs = []int32{
7, // 11: meowlib.Matriochka.prev:type_name -> meowlib.MatriochkaServer 7, // 11: meowlib.Matriochka.prev:type_name -> meowlib.MatriochkaServer
7, // 12: meowlib.Matriochka.next:type_name -> meowlib.MatriochkaServer 7, // 12: meowlib.Matriochka.next:type_name -> meowlib.MatriochkaServer
9, // 13: meowlib.ContactCard.pull_servers:type_name -> meowlib.ServerCard 9, // 13: meowlib.ContactCard.pull_servers:type_name -> meowlib.ServerCard
10, // 14: meowlib.ConversationStatus.myNextIdentity:type_name -> meowlib.ContactCard 10, // 14: meowlib.ConversationStatus.my_next_identity:type_name -> meowlib.ContactCard
10, // 15: meowlib.Group.members:type_name -> meowlib.ContactCard 10, // 15: meowlib.Group.members:type_name -> meowlib.ContactCard
12, // 16: meowlib.UserMessage.Status:type_name -> meowlib.ConversationStatus 12, // 16: meowlib.UserMessage.Status:type_name -> meowlib.ConversationStatus
10, // 17: meowlib.UserMessage.contact:type_name -> meowlib.ContactCard 10, // 17: meowlib.UserMessage.contact:type_name -> meowlib.ContactCard

View File

@ -138,13 +138,14 @@ message PackedUserMessage {
} }
message ConversationStatus { message ConversationStatus {
string localUuid = 1; string uuid = 1;
uint64 localSequence = 2 ; string answer_to_uuid=2; // message is an answer to another one, specify uuid here
uint64 sent = 3 ; uint64 localSequence = 3 ;
uint64 received = 4; uint64 sent = 4 ;
uint64 processed = 5; uint64 received = 5;
ContactCard myNextIdentity = 6; uint64 processed = 6;
int32 peerNextIdentityAck = 7; // version of the new peer accepted id ContactCard my_next_identity = 7;
int32 peer_next_identityAck = 8; // version of the new peer accepted id
} }
message Group{ message Group{
@ -166,6 +167,7 @@ message UserMessage {
Location currentLocation = 10; Location currentLocation = 10;
bytes appdata = 11; bytes appdata = 11;
Invitation invitation = 12; Invitation invitation = 12;
} }
message File { message File {