Skip to content

Commit c95848f

Browse files
authored
Merge branch 'main' into protocol-squad
Signed-off-by: Lean Mendoza <[email protected]>
2 parents ea9043b + b3fea33 commit c95848f

File tree

7 files changed

+178
-119
lines changed

7 files changed

+178
-119
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
branches:
44
- main
55
- protocol-squad
6+
- experimental
67
pull_request:
78
release:
89
types:
@@ -11,6 +12,9 @@ env:
1112
IS_A_PR: ${{ github.event.pull_request.number != 'null' && github.head_ref != 'protocol-squad' }}
1213

1314

15+
env:
16+
BRANCH_TAG: ${{ github.ref_name == 'experimental' && 'experimental' || '' }}
17+
1418
name: build-deploy
1519
jobs:
1620
check_and_build:
@@ -28,7 +32,7 @@ jobs:
2832
echo "from env '${{env.IS_A_PR}}'"
2933
echo "- '${{github.event.pull_request.number}}'"
3034
echo "- env '${{github.head_ref}}'"
31-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v4
3236
- name: install
3337
run: make install
3438
- name: buf build
@@ -56,8 +60,10 @@ jobs:
5660
## inform gitlab after publishing to proceed with CDN propagation
5761
gitlab-token: ${{ secrets.GITLAB_TOKEN }}
5862
gitlab-pipeline-url: ${{ secrets.GITLAB_URL }}
63+
custom-tag: ${{ env.BRANCH_TAG }}
64+
branch-to-custom-tag: ${{ env.BRANCH_TAG }}
5965
env:
60-
BRANCH_NAME: ${{ github.head_ref }}
66+
BRANCH_NAME: ${{ github.ref_name }}
6167
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6268
AWS_DEFAULT_REGION: us-east-1
6369
AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }}

proto/decentraland/kernel/apis/communications_controller.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ message RealSendRequest {
88
message RealSendResponse {}
99

1010
message SendBinaryRequest {
11+
repeated bytes data = 1; // @deprecated old broadcasted messages. Use peerData with an empty array for broadcasting.
12+
repeated PeerMessageData peer_data = 2; // peer-to-peer messages
13+
}
14+
15+
message PeerMessageData {
1116
repeated bytes data = 1;
17+
repeated string address = 2; // if address is empty, its a broadcast message
1218
}
1319

1420
message SendBinaryResponse {

proto/decentraland/social/friendships/friendships.proto renamed to proto/decentraland/social_service/v1/social_service_v1.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
syntax = "proto3";
2-
package decentraland.social.friendships;
2+
package decentraland.social_service.v1;
33

44
// This message is a response that is sent from the server to the client
55
message FriendshipEventResponse {
@@ -142,6 +142,7 @@ message SubscribeFriendshipEventsUpdatesResponse {
142142
}
143143
}
144144

145+
// @deprecated, only available for old explorer compatibility
145146
service FriendshipsService {
146147
// Get the list of friends for the authenticated user
147148
rpc GetFriends(Payload) returns (stream UsersResponse) {}
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
syntax = "proto3";
2+
package decentraland.social_service.v2;
3+
4+
import "google/protobuf/empty.proto";
5+
6+
// Errors
7+
message InvalidFriendshipAction {}
8+
message InternalServerError {}
9+
10+
// Types
11+
message User { string address = 1; }
12+
13+
message Pagination {
14+
int32 limit = 1;
15+
int32 offset = 2;
16+
}
17+
18+
message FriendshipRequestResponse {
19+
User user = 1;
20+
int64 created_at = 2;
21+
optional string message = 3;
22+
}
23+
24+
message FriendshipRequests {
25+
repeated FriendshipRequestResponse requests = 1;
26+
}
27+
28+
enum ConnectivityStatus {
29+
ONLINE = 0;
30+
OFFLINE = 1;
31+
AWAY = 2;
32+
}
33+
34+
message GetFriendsPayload {
35+
optional Pagination pagination = 1;
36+
optional ConnectivityStatus status = 2;
37+
}
38+
39+
message GetFriendshipRequestsPayload {
40+
optional Pagination pagination = 1;
41+
}
42+
43+
message UpsertFriendshipPayload {
44+
message RequestPayload {
45+
User user = 1;
46+
optional string message = 3;
47+
}
48+
message AcceptPayload { User user = 1; }
49+
message RejectPayload { User user = 1; }
50+
message DeletePayload { User user = 1; }
51+
message CancelPayload { User user = 1; }
52+
53+
oneof action {
54+
RequestPayload request = 1;
55+
AcceptPayload accept = 2;
56+
RejectPayload reject = 4;
57+
DeletePayload delete = 5;
58+
CancelPayload cancel = 6;
59+
}
60+
}
61+
62+
message GetMutualFriendsPayload {
63+
User user = 1;
64+
optional Pagination pagination = 2;
65+
}
66+
67+
message PaginatedResponse {
68+
int32 total = 1;
69+
int32 page = 2;
70+
}
71+
72+
message PaginatedUsersResponse {
73+
repeated User users = 1;
74+
PaginatedResponse pagination_data = 2;
75+
}
76+
77+
message PaginatedFriendshipRequestsResponse {
78+
oneof response {
79+
FriendshipRequests requests = 1;
80+
InternalServerError internal_server_error = 2;
81+
}
82+
optional PaginatedResponse pagination_data = 3;
83+
}
84+
85+
message UpsertFriendshipResponse {
86+
message Accepted {
87+
string id = 1;
88+
int64 created_at = 2;
89+
}
90+
oneof response {
91+
Accepted accepted = 1;
92+
InvalidFriendshipAction invalid_friendship_action = 2;
93+
InternalServerError internal_server_error = 3;
94+
}
95+
}
96+
97+
message FriendshipUpdate {
98+
message AcceptResponse { User user = 1; }
99+
message RejectResponse { User user = 1; }
100+
message DeleteResponse { User user = 1; }
101+
message CancelResponse { User user = 1; }
102+
103+
oneof update {
104+
FriendshipRequestResponse request = 1;
105+
AcceptResponse accept = 2;
106+
RejectResponse reject = 3;
107+
DeleteResponse delete = 4;
108+
CancelResponse cancel = 5;
109+
}
110+
}
111+
112+
message GetFriendshipStatusPayload {
113+
User user = 1;
114+
}
115+
116+
enum FriendshipStatus {
117+
REQUEST_SENT = 0;
118+
REQUEST_RECEIVED = 1;
119+
CANCELED = 2;
120+
ACCEPTED = 3;
121+
REJECTED = 4;
122+
DELETED = 5;
123+
BLOCKED = 6;
124+
}
125+
126+
message GetFriendshipStatusResponse {
127+
message Ok {
128+
FriendshipStatus status = 1;
129+
optional string message = 2;
130+
}
131+
oneof response {
132+
Ok accepted = 1;
133+
InternalServerError internal_server_error = 2;
134+
}
135+
}
136+
137+
service SocialService {
138+
// Get the list of friends for the authenticated user
139+
rpc GetFriends(GetFriendsPayload) returns (PaginatedUsersResponse) {}
140+
141+
// Get the list of mutual friends between the authenticated user and the one in the parameter
142+
rpc GetMutualFriends(GetMutualFriendsPayload) returns (PaginatedUsersResponse) {}
143+
144+
// Get the pending friendship requests for the authenticated user
145+
rpc GetPendingFriendshipRequests(GetFriendshipRequestsPayload) returns (PaginatedFriendshipRequestsResponse) {}
146+
147+
// Get the sent friendship requests for the authenticated user
148+
rpc GetSentFriendshipRequests(GetFriendshipRequestsPayload) returns (PaginatedFriendshipRequestsResponse) {}
149+
150+
// Create or update friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE
151+
rpc UpsertFriendship(UpsertFriendshipPayload)
152+
returns (UpsertFriendshipResponse) {}
153+
154+
// Subscribe to updates of friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE
155+
rpc SubscribeToFriendshipUpdates(google.protobuf.Empty)
156+
returns (stream FriendshipUpdate) {}
157+
158+
rpc GetFriendshipStatus(GetFriendshipStatusPayload) returns (GetFriendshipStatusResponse) {}
159+
}

proto/decentraland/social_service_v2/social_service.proto

Lines changed: 0 additions & 111 deletions
This file was deleted.

public/social.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
syntax = "proto3";
2+
23
package decentraland.social;
34

4-
import public "decentraland/social/friendships/friendships.proto";
5+
import public "decentraland/social_service/v1/social_service_v1.proto";
6+
import public "decentraland/social_service/v2/social_service_v2.proto";

public/social_service_v2.proto

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)