Skip to content

Commit

Permalink
POC: send status notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
agusaldasoro committed Jul 24, 2023
1 parent 07e0626 commit b7c19dc
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions proto/decentraland/social/friendships/friendships.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down Expand Up @@ -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) {}

Expand Down

0 comments on commit b7c19dc

Please sign in to comment.