From e710fafdd15c1ffe745f14389fb6fb5b6cc835f2 Mon Sep 17 00:00:00 2001 From: Sualeh Asif Date: Thu, 7 Jul 2022 17:56:22 -0400 Subject: [PATCH] schema updates. next to fix tests --- schema/daemon.proto | 46 +++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/schema/daemon.proto b/schema/daemon.proto index 1d9bf99..c871189 100644 --- a/schema/daemon.proto +++ b/schema/daemon.proto @@ -168,38 +168,48 @@ message RemoveFriendRequest { string unique_name = 1; } message RemoveFriendResponse {} message SendMessageRequest { - string unique_name = 1; + repeated string unique_name = 1; string message = 2; } message SendMessageResponse {} -message BaseMessage { - // this ID is NOT the same as the ID in message.proto - // in particular, this ID is guaranteed to be unique among ALL messages (on a - // given device), whereas the ID in message.proto is only unique for each - // pair. the format of this ID is something like - // (to|from):sender:sequence_number - int32 id = 1; - string message = 2; - string unique_name = 3; - string display_name = 4; +message IncomingMaybeFriend { + string public_id = 1; + + optional string unique_name = 2; + optional string display_name = 3; } message IncomingMessage { - BaseMessage m = 1; - google.protobuf.Timestamp delivered_at = 2; - bool seen = 3; - bool delivered = 4; + int32 uid = 1; + string message = 2; + + string from_unique_name = 3; + string from_display_name = 4; + + repeated IncomingMaybeFriend other_recipients = 5; + + google.protobuf.Timestamp delivered_at = 6; + bool seen = 7; + bool delivered = 8; } -message OutgoingMessage { - BaseMessage m = 1; - google.protobuf.Timestamp sent_at = 2; +message OutgoingFriend { + string unique_name = 1; + string display_name = 2; bool delivered = 3; google.protobuf.Timestamp delivered_at = 4; } +message OutgoingMessage { + int32 uid = 1; + string message = 2; + + repeated OutgoingFriend to_friends = 3; + google.protobuf.Timestamp sent_at = 4; +} + message GetMessagesRequest { enum Filter { ALL = 0;