Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Social service v2 #242

Merged
merged 14 commits into from
Feb 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions proto/decentraland/social_service/v2/social_service_v2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,23 @@ message InternalServerError {}
// Types
message User { string address = 1; }

message FriendProfile {
string address = 1;
string name = 2;
bool has_claimed_name = 3;
string profile_picture_url = 4;
}

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

message FriendshipRequestResponse {
User user = 1;
FriendProfile friend = 1;
int64 created_at = 2;
optional string message = 3;
string id = 4;
}

message FriendshipRequests {
Expand All @@ -33,7 +41,6 @@ enum ConnectivityStatus {

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

message GetFriendshipRequestsPayload {
Expand Down Expand Up @@ -69,8 +76,8 @@ message PaginatedResponse {
int32 page = 2;
}

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

Expand All @@ -86,6 +93,8 @@ message UpsertFriendshipResponse {
message Accepted {
string id = 1;
int64 created_at = 2;
FriendProfile friend = 3;
optional string message = 4;
}
oneof response {
Accepted accepted = 1;
Expand All @@ -95,20 +104,31 @@ message UpsertFriendshipResponse {
}

message FriendshipUpdate {
message RequestResponse {
FriendProfile friend = 1;
int64 created_at = 2;
optional string message = 3;
string id = 4;
}
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;
RequestResponse request = 1;
AcceptResponse accept = 2;
RejectResponse reject = 3;
DeleteResponse delete = 4;
CancelResponse cancel = 5;
}
}

message FriendConnectivityUpdate {
FriendProfile friend = 1;
ConnectivityStatus status = 2;
}

message GetFriendshipStatusPayload {
User user = 1;
}
Expand All @@ -121,6 +141,7 @@ enum FriendshipStatus {
REJECTED = 4;
DELETED = 5;
BLOCKED = 6;
NONE = 7;
}

message GetFriendshipStatusResponse {
Expand All @@ -136,10 +157,10 @@ message GetFriendshipStatusResponse {

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

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

// Get the pending friendship requests for the authenticated user
rpc GetPendingFriendshipRequests(GetFriendshipRequestsPayload) returns (PaginatedFriendshipRequestsResponse) {}
Expand All @@ -155,5 +176,10 @@ service SocialService {
rpc SubscribeToFriendshipUpdates(google.protobuf.Empty)
returns (stream FriendshipUpdate) {}

// Get the friendship status between the authenticated user and the one in the parameter
rpc GetFriendshipStatus(GetFriendshipStatusPayload) returns (GetFriendshipStatusResponse) {}

// Subscribe to connectivity updates of friends: ONLINE, OFFLINE, AWAY
rpc SubscribeToFriendConnectivityUpdates(google.protobuf.Empty)
returns (stream FriendConnectivityUpdate) {}
}
Loading