From b7c19dc7ab74b2990ac08a6b33c388995ed0b274 Mon Sep 17 00:00:00 2001 From: Agustina Aldasoro Date: Mon, 24 Jul 2023 15:22:56 +0200 Subject: [PATCH] POC: send status notifications --- .../social/friendships/friendships.proto | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/proto/decentraland/social/friendships/friendships.proto b/proto/decentraland/social/friendships/friendships.proto index a405f14f..aef66965 100644 --- a/proto/decentraland/social/friendships/friendships.proto +++ b/proto/decentraland/social/friendships/friendships.proto @@ -35,6 +35,10 @@ message User { string address = 1; } message Users { repeated User users = 1; } +message UsersPresence { + repeated User online = 1; +} + message RequestResponse { User user = 1; int64 created_at = 2; @@ -89,6 +93,33 @@ message Payload { optional string synapse_token = 1; } +message Status { + enum StatusType { + ONLINE = 0; + OFFLINE = 1; + } + StatusType type = 1; +} + +// For internal use only, subject to change. +message StatusPayload { + // For internal use only, subject to change. + optional string synapse_token = 1; + // For internal use only, subject to change. + optional Status status = 2; +} + +message StatusResponse { + oneof response { + Status status = 1; + InternalServerError internal_server_error = 2; + UnauthorizedError unauthorized_error = 3; + ForbiddenError forbidden_error = 4; + TooManyRequestsError too_many_requests_error = 5; + BadRequestError bad_request_error = 6; + } +} + message BadRequestError { string message = 1; } @@ -105,6 +136,16 @@ message InternalServerError { string message = 1; } +message UsersPresenceResponse { + oneof response { + UsersPresence presence = 1; + InternalServerError internal_server_error = 2; + UnauthorizedError unauthorized_error = 3; + ForbiddenError forbidden_error = 4; + TooManyRequestsError too_many_requests_error = 5; + } +} + message UsersResponse { oneof response { Users users = 1; @@ -148,9 +189,16 @@ message SubscribeFriendshipEventsUpdatesResponse { } service FriendshipsService { + + // Message to set yourself as online + rpc SetPresenceStatus(StatusPayload) returns (StatusResponse) {} + // Get the list of friends for the authenticated user rpc GetFriends(Payload) returns (stream UsersResponse) {} + // Get the list of presence status of the friends for the authenticated user + rpc GetFriendsPresenceStatus(Payload) returns (stream UsersPresenceResponse) {} + // Get the list of mutual friends between the authenticated user and the one in the parameter rpc GetMutualFriends(MutualFriendsPayload) returns (stream UsersResponse) {}