diff --git a/client/dbmessage.go b/client/dbmessage.go index d988381..aea2407 100644 --- a/client/dbmessage.go +++ b/client/dbmessage.go @@ -20,6 +20,8 @@ func DbMessageToInternalUserMessage(id int64, dbFile string, dbm *meowlib.DbMess ium.Messagetype = dbm.Type ium.Appdata = dbm.Appdata ium.FilePaths = dbm.FilePaths + ium.ServerDeliveryUuid = dbm.ServerDeliveryUuid + ium.ServerDeliveryTimestamp = dbm.ServerDeliveryTimestamp return &ium } @@ -33,6 +35,8 @@ func InternalUserMessageToDbMessage(ium *InternalUserMessage) *meowlib.DbMessage dbm.CurrentLocation = ium.CurrentLocation dbm.Status = ium.Status dbm.FilePaths = ium.FilePaths + dbm.ServerDeliveryUuid = ium.ServerDeliveryUuid + dbm.ServerDeliveryTimestamp = ium.ServerDeliveryTimestamp return &dbm } diff --git a/client/helpers/networkHelper.go b/client/helpers/networkHelper.go index 4ca8246..cf49f78 100644 --- a/client/helpers/networkHelper.go +++ b/client/helpers/networkHelper.go @@ -1,5 +1,6 @@ package helpers +/* import ( "forge.redroom.link/yves/meowlib" "forge.redroom.link/yves/meowlib/client" @@ -28,3 +29,4 @@ func HttpSendMessage(serverUid string, message []byte, timeout int) ([]byte, err } return response, nil } +*/ diff --git a/client/internalusermessage.go b/client/internalusermessage.go index d84f260..39ff647 100644 --- a/client/internalusermessage.go +++ b/client/internalusermessage.go @@ -9,7 +9,7 @@ type InternalUserMessage struct { Status *meowlib.ConversationStatus `json:"conversation_status,omitempty"` Contact *meowlib.ContactCard `json:"contact,omitempty"` ServerDeliveryUuid string `json:"server_delivery_uuid,omitempty"` - ServerDeliveryTimestamp int64 `json:"server_delivery_timestamp,omitempty"` + ServerDeliveryTimestamp uint64 `json:"server_delivery_timestamp,omitempty"` //Group group FilePaths []string `json:"file_paths,omitempty"` CurrentLocation *meowlib.Location `json:"current_location,omitempty"` diff --git a/messages.pb.go b/messages.pb.go index 787fefc..37ce1ac 100644 --- a/messages.pb.go +++ b/messages.pb.go @@ -1503,20 +1503,22 @@ func (x *Location) GetAltitude() int32 { } type DbMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Outbound bool `protobuf:"varint,1,opt,name=outbound,proto3" json:"outbound,omitempty"` // direction of the message - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // text data - Status *ConversationStatus `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` - Contact *ContactCard `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` - Group *Group `protobuf:"bytes,6,opt,name=group,proto3" json:"group,omitempty"` - FilePaths []string `protobuf:"bytes,7,rep,name=file_paths,json=filePaths,proto3" json:"file_paths,omitempty"` - CurrentLocation *Location `protobuf:"bytes,8,opt,name=current_location,json=currentLocation,proto3" json:"current_location,omitempty"` - Appdata []byte `protobuf:"bytes,9,opt,name=appdata,proto3" json:"appdata,omitempty"` - Invitation *Invitation `protobuf:"bytes,10,opt,name=invitation,proto3" json:"invitation,omitempty"` - From string `protobuf:"bytes,11,opt,name=from,proto3" json:"from,omitempty"` // source peer uid, used when storing group conversations with more than one peer - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Outbound bool `protobuf:"varint,1,opt,name=outbound,proto3" json:"outbound,omitempty"` // direction of the message + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // text data + Status *ConversationStatus `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` + Contact *ContactCard `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` + Group *Group `protobuf:"bytes,6,opt,name=group,proto3" json:"group,omitempty"` + FilePaths []string `protobuf:"bytes,7,rep,name=file_paths,json=filePaths,proto3" json:"file_paths,omitempty"` + CurrentLocation *Location `protobuf:"bytes,8,opt,name=current_location,json=currentLocation,proto3" json:"current_location,omitempty"` + Appdata []byte `protobuf:"bytes,9,opt,name=appdata,proto3" json:"appdata,omitempty"` + Invitation *Invitation `protobuf:"bytes,10,opt,name=invitation,proto3" json:"invitation,omitempty"` + From string `protobuf:"bytes,11,opt,name=from,proto3" json:"from,omitempty"` // source peer uid, used when storing group conversations with more than one peer + ServerDeliveryUuid string `protobuf:"bytes,12,opt,name=server_delivery_uuid,json=serverDeliveryUuid,proto3" json:"server_delivery_uuid,omitempty"` // uuid returned by the server upon delivery + ServerDeliveryTimestamp uint64 `protobuf:"varint,13,opt,name=server_delivery_timestamp,json=serverDeliveryTimestamp,proto3" json:"server_delivery_timestamp,omitempty"` // timestamp of the server delivery + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DbMessage) Reset() { @@ -1626,6 +1628,20 @@ func (x *DbMessage) GetFrom() string { return "" } +func (x *DbMessage) GetServerDeliveryUuid() string { + if x != nil { + return x.ServerDeliveryUuid + } + return "" +} + +func (x *DbMessage) GetServerDeliveryTimestamp() uint64 { + if x != nil { + return x.ServerDeliveryTimestamp + } + return 0 +} + type VideoData struct { state protoimpl.MessageState `protogen:"open.v1"` Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` @@ -1909,7 +1925,7 @@ const file_messages_proto_rawDesc = "" + "\x04time\x18\x01 \x01(\x04R\x04time\x12\x1a\n" + "\blatitude\x18\x02 \x01(\x02R\blatitude\x12\x1c\n" + "\tlongitude\x18\x03 \x01(\x02R\tlongitude\x12\x1a\n" + - "\baltitude\x18\x04 \x01(\x05R\baltitude\"\x9a\x03\n" + + "\baltitude\x18\x04 \x01(\x05R\baltitude\"\x88\x04\n" + "\tDbMessage\x12\x1a\n" + "\boutbound\x18\x01 \x01(\bR\boutbound\x12\x12\n" + "\x04type\x18\x02 \x01(\tR\x04type\x12\x12\n" + @@ -1925,7 +1941,9 @@ const file_messages_proto_rawDesc = "" + "invitation\x18\n" + " \x01(\v2\x13.meowlib.InvitationR\n" + "invitation\x12\x12\n" + - "\x04from\x18\v \x01(\tR\x04from\"\xaa\x01\n" + + "\x04from\x18\v \x01(\tR\x04from\x120\n" + + "\x14server_delivery_uuid\x18\f \x01(\tR\x12serverDeliveryUuid\x12:\n" + + "\x19server_delivery_timestamp\x18\r \x01(\x04R\x17serverDeliveryTimestamp\"\xaa\x01\n" + "\tVideoData\x12\x10\n" + "\x03url\x18\x01 \x01(\tR\x03url\x12\x12\n" + "\x04room\x18\x02 \x01(\tR\x04room\x12\x1a\n" + diff --git a/pb/messages.proto b/pb/messages.proto index 114d3ba..ed32bfd 100644 --- a/pb/messages.proto +++ b/pb/messages.proto @@ -207,16 +207,18 @@ message Location { message DbMessage { bool outbound = 1; // direction of the message - string type = 2; + string type = 2; bytes data = 3; // text data ConversationStatus status = 4; ContactCard contact = 5; Group group = 6; repeated string file_paths = 7; Location current_location = 8; - bytes appdata = 9; + bytes appdata = 9; Invitation invitation = 10; string from = 11; // source peer uid, used when storing group conversations with more than one peer + string server_delivery_uuid = 12; // uuid returned by the server upon delivery + uint64 server_delivery_timestamp = 13; // timestamp of the server delivery } message VideoData {