Move to protobuf for Message type (#1706)
* Use a single Message type `v1/message.go` and `message.go` are the same now, and they embed `protobuf.ChatMessage`
* Use `SendChatMessage` for sending chat messages, this is basically the old `Send` but a bit more flexible so we can send different message types (stickers,commands), and not just text.
* Remove dedup from services/shhext. Because now we process in status-protocol, dedup makes less sense, as those messages are going to be processed anyway, so removing for now, we can re-evaluate if bringing it to status-go or not.
* Change the various retrieveX method to a single one:
`RetrieveAll` will be processing those messages that it can process (Currently only `Message`), and return the rest in `RawMessages` (still transit). The format for the response is:
`Chats`: -> The chats updated by receiving the message
`Messages`: -> The messages retrieved (already matched to a chat)
`Contacts`: -> The contacts updated by the messages
`RawMessages` -> Anything else that can't be parsed, eventually as we move everything to status-protocol-go this will go away.
2019-12-05 16:25:34 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package protobuf;
|
|
|
|
|
|
|
|
message StickerMessage {
|
|
|
|
string hash = 1;
|
|
|
|
int32 pack = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ChatMessage {
|
|
|
|
// Lamport timestamp of the chat message
|
|
|
|
uint64 clock = 1;
|
|
|
|
// Unix timestamps in milliseconds, currently not used as we use whisper as more reliable, but here
|
|
|
|
// so that we don't rely on it
|
|
|
|
uint64 timestamp = 2;
|
|
|
|
// Text of the message
|
|
|
|
string text = 3;
|
|
|
|
// Id of the message that we are replying to
|
|
|
|
string response_to = 4;
|
|
|
|
// Ens name of the sender
|
|
|
|
string ens_name = 5;
|
|
|
|
// Chat id, this field is symmetric for public-chats and private group chats,
|
|
|
|
// but asymmetric in case of one-to-ones, as the sender will use the chat-id
|
|
|
|
// of the received, while the receiver will use the chat-id of the sender.
|
|
|
|
// Probably should be the concatenation of sender-pk & receiver-pk in alphabetical order
|
|
|
|
string chat_id = 6;
|
|
|
|
|
|
|
|
// The type of message (public/one-to-one/private-group-chat)
|
|
|
|
MessageType message_type = 7;
|
|
|
|
// The type of the content of the message
|
|
|
|
ContentType content_type = 8;
|
|
|
|
|
|
|
|
oneof payload {
|
|
|
|
StickerMessage sticker = 9;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum MessageType {
|
2019-12-02 15:34:05 +00:00
|
|
|
UNKNOWN_MESSAGE_TYPE = 0;
|
|
|
|
ONE_TO_ONE = 1;
|
|
|
|
PUBLIC_GROUP = 2;
|
|
|
|
PRIVATE_GROUP = 3;
|
Move to protobuf for Message type (#1706)
* Use a single Message type `v1/message.go` and `message.go` are the same now, and they embed `protobuf.ChatMessage`
* Use `SendChatMessage` for sending chat messages, this is basically the old `Send` but a bit more flexible so we can send different message types (stickers,commands), and not just text.
* Remove dedup from services/shhext. Because now we process in status-protocol, dedup makes less sense, as those messages are going to be processed anyway, so removing for now, we can re-evaluate if bringing it to status-go or not.
* Change the various retrieveX method to a single one:
`RetrieveAll` will be processing those messages that it can process (Currently only `Message`), and return the rest in `RawMessages` (still transit). The format for the response is:
`Chats`: -> The chats updated by receiving the message
`Messages`: -> The messages retrieved (already matched to a chat)
`Contacts`: -> The contacts updated by the messages
`RawMessages` -> Anything else that can't be parsed, eventually as we move everything to status-protocol-go this will go away.
2019-12-05 16:25:34 +00:00
|
|
|
// Only local
|
2019-12-02 15:34:05 +00:00
|
|
|
SYSTEM_MESSAGE_PRIVATE_GROUP = 4;
|
Move to protobuf for Message type (#1706)
* Use a single Message type `v1/message.go` and `message.go` are the same now, and they embed `protobuf.ChatMessage`
* Use `SendChatMessage` for sending chat messages, this is basically the old `Send` but a bit more flexible so we can send different message types (stickers,commands), and not just text.
* Remove dedup from services/shhext. Because now we process in status-protocol, dedup makes less sense, as those messages are going to be processed anyway, so removing for now, we can re-evaluate if bringing it to status-go or not.
* Change the various retrieveX method to a single one:
`RetrieveAll` will be processing those messages that it can process (Currently only `Message`), and return the rest in `RawMessages` (still transit). The format for the response is:
`Chats`: -> The chats updated by receiving the message
`Messages`: -> The messages retrieved (already matched to a chat)
`Contacts`: -> The contacts updated by the messages
`RawMessages` -> Anything else that can't be parsed, eventually as we move everything to status-protocol-go this will go away.
2019-12-05 16:25:34 +00:00
|
|
|
}
|
|
|
|
enum ContentType {
|
2019-12-02 15:34:05 +00:00
|
|
|
UNKNOWN_CONTENT_TYPE = 0;
|
|
|
|
TEXT_PLAIN = 1;
|
|
|
|
STICKER = 2;
|
|
|
|
STATUS = 3;
|
|
|
|
EMOJI = 4;
|
2020-01-10 18:59:01 +00:00
|
|
|
TRANSACTION_COMMAND = 5;
|
Move to protobuf for Message type (#1706)
* Use a single Message type `v1/message.go` and `message.go` are the same now, and they embed `protobuf.ChatMessage`
* Use `SendChatMessage` for sending chat messages, this is basically the old `Send` but a bit more flexible so we can send different message types (stickers,commands), and not just text.
* Remove dedup from services/shhext. Because now we process in status-protocol, dedup makes less sense, as those messages are going to be processed anyway, so removing for now, we can re-evaluate if bringing it to status-go or not.
* Change the various retrieveX method to a single one:
`RetrieveAll` will be processing those messages that it can process (Currently only `Message`), and return the rest in `RawMessages` (still transit). The format for the response is:
`Chats`: -> The chats updated by receiving the message
`Messages`: -> The messages retrieved (already matched to a chat)
`Contacts`: -> The contacts updated by the messages
`RawMessages` -> Anything else that can't be parsed, eventually as we move everything to status-protocol-go this will go away.
2019-12-05 16:25:34 +00:00
|
|
|
}
|
|
|
|
}
|