Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/friends' into async_friending_sc…
Browse files Browse the repository at this point in the history
…hema
  • Loading branch information
Shengtong Zhang committed Jun 27, 2022
2 parents c64027e + 5cdc265 commit 45a1a19
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions schema/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,32 @@ package asphrclient;
// TODO: allow a message to transparently flow into the next message. this is problematic, though,
// because the next message can only be sent after the first message has been acked, unless multiple channels are used.
//
// update GUARANTEED_MESSAGE_SIZE in client_lib.hpp whenever this is updated.
// IMPORTANT: update GUARANTEED_MESSAGE_SIZE in client_lib.hpp whenever this is updated.
message Message {
// sequence_number is a unique id for the message. it is unique for a <sender, receiver> ordered pair.
// if the id is 0, then the message is a dummy message, with no actual msg to display to the user.
// TODO: to optimize space usage, we should merge the id here and the nonce used for encryption.
// this requires some careful thought with dummy messages.
uint32 sequence_number = 1;
// msg contains the actual UTF-8 message, if such a message exists
// In the future, we probably want this to be `bytes`, encoding a protobuf. The protobuf
// will contain a string message and possibly other information, like pictures or reply metadata.
string msg = 2;
// acks contains the ids of messages that the sender has received and has not acked before.
// this field is ONLY used when a dedicated communication channel is used. otherwise, ACKs are stored elsewhere.
repeated uint32 acks = 3;
// if the message is a long message, this field contains the number of parts it has
// this field is not set if the message isn't long.
uint32 num_chunks = 4;
uint32 num_chunks = 3;
// if the message is a long message, this field contains the start id of the long message.
// the index in this message in the long message is (sequence_number - chunks_start_sequence_number)
// this field is not set if the message isn't long.
uint32 chunks_start_sequence_number = 5;
uint32 chunks_start_sequence_number = 4;

// control messages below. none of the fields below will be set for actual messages.
//
// true iff this message is a control message
bool control = 5;
// keep this in sync with db.rs, ControlMessage constants
enum ControlMessage {
OUTGOING_FRIEND_REQUEST = 0;
}
ControlMessage control_message = 6;
}

0 comments on commit 45a1a19

Please sign in to comment.