Skip to content

Commit

Permalink
Merge branch 'main' into feat/dynamic-lights
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAlvarezMelucciDCL authored Jan 21, 2025
2 parents e9cba8b + b3fea33 commit 8c46c02
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ message RealSendRequest {
message RealSendResponse {}

message SendBinaryRequest {
repeated bytes data = 1; // @deprecated old broadcasted messages. Use peerData with an empty array for broadcasting.
repeated PeerMessageData peer_data = 2; // peer-to-peer messages
}

message PeerMessageData {
repeated bytes data = 1;
repeated string address = 2; // if address is empty, its a broadcast message
}

message SendBinaryResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package decentraland.social.friendships;
package decentraland.social_service.v1;

// This message is a response that is sent from the server to the client
message FriendshipEventResponse {
Expand Down Expand Up @@ -142,6 +142,7 @@ message SubscribeFriendshipEventsUpdatesResponse {
}
}

// @deprecated, only available for old explorer compatibility
service FriendshipsService {
// Get the list of friends for the authenticated user
rpc GetFriends(Payload) returns (stream UsersResponse) {}
Expand Down
159 changes: 159 additions & 0 deletions proto/decentraland/social_service/v2/social_service_v2.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
syntax = "proto3";
package decentraland.social_service.v2;

import "google/protobuf/empty.proto";

// Errors
message InvalidFriendshipAction {}
message InternalServerError {}

// Types
message User { string address = 1; }

message Pagination {
int32 limit = 1;
int32 offset = 2;
}

message FriendshipRequestResponse {
User user = 1;
int64 created_at = 2;
optional string message = 3;
}

message FriendshipRequests {
repeated FriendshipRequestResponse requests = 1;
}

enum ConnectivityStatus {
ONLINE = 0;
OFFLINE = 1;
AWAY = 2;
}

message GetFriendsPayload {
optional Pagination pagination = 1;
optional ConnectivityStatus status = 2;
}

message GetFriendshipRequestsPayload {
optional Pagination pagination = 1;
}

message UpsertFriendshipPayload {
message RequestPayload {
User user = 1;
optional string message = 3;
}
message AcceptPayload { User user = 1; }
message RejectPayload { User user = 1; }
message DeletePayload { User user = 1; }
message CancelPayload { User user = 1; }

oneof action {
RequestPayload request = 1;
AcceptPayload accept = 2;
RejectPayload reject = 4;
DeletePayload delete = 5;
CancelPayload cancel = 6;
}
}

message GetMutualFriendsPayload {
User user = 1;
optional Pagination pagination = 2;
}

message PaginatedResponse {
int32 total = 1;
int32 page = 2;
}

message PaginatedUsersResponse {
repeated User users = 1;
PaginatedResponse pagination_data = 2;
}

message PaginatedFriendshipRequestsResponse {
oneof response {
FriendshipRequests requests = 1;
InternalServerError internal_server_error = 2;
}
optional PaginatedResponse pagination_data = 3;
}

message UpsertFriendshipResponse {
message Accepted {
string id = 1;
int64 created_at = 2;
}
oneof response {
Accepted accepted = 1;
InvalidFriendshipAction invalid_friendship_action = 2;
InternalServerError internal_server_error = 3;
}
}

message FriendshipUpdate {
message AcceptResponse { User user = 1; }
message RejectResponse { User user = 1; }
message DeleteResponse { User user = 1; }
message CancelResponse { User user = 1; }

oneof update {
FriendshipRequestResponse request = 1;
AcceptResponse accept = 2;
RejectResponse reject = 3;
DeleteResponse delete = 4;
CancelResponse cancel = 5;
}
}

message GetFriendshipStatusPayload {
User user = 1;
}

enum FriendshipStatus {
REQUEST_SENT = 0;
REQUEST_RECEIVED = 1;
CANCELED = 2;
ACCEPTED = 3;
REJECTED = 4;
DELETED = 5;
BLOCKED = 6;
}

message GetFriendshipStatusResponse {
message Ok {
FriendshipStatus status = 1;
optional string message = 2;
}
oneof response {
Ok accepted = 1;
InternalServerError internal_server_error = 2;
}
}

service SocialService {
// Get the list of friends for the authenticated user
rpc GetFriends(GetFriendsPayload) returns (PaginatedUsersResponse) {}

// Get the list of mutual friends between the authenticated user and the one in the parameter
rpc GetMutualFriends(GetMutualFriendsPayload) returns (PaginatedUsersResponse) {}

// Get the pending friendship requests for the authenticated user
rpc GetPendingFriendshipRequests(GetFriendshipRequestsPayload) returns (PaginatedFriendshipRequestsResponse) {}

// Get the sent friendship requests for the authenticated user
rpc GetSentFriendshipRequests(GetFriendshipRequestsPayload) returns (PaginatedFriendshipRequestsResponse) {}

// Create or update friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE
rpc UpsertFriendship(UpsertFriendshipPayload)
returns (UpsertFriendshipResponse) {}

// Subscribe to updates of friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE
rpc SubscribeToFriendshipUpdates(google.protobuf.Empty)
returns (stream FriendshipUpdate) {}

rpc GetFriendshipStatus(GetFriendshipStatusPayload) returns (GetFriendshipStatusResponse) {}
}
111 changes: 0 additions & 111 deletions proto/decentraland/social_service_v2/social_service.proto

This file was deleted.

4 changes: 3 additions & 1 deletion public/social.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
syntax = "proto3";

package decentraland.social;

import public "decentraland/social/friendships/friendships.proto";
import public "decentraland/social_service/v1/social_service_v1.proto";
import public "decentraland/social_service/v2/social_service_v2.proto";
4 changes: 0 additions & 4 deletions public/social_service_v2.proto

This file was deleted.

0 comments on commit 8c46c02

Please sign in to comment.