diff --git a/client/identity.go b/client/identity.go index 11792d8..67de237 100644 --- a/client/identity.go +++ b/client/identity.go @@ -11,17 +11,21 @@ import ( ) type Identity struct { - Nickname string `json:"nickname,omitempty"` - RootKp meowlib.KeyPair `json:"id_kp,omitempty"` - Status string `json:"status,omitempty"` - Peers PeerList `json:"peers,omitempty"` - KnownServers InternalServerList `json:"known_servers,omitempty"` - MessageServers InternalServerList `json:"message_servers,omitempty"` - ArchiveServers InternalServerList `json:"archive_servers,omitempty"` - OwnedServers InternalServerList `json:"owned_servers,omitempty"` - DefaultDbPassword string `json:"default_db_password,omitempty"` - DbPasswordStore bool `json:"db_password_store,omitempty"` - OwnedDevices PeerList `json:"owned_devices,omitempty"` + Nickname string `json:"nickname,omitempty"` + RootKp meowlib.KeyPair `json:"id_kp,omitempty"` + Status string `json:"status,omitempty"` + Peers PeerList `json:"peers,omitempty"` + HiddenPeers [][]byte `json:"hiddend_peers,omitempty"` + Device meowlib.KeyPair `json:"device,omitempty"` + KnownServers InternalServerList `json:"known_servers,omitempty"` + MessageServers InternalServerList `json:"message_servers,omitempty"` + ArchiveServers InternalServerList `json:"archive_servers,omitempty"` + OwnedServers InternalServerList `json:"owned_servers,omitempty"` + DefaultDbPassword string `json:"default_db_password,omitempty"` + DbPasswordStore bool `json:"db_password_store,omitempty"` + OwnedDevices PeerList `json:"owned_devices,omitempty"` + StaticMtkServerPaths []InternalServerList `json:"static_mtk_server_paths,omitempty"` + DynamicMtkServeRules []string `json:"dynamic_mtk_serve_rules,omitempty"` } func CreateIdentity(nickname string) *Identity { diff --git a/client/matriochka.go b/client/matriochka.go new file mode 100644 index 0000000..d8b5727 --- /dev/null +++ b/client/matriochka.go @@ -0,0 +1,51 @@ +package client + +import ( + "forge.redroom.link/yves/meowlib" + "github.com/google/uuid" +) + +func ProcessForOutput(usermessage *meowlib.UserMessage, peer *Peer, servers *InternalServerList, trackingLookupKey string) ([]byte, error) { + lastIdx := len(servers.Servers) - 1 + // LAST SERVER : Message delivery as usual + srv := &servers.Servers[lastIdx] + // Prepare cyphered + packed user message + packedMsg, err := peer.ProcessOutboundUserMessage(usermessage) + if err != nil { + return nil, err + } + // Creating Server message for transporting the user message + toServerMessage := srv.BuildToServerMessageFromUserMessage(packedMsg) + lastmsg, err := srv.ProcessOutboundMessage(toServerMessage) + if err != nil { + return nil, err + } + lastuuid := uuid.NewString() + // ALL PREVIOUS SERVERS + for i := lastIdx - 1; i >= 0; i-- { + srv = &servers.Servers[i] + var toServerMessage meowlib.ToServerMessage + toServerMessage.MatriochkaMessage.Data = lastmsg + toServerMessage.MatriochkaMessage.Next.Url = servers.Servers[i+1].ServerData.Url + toServerMessage.MatriochkaMessage.Next.PublicKey = servers.Servers[i+1].ServerData.PublicKey + toServerMessage.MatriochkaMessage.Next.Delay = int32(servers.Servers[i+1].AllowedDelay) + if trackingLookupKey != "" { + toServerMessage.MatriochkaMessage.Next.Uuid = lastuuid // change tracking uuid at each server + if i > 0 { + toServerMessage.MatriochkaMessage.Prev.Url = servers.Servers[i-1].ServerData.Url + toServerMessage.MatriochkaMessage.Prev.PublicKey = servers.Servers[i+1].ServerData.PublicKey + toServerMessage.MatriochkaMessage.Prev.Delay = int32(servers.Servers[i-1].AllowedDelay) + toServerMessage.MatriochkaMessage.Prev.Uuid = uuid.NewString() + lastuuid = toServerMessage.MatriochkaMessage.Prev.Uuid + } else { // for first message, no previous tracking but a lookupkey to stack the tracking messages + toServerMessage.MatriochkaMessage.LookupKey = trackingLookupKey + } + } + lastmsg, err = srv.ProcessOutboundMessage(&toServerMessage) + if err != nil { + return nil, err + } + } + + return lastmsg, nil +} diff --git a/client/server.go b/client/server.go index 08207be..e251843 100644 --- a/client/server.go +++ b/client/server.go @@ -10,13 +10,15 @@ import ( ) type InternalServer struct { - ServerData meowlib.Server `json:"server_data,omitempty"` - Presence bool `json:"presence,omitempty"` - LastCheck time.Time `json:"last_check,omitempty"` - Uptime time.Duration `json:"uptime,omitempty"` - Login string `json:"login,omitempty"` - Password string `json:"password,omitempty"` - Me meowlib.KeyPair `json:"me,omitempty"` + ServerData meowlib.Server `json:"server_data,omitempty"` + Presence bool `json:"presence,omitempty"` + LastCheck time.Time `json:"last_check,omitempty"` + Uptime time.Duration `json:"uptime,omitempty"` + Login string `json:"login,omitempty"` + Password string `json:"password,omitempty"` + Me meowlib.KeyPair `json:"me,omitempty"` + Country string `json:"country,omitempty"` + AllowedDelay int `json:"allowed_delay,omitempty"` } type InternalServerList struct { diff --git a/doc/protocol.tex b/doc/protocol.tex index 5392d9e..461c8b0 100644 --- a/doc/protocol.tex +++ b/doc/protocol.tex @@ -35,14 +35,15 @@ No phone number or email check will be performed, unlike main instant messaging \subsubsection{Trustable server based communication} Like most widely available messaging softwares, (Whatsapp, Signal, Viber, Telegram...), \textffm{Meow} provides a simple server based messaging. -The main difference is it allows to explicitly choose which server you want to use. +The main difference is that \textffm{Meow} allows you to explicitly choose which server you want to use. The server code being open source, we strongly encourage you to run your own server at home or in your company. The server requires very few ressources and will run on any low cost single board computer. \subsubsection{Anonymized message transfer} -\textffm{Meow} also provides an anonymizing transfer services very similar to the Tor Onion protocol, we call it the Matriochka protocol. +\textffm{Meow} also provides an anonymizing transfer service very similar to the Tor Onion protocol, we call it the Matriochka protocol. Any server can be used for building the transfer chain. Some of them might be marked as trusted. +Random delays might be set for each forwarding step, making the overall message tracking much more difficult, even with a global network audit. It is strongly advised to use trusted servers as your first node and message server (the one that holds your incoming messages). \subsubsection{Presence protocol for direct messaging} @@ -58,6 +59,22 @@ You might define specific communication privacy preferences for each of your con \item required matriochka protocol for Edward, first node is one of my trusted servers, my message node is my own server, randomly switch from trusted server lists for others. \item ... \end{itemize} + +\subsubsection{Resistance to device requisition} +All your contact information and discussion are encrypted on the device and password protected. +Password shall be asked on application startup and allows your identity file and contact decrytion. +That password is not recoverable, so you can't forget it, or you'll loose your whole configuration and identity. +Real security implies some constraints. +You might configure the app to save your password, but that is a security flaw. +In many authoritarian countries, you are required by law to provide your device passwords to authorities. +In a \textffm{Meow} device, you might set a special password for specific contacts. +Those contacts won't be visible when entering your main identity password. +You'll have to type their specific password in order to make them visible. +The \textffm{Meow} application will by default create a random set of fake hidden contacts and conversations. +Even in case of device storage analysis, authorities won't be able to differentiate a real hidden contact from an normal fake generated one. +It could be argued that this feature puts every user at risk, because authorities might think you're hiding something, even if you're not. +As every \textffm{Meow} user has the same constraint, users are not responsible for that. Moreover solidarity is also a requirement for real security. + \subsection{Multiple devices support} \textffm{Meow} allows you to be connected from multiple devices and offers chat synchronization capability. A device might be revoqued anytime from any other one. Proof of your identity (password or other) shall be provided in order to grant device revocation. @@ -84,7 +101,6 @@ A local (server based) emergency broadcast service will be provided. It will pro \textffm{Meow} may run without Internet connection, either on an isolated wifi access point, or on a meshed network of wifi routers or even via serial IOT transport layers (LoRa,...) - \subsection{User directory service} This service allows to restore a lost functionality of Internet historic chat services (like ICQ). You could simply set a "Free for chat" status that would allow other people to contact you, either randomly or based on a short description that you might provide. Why providing that service while the internet is suffocating due to the abundance of social networks ?\\ @@ -94,7 +110,7 @@ Well, that option offers a few advantages : \item no social network algorithm will select people that think/behave/vote/eat... just like you. Diversity makes a better world; \item a smaller community of users, skilled enough to operate a \textffm{Meow} chat app... that might provide a first filter; It's a bit like in the old times, when people had to be able to start a win98 computer, connect it to internet, then download and install ICQ... - If you lost some time in social networks, and experienced ICQ in the 2000's, you know what I mean. + If you lost some time in social networks, and experienced ICQ in the 2000's, you'll understand. \end{itemize} \section{Identities and keys} diff --git a/messages.pb.go b/messages.pb.go index 5878a8f..3badc90 100644 --- a/messages.pb.go +++ b/messages.pb.go @@ -90,13 +90,14 @@ type ToServerMessage struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Type 1 : final destination / 2 : forward - From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` // My pub key for the server to send me an encrypter answer - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` // optional payload for server - PullRequest []*ToServerMessage_ConversationRequest `protobuf:"bytes,4,rep,name=pullRequest,proto3" json:"pullRequest,omitempty"` - Messages []*PackedUserMessage `protobuf:"bytes,5,rep,name=messages,proto3" json:"messages,omitempty"` - KnownServers []*Server `protobuf:"bytes,6,rep,name=knownServers,proto3" json:"knownServers,omitempty"` - Uuid string `protobuf:"bytes,7,opt,name=uuid,proto3" json:"uuid,omitempty"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Type 1 : final destination / 2 : forward + From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` // My pub key for the server to send me an encrypter answer + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` // optional payload for server + PullRequest []*ToServerMessage_ConversationRequest `protobuf:"bytes,4,rep,name=pullRequest,proto3" json:"pullRequest,omitempty"` + Messages []*PackedUserMessage `protobuf:"bytes,5,rep,name=messages,proto3" json:"messages,omitempty"` + KnownServers []*Server `protobuf:"bytes,6,rep,name=knownServers,proto3" json:"knownServers,omitempty"` + MatriochkaMessage *Matriochka `protobuf:"bytes,7,opt,name=matriochkaMessage,proto3" json:"matriochkaMessage,omitempty"` + Uuid string `protobuf:"bytes,8,opt,name=uuid,proto3" json:"uuid,omitempty"` } func (x *ToServerMessage) Reset() { @@ -173,6 +174,13 @@ func (x *ToServerMessage) GetKnownServers() []*Server { return nil } +func (x *ToServerMessage) GetMatriochkaMessage() *Matriochka { + if x != nil { + return x.MatriochkaMessage + } + return nil +} + func (x *ToServerMessage) GetUuid() string { if x != nil { return x.Uuid @@ -276,6 +284,148 @@ func (x *FromServerMessage) GetKnownServers() []*Server { return nil } +type MatriochkaServer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // Server Url + PublicKey string `protobuf:"bytes,2,opt,name=publicKey,proto3" json:"publicKey,omitempty"` // Server Public Key + Uuid string `protobuf:"bytes,3,opt,name=uuid,proto3" json:"uuid,omitempty"` // Optional, uuid for delivery confirmation + Delay int32 `protobuf:"varint,4,opt,name=delay,proto3" json:"delay,omitempty"` // Max delay requested for message forwarding or delivery tracking +} + +func (x *MatriochkaServer) Reset() { + *x = MatriochkaServer{} + if protoimpl.UnsafeEnabled { + mi := &file_messages_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MatriochkaServer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MatriochkaServer) ProtoMessage() {} + +func (x *MatriochkaServer) ProtoReflect() protoreflect.Message { + mi := &file_messages_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MatriochkaServer.ProtoReflect.Descriptor instead. +func (*MatriochkaServer) Descriptor() ([]byte, []int) { + return file_messages_proto_rawDescGZIP(), []int{3} +} + +func (x *MatriochkaServer) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *MatriochkaServer) GetPublicKey() string { + if x != nil { + return x.PublicKey + } + return "" +} + +func (x *MatriochkaServer) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *MatriochkaServer) GetDelay() int32 { + if x != nil { + return x.Delay + } + return 0 +} + +type Matriochka struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LookupKey string `protobuf:"bytes,1,opt,name=lookupKey,proto3" json:"lookupKey,omitempty"` // Optional, only if you want delivery tracking, less stealth + Prev *MatriochkaServer `protobuf:"bytes,2,opt,name=prev,proto3" json:"prev,omitempty"` // Optional, like above + Next *MatriochkaServer `protobuf:"bytes,3,opt,name=next,proto3" json:"next,omitempty"` // Next server to deliver the message to + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` // Matriochka data +} + +func (x *Matriochka) Reset() { + *x = Matriochka{} + if protoimpl.UnsafeEnabled { + mi := &file_messages_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Matriochka) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Matriochka) ProtoMessage() {} + +func (x *Matriochka) ProtoReflect() protoreflect.Message { + mi := &file_messages_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Matriochka.ProtoReflect.Descriptor instead. +func (*Matriochka) Descriptor() ([]byte, []int) { + return file_messages_proto_rawDescGZIP(), []int{4} +} + +func (x *Matriochka) GetLookupKey() string { + if x != nil { + return x.LookupKey + } + return "" +} + +func (x *Matriochka) GetPrev() *MatriochkaServer { + if x != nil { + return x.Prev + } + return nil +} + +func (x *Matriochka) GetNext() *MatriochkaServer { + if x != nil { + return x.Next + } + return nil +} + +func (x *Matriochka) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + // structure describing required server attributes type Server struct { state protoimpl.MessageState @@ -287,14 +437,14 @@ type Server struct { PublicKey string `protobuf:"bytes,3,opt,name=publicKey,proto3" json:"publicKey,omitempty"` Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` Publish bool `protobuf:"varint,5,opt,name=publish,proto3" json:"publish,omitempty"` // publish this server when asked for a list by server - Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` // signature of all previous field by the server itself + Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` // signature of all previous fields by the server itself ConfidenceLevel int32 `protobuf:"varint,7,opt,name=confidenceLevel,proto3" json:"confidenceLevel,omitempty"` // additional info from the user } func (x *Server) Reset() { *x = Server{} if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[3] + mi := &file_messages_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -307,7 +457,7 @@ func (x *Server) String() string { func (*Server) ProtoMessage() {} func (x *Server) ProtoReflect() protoreflect.Message { - mi := &file_messages_proto_msgTypes[3] + mi := &file_messages_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -320,7 +470,7 @@ func (x *Server) ProtoReflect() protoreflect.Message { // Deprecated: Use Server.ProtoReflect.Descriptor instead. func (*Server) Descriptor() ([]byte, []int) { - return file_messages_proto_rawDescGZIP(), []int{3} + return file_messages_proto_rawDescGZIP(), []int{5} } func (x *Server) GetName() string { @@ -390,7 +540,7 @@ type ContactCard struct { func (x *ContactCard) Reset() { *x = ContactCard{} if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[4] + mi := &file_messages_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -403,7 +553,7 @@ func (x *ContactCard) String() string { func (*ContactCard) ProtoMessage() {} func (x *ContactCard) ProtoReflect() protoreflect.Message { - mi := &file_messages_proto_msgTypes[4] + mi := &file_messages_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -416,7 +566,7 @@ func (x *ContactCard) ProtoReflect() protoreflect.Message { // Deprecated: Use ContactCard.ProtoReflect.Descriptor instead. func (*ContactCard) Descriptor() ([]byte, []int) { - return file_messages_proto_rawDescGZIP(), []int{4} + return file_messages_proto_rawDescGZIP(), []int{6} } func (x *ContactCard) GetName() string { @@ -483,7 +633,7 @@ type PackedUserMessage struct { func (x *PackedUserMessage) Reset() { *x = PackedUserMessage{} if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[5] + mi := &file_messages_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -496,7 +646,7 @@ func (x *PackedUserMessage) String() string { func (*PackedUserMessage) ProtoMessage() {} func (x *PackedUserMessage) ProtoReflect() protoreflect.Message { - mi := &file_messages_proto_msgTypes[5] + mi := &file_messages_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -509,7 +659,7 @@ func (x *PackedUserMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PackedUserMessage.ProtoReflect.Descriptor instead. func (*PackedUserMessage) Descriptor() ([]byte, []int) { - return file_messages_proto_rawDescGZIP(), []int{5} + return file_messages_proto_rawDescGZIP(), []int{7} } func (x *PackedUserMessage) GetDestination() string { @@ -560,7 +710,7 @@ type UserMessage struct { func (x *UserMessage) Reset() { *x = UserMessage{} if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[6] + mi := &file_messages_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -573,7 +723,7 @@ func (x *UserMessage) String() string { func (*UserMessage) ProtoMessage() {} func (x *UserMessage) ProtoReflect() protoreflect.Message { - mi := &file_messages_proto_msgTypes[6] + mi := &file_messages_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -586,7 +736,7 @@ func (x *UserMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use UserMessage.ProtoReflect.Descriptor instead. func (*UserMessage) Descriptor() ([]byte, []int) { - return file_messages_proto_rawDescGZIP(), []int{6} + return file_messages_proto_rawDescGZIP(), []int{8} } func (x *UserMessage) GetDestination() string { @@ -666,7 +816,7 @@ type File struct { func (x *File) Reset() { *x = File{} if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[7] + mi := &file_messages_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -679,7 +829,7 @@ func (x *File) String() string { func (*File) ProtoMessage() {} func (x *File) ProtoReflect() protoreflect.Message { - mi := &file_messages_proto_msgTypes[7] + mi := &file_messages_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -692,7 +842,7 @@ func (x *File) ProtoReflect() protoreflect.Message { // Deprecated: Use File.ProtoReflect.Descriptor instead. func (*File) Descriptor() ([]byte, []int) { - return file_messages_proto_rawDescGZIP(), []int{7} + return file_messages_proto_rawDescGZIP(), []int{9} } func (x *File) GetFilename() string { @@ -738,7 +888,7 @@ type ToServerMessage_ConversationRequest struct { func (x *ToServerMessage_ConversationRequest) Reset() { *x = ToServerMessage_ConversationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[8] + mi := &file_messages_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -751,7 +901,7 @@ func (x *ToServerMessage_ConversationRequest) String() string { func (*ToServerMessage_ConversationRequest) ProtoMessage() {} func (x *ToServerMessage_ConversationRequest) ProtoReflect() protoreflect.Message { - mi := &file_messages_proto_msgTypes[8] + mi := &file_messages_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -806,7 +956,7 @@ type FromServerMessage_ConversationResponse struct { func (x *FromServerMessage_ConversationResponse) Reset() { *x = FromServerMessage_ConversationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[9] + mi := &file_messages_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -819,7 +969,7 @@ func (x *FromServerMessage_ConversationResponse) String() string { func (*FromServerMessage_ConversationResponse) ProtoMessage() {} func (x *FromServerMessage_ConversationResponse) ProtoReflect() protoreflect.Message { - mi := &file_messages_proto_msgTypes[9] + mi := &file_messages_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -853,13 +1003,13 @@ type UserMessage_ConversationStatus struct { Received uint64 `protobuf:"varint,4,opt,name=received,proto3" json:"received,omitempty"` Processed uint64 `protobuf:"varint,5,opt,name=processed,proto3" json:"processed,omitempty"` MyNextIdentity *ContactCard `protobuf:"bytes,6,opt,name=myNextIdentity,proto3" json:"myNextIdentity,omitempty"` - PeerNextIdentityAck int32 `protobuf:"varint,7,opt,name=peerNextIdentityAck,proto3" json:"peerNextIdentityAck,omitempty"` // version of the new peed accepted id + PeerNextIdentityAck int32 `protobuf:"varint,7,opt,name=peerNextIdentityAck,proto3" json:"peerNextIdentityAck,omitempty"` // version of the new peer accepted id } func (x *UserMessage_ConversationStatus) Reset() { *x = UserMessage_ConversationStatus{} if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[10] + mi := &file_messages_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -872,7 +1022,7 @@ func (x *UserMessage_ConversationStatus) String() string { func (*UserMessage_ConversationStatus) ProtoMessage() {} func (x *UserMessage_ConversationStatus) ProtoReflect() protoreflect.Message { - mi := &file_messages_proto_msgTypes[10] + mi := &file_messages_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -885,7 +1035,7 @@ func (x *UserMessage_ConversationStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use UserMessage_ConversationStatus.ProtoReflect.Descriptor instead. func (*UserMessage_ConversationStatus) Descriptor() ([]byte, []int) { - return file_messages_proto_rawDescGZIP(), []int{6, 0} + return file_messages_proto_rawDescGZIP(), []int{8, 0} } func (x *UserMessage_ConversationStatus) GetLocalUuid() string { @@ -949,7 +1099,7 @@ type UserMessage_Group struct { func (x *UserMessage_Group) Reset() { *x = UserMessage_Group{} if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[11] + mi := &file_messages_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -962,7 +1112,7 @@ func (x *UserMessage_Group) String() string { func (*UserMessage_Group) ProtoMessage() {} func (x *UserMessage_Group) ProtoReflect() protoreflect.Message { - mi := &file_messages_proto_msgTypes[11] + mi := &file_messages_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -975,7 +1125,7 @@ func (x *UserMessage_Group) ProtoReflect() protoreflect.Message { // Deprecated: Use UserMessage_Group.ProtoReflect.Descriptor instead. func (*UserMessage_Group) Descriptor() ([]byte, []int) { - return file_messages_proto_rawDescGZIP(), []int{6, 1} + return file_messages_proto_rawDescGZIP(), []int{8, 1} } func (x *UserMessage_Group) GetName() string { @@ -1002,7 +1152,7 @@ var file_messages_proto_rawDesc = []byte{ 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xd6, 0x03, 0x0a, + 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x99, 0x04, 0x0a, 0x0f, 0x54, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, @@ -1020,39 +1170,60 @@ var file_messages_proto_rawDesc = []byte{ 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x0c, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, - 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, - 0x75, 0x69, 0x64, 0x1a, 0xaf, 0x01, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6c, - 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x10, 0x6c, 0x61, 0x73, - 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x75, 0x69, 0x64, 0x4f, 0x4b, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, - 0x75, 0x69, 0x64, 0x4f, 0x4b, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x6c, - 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xc6, 0x02, 0x0a, 0x11, 0x46, 0x72, 0x6f, 0x6d, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x28, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x75, 0x69, 0x64, 0x41, 0x63, 0x6b, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x75, 0x69, 0x64, 0x41, 0x63, 0x6b, 0x12, 0x1e, 0x0a, - 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x75, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x75, 0x69, 0x64, 0x12, 0x2e, 0x0a, - 0x04, 0x63, 0x68, 0x61, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, - 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x04, 0x63, 0x68, 0x61, 0x74, 0x12, 0x33, 0x0a, - 0x0c, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x52, 0x0c, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x73, 0x1a, 0x3a, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x55, 0x75, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x55, 0x75, 0x69, 0x64, 0x73, 0x22, 0xd0, + 0x41, 0x0a, 0x11, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6f, + 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, 0x52, + 0x11, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x1a, 0xaf, 0x01, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x76, 0x65, + 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, + 0x0a, 0x09, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x10, + 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x75, 0x69, 0x64, 0x4f, 0x4b, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x55, 0x75, 0x69, 0x64, 0x4f, 0x4b, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x73, 0x68, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x28, + 0x0a, 0x0f, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xc6, 0x02, 0x0a, 0x11, 0x46, 0x72, 0x6f, + 0x6d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x75, 0x69, 0x64, 0x41, 0x63, + 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x75, 0x69, 0x64, 0x41, 0x63, 0x6b, + 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x75, 0x69, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x75, 0x69, 0x64, + 0x12, 0x2e, 0x0a, 0x04, 0x63, 0x68, 0x61, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x04, 0x63, 0x68, 0x61, 0x74, + 0x12, 0x33, 0x0a, 0x0c, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, + 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x0c, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x73, 0x1a, 0x3a, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, + 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x55, 0x75, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x55, 0x75, 0x69, 0x64, + 0x73, 0x22, 0x6c, 0x0a, 0x10, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, + 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x22, + 0x9c, 0x01, 0x0a, 0x0a, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, 0x12, 0x1c, + 0x0a, 0x09, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x04, + 0x70, 0x72, 0x65, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6f, + 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x04, 0x70, 0x72, 0x65, 0x76, 0x12, 0x2d, 0x0a, 0x04, 0x6e, + 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6f, 0x77, + 0x6c, 0x69, 0x62, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x52, 0x04, 0x6e, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd0, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, @@ -1162,40 +1333,45 @@ func file_messages_proto_rawDescGZIP() []byte { return file_messages_proto_rawDescData } -var file_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_messages_proto_goTypes = []interface{}{ (*PackedServerMessage)(nil), // 0: meowlib.PackedServerMessage (*ToServerMessage)(nil), // 1: meowlib.ToServerMessage (*FromServerMessage)(nil), // 2: meowlib.FromServerMessage - (*Server)(nil), // 3: meowlib.Server - (*ContactCard)(nil), // 4: meowlib.ContactCard - (*PackedUserMessage)(nil), // 5: meowlib.PackedUserMessage - (*UserMessage)(nil), // 6: meowlib.UserMessage - (*File)(nil), // 7: meowlib.File - (*ToServerMessage_ConversationRequest)(nil), // 8: meowlib.ToServerMessage.ConversationRequest - (*FromServerMessage_ConversationResponse)(nil), // 9: meowlib.FromServerMessage.ConversationResponse - (*UserMessage_ConversationStatus)(nil), // 10: meowlib.UserMessage.ConversationStatus - (*UserMessage_Group)(nil), // 11: meowlib.UserMessage.Group + (*MatriochkaServer)(nil), // 3: meowlib.MatriochkaServer + (*Matriochka)(nil), // 4: meowlib.Matriochka + (*Server)(nil), // 5: meowlib.Server + (*ContactCard)(nil), // 6: meowlib.ContactCard + (*PackedUserMessage)(nil), // 7: meowlib.PackedUserMessage + (*UserMessage)(nil), // 8: meowlib.UserMessage + (*File)(nil), // 9: meowlib.File + (*ToServerMessage_ConversationRequest)(nil), // 10: meowlib.ToServerMessage.ConversationRequest + (*FromServerMessage_ConversationResponse)(nil), // 11: meowlib.FromServerMessage.ConversationResponse + (*UserMessage_ConversationStatus)(nil), // 12: meowlib.UserMessage.ConversationStatus + (*UserMessage_Group)(nil), // 13: meowlib.UserMessage.Group } var file_messages_proto_depIdxs = []int32{ - 8, // 0: meowlib.ToServerMessage.pullRequest:type_name -> meowlib.ToServerMessage.ConversationRequest - 5, // 1: meowlib.ToServerMessage.messages:type_name -> meowlib.PackedUserMessage - 3, // 2: meowlib.ToServerMessage.knownServers:type_name -> meowlib.Server - 5, // 3: meowlib.FromServerMessage.chat:type_name -> meowlib.PackedUserMessage - 3, // 4: meowlib.FromServerMessage.knownServers:type_name -> meowlib.Server - 3, // 5: meowlib.ContactCard.pullServers:type_name -> meowlib.Server - 10, // 6: meowlib.UserMessage.Status:type_name -> meowlib.UserMessage.ConversationStatus - 4, // 7: meowlib.UserMessage.contact:type_name -> meowlib.ContactCard - 3, // 8: meowlib.UserMessage.knownServers:type_name -> meowlib.Server - 11, // 9: meowlib.UserMessage.group:type_name -> meowlib.UserMessage.Group - 7, // 10: meowlib.UserMessage.files:type_name -> meowlib.File - 4, // 11: meowlib.UserMessage.ConversationStatus.myNextIdentity:type_name -> meowlib.ContactCard - 4, // 12: meowlib.UserMessage.Group.members:type_name -> meowlib.ContactCard - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 10, // 0: meowlib.ToServerMessage.pullRequest:type_name -> meowlib.ToServerMessage.ConversationRequest + 7, // 1: meowlib.ToServerMessage.messages:type_name -> meowlib.PackedUserMessage + 5, // 2: meowlib.ToServerMessage.knownServers:type_name -> meowlib.Server + 4, // 3: meowlib.ToServerMessage.matriochkaMessage:type_name -> meowlib.Matriochka + 7, // 4: meowlib.FromServerMessage.chat:type_name -> meowlib.PackedUserMessage + 5, // 5: meowlib.FromServerMessage.knownServers:type_name -> meowlib.Server + 3, // 6: meowlib.Matriochka.prev:type_name -> meowlib.MatriochkaServer + 3, // 7: meowlib.Matriochka.next:type_name -> meowlib.MatriochkaServer + 5, // 8: meowlib.ContactCard.pullServers:type_name -> meowlib.Server + 12, // 9: meowlib.UserMessage.Status:type_name -> meowlib.UserMessage.ConversationStatus + 6, // 10: meowlib.UserMessage.contact:type_name -> meowlib.ContactCard + 5, // 11: meowlib.UserMessage.knownServers:type_name -> meowlib.Server + 13, // 12: meowlib.UserMessage.group:type_name -> meowlib.UserMessage.Group + 9, // 13: meowlib.UserMessage.files:type_name -> meowlib.File + 6, // 14: meowlib.UserMessage.ConversationStatus.myNextIdentity:type_name -> meowlib.ContactCard + 6, // 15: meowlib.UserMessage.Group.members:type_name -> meowlib.ContactCard + 16, // [16:16] is the sub-list for method output_type + 16, // [16:16] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_messages_proto_init() } @@ -1241,7 +1417,7 @@ func file_messages_proto_init() { } } file_messages_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Server); i { + switch v := v.(*MatriochkaServer); i { case 0: return &v.state case 1: @@ -1253,7 +1429,7 @@ func file_messages_proto_init() { } } file_messages_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContactCard); i { + switch v := v.(*Matriochka); i { case 0: return &v.state case 1: @@ -1265,7 +1441,7 @@ func file_messages_proto_init() { } } file_messages_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackedUserMessage); i { + switch v := v.(*Server); i { case 0: return &v.state case 1: @@ -1277,7 +1453,7 @@ func file_messages_proto_init() { } } file_messages_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserMessage); i { + switch v := v.(*ContactCard); i { case 0: return &v.state case 1: @@ -1289,7 +1465,7 @@ func file_messages_proto_init() { } } file_messages_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*File); i { + switch v := v.(*PackedUserMessage); i { case 0: return &v.state case 1: @@ -1301,7 +1477,7 @@ func file_messages_proto_init() { } } file_messages_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ToServerMessage_ConversationRequest); i { + switch v := v.(*UserMessage); i { case 0: return &v.state case 1: @@ -1313,7 +1489,7 @@ func file_messages_proto_init() { } } file_messages_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FromServerMessage_ConversationResponse); i { + switch v := v.(*File); i { case 0: return &v.state case 1: @@ -1325,7 +1501,7 @@ func file_messages_proto_init() { } } file_messages_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserMessage_ConversationStatus); i { + switch v := v.(*ToServerMessage_ConversationRequest); i { case 0: return &v.state case 1: @@ -1337,6 +1513,30 @@ func file_messages_proto_init() { } } file_messages_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FromServerMessage_ConversationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_messages_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserMessage_ConversationStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_messages_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserMessage_Group); i { case 0: return &v.state @@ -1355,7 +1555,7 @@ func file_messages_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_messages_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 14, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/messages.proto b/pb/messages.proto index b2765ba..9e236cd 100644 --- a/pb/messages.proto +++ b/pb/messages.proto @@ -28,8 +28,10 @@ message ToServerMessage { repeated PackedUserMessage messages = 5; repeated Server knownServers = 6; + + Matriochka matriochkaMessage = 7; - string uuid = 7; + string uuid = 8; } @@ -45,13 +47,26 @@ message FromServerMessage { repeated string messageUuids = 1; } - repeated PackedUserMessage chat = 6; repeated Server knownServers = 7; } +message MatriochkaServer { + string url = 1; // Server Url + string publicKey = 2; // Server Public Key + string uuid = 3 ; // Optional, uuid for delivery confirmation + int32 delay = 4; // Max delay requested for message forwarding or delivery tracking +} + +message Matriochka { + string lookupKey = 1; // Optional, only if you want delivery tracking, less stealth + MatriochkaServer prev = 2; // Optional, like above + MatriochkaServer next = 3; // Next server to deliver the message to + bytes data = 4; // Matriochka data +} + // structure describing required server attributes message Server { string name = 1; @@ -59,7 +74,7 @@ message Server { string publicKey = 3; string url = 4; bool publish = 5; // publish this server when asked for a list by server - bytes signature = 6; // signature of all previous field by the server itself + bytes signature = 6; // signature of all previous fields by the server itself int32 confidenceLevel = 7; // additional info from the user } @@ -82,6 +97,7 @@ message PackedUserMessage { repeated int64 serverTimestamp=4; // server time stamp, might be several in matriochka mode } + // structure defining information that might be exchanged between two peers. message UserMessage { string destination = 1; // Lookupkey @@ -95,7 +111,7 @@ message UserMessage { uint64 received = 4; uint64 processed = 5; ContactCard myNextIdentity = 6; - int32 peerNextIdentityAck = 7; // version of the new peed accepted id + int32 peerNextIdentityAck = 7; // version of the new peer accepted id } ConversationStatus Status = 5; diff --git a/server/router.go b/server/router.go index 4829ac9..210924b 100644 --- a/server/router.go +++ b/server/router.go @@ -38,7 +38,7 @@ func (r *RedisRouter) Route(msg *meowlib.ToServerMessage) (*meowlib.FromServerMe if err != nil { return nil, err } - r.Client.ZAdd(usrmsg.Destination, redis.Z{float64(time.Now().Unix()), out}) + r.Client.ZAdd(usrmsg.Destination, redis.Z{Score: float64(time.Now().Unix()), Member: out}) } from_server.UuidAck = msg.Uuid } @@ -69,6 +69,19 @@ func (r *RedisRouter) Route(msg *meowlib.ToServerMessage) (*meowlib.FromServerMe } } + + if msg.MatriochkaMessage != nil { + out, err := proto.Marshal(msg) + if err != nil { + return nil, err + } + r.Client.ZAdd("mtk", redis.Z{Score: float64(time.Now().Unix()), Member: out}) + if msg.MatriochkaMessage.LookupKey != "" { + //r.Client.ZAdd("trk:" + msg.MatriochkaMessage.Next.Uuid,{}) + } + from_server.UuidAck = msg.Uuid + } + if len(msg.KnownServers) > 0 { }