Skip to content

Commit e07ccb6

Browse files
authored
feat: Social service v2 (#242)
* feat: Concept of friendships * feat: Only friend requests need id * feat: change order of props for compatibility * feat: New stream FriendUpdate (online, offline, away in the future) * feat: Missing changes after merge * feat: Get Friends and Mutual responses include data from their profile * feat: Friendship request response also include profile data * fix: change string for bool on has claimed name * refactor: Rename stream friend connectivity updates subscription and response * feat: Additional data in upsert and updates responses * feat: Add None Friendship Status
1 parent 5fbeb3c commit e07ccb6

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

proto/decentraland/social_service/v2/social_service_v2.proto

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,23 @@ message InternalServerError {}
1010
// Types
1111
message User { string address = 1; }
1212

13+
message FriendProfile {
14+
string address = 1;
15+
string name = 2;
16+
bool has_claimed_name = 3;
17+
string profile_picture_url = 4;
18+
}
19+
1320
message Pagination {
1421
int32 limit = 1;
1522
int32 offset = 2;
1623
}
1724

1825
message FriendshipRequestResponse {
19-
User user = 1;
26+
FriendProfile friend = 1;
2027
int64 created_at = 2;
2128
optional string message = 3;
29+
string id = 4;
2230
}
2331

2432
message FriendshipRequests {
@@ -33,7 +41,6 @@ enum ConnectivityStatus {
3341

3442
message GetFriendsPayload {
3543
optional Pagination pagination = 1;
36-
optional ConnectivityStatus status = 2;
3744
}
3845

3946
message GetFriendshipRequestsPayload {
@@ -69,8 +76,8 @@ message PaginatedResponse {
6976
int32 page = 2;
7077
}
7178

72-
message PaginatedUsersResponse {
73-
repeated User users = 1;
79+
message PaginatedFriendsProfilesResponse {
80+
repeated FriendProfile friends = 1;
7481
PaginatedResponse pagination_data = 2;
7582
}
7683

@@ -86,6 +93,8 @@ message UpsertFriendshipResponse {
8693
message Accepted {
8794
string id = 1;
8895
int64 created_at = 2;
96+
FriendProfile friend = 3;
97+
optional string message = 4;
8998
}
9099
oneof response {
91100
Accepted accepted = 1;
@@ -95,20 +104,31 @@ message UpsertFriendshipResponse {
95104
}
96105

97106
message FriendshipUpdate {
107+
message RequestResponse {
108+
FriendProfile friend = 1;
109+
int64 created_at = 2;
110+
optional string message = 3;
111+
string id = 4;
112+
}
98113
message AcceptResponse { User user = 1; }
99114
message RejectResponse { User user = 1; }
100115
message DeleteResponse { User user = 1; }
101116
message CancelResponse { User user = 1; }
102117

103118
oneof update {
104-
FriendshipRequestResponse request = 1;
119+
RequestResponse request = 1;
105120
AcceptResponse accept = 2;
106121
RejectResponse reject = 3;
107122
DeleteResponse delete = 4;
108123
CancelResponse cancel = 5;
109124
}
110125
}
111126

127+
message FriendConnectivityUpdate {
128+
FriendProfile friend = 1;
129+
ConnectivityStatus status = 2;
130+
}
131+
112132
message GetFriendshipStatusPayload {
113133
User user = 1;
114134
}
@@ -121,6 +141,7 @@ enum FriendshipStatus {
121141
REJECTED = 4;
122142
DELETED = 5;
123143
BLOCKED = 6;
144+
NONE = 7;
124145
}
125146

126147
message GetFriendshipStatusResponse {
@@ -136,10 +157,10 @@ message GetFriendshipStatusResponse {
136157

137158
service SocialService {
138159
// Get the list of friends for the authenticated user
139-
rpc GetFriends(GetFriendsPayload) returns (PaginatedUsersResponse) {}
160+
rpc GetFriends(GetFriendsPayload) returns (PaginatedFriendsProfilesResponse) {}
140161

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

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

179+
// Get the friendship status between the authenticated user and the one in the parameter
158180
rpc GetFriendshipStatus(GetFriendshipStatusPayload) returns (GetFriendshipStatusResponse) {}
181+
182+
// Subscribe to connectivity updates of friends: ONLINE, OFFLINE, AWAY
183+
rpc SubscribeToFriendConnectivityUpdates(google.protobuf.Empty)
184+
returns (stream FriendConnectivityUpdate) {}
159185
}

0 commit comments

Comments
 (0)