Skip to main content
Complete reference for all friend/relationship-related Protocol Buffer messages.

GetRelationships

Retrieve all relationships (friends, pending, blocked). Request: friends.GetRelationshipsResponse: friends.Relationships No parameters.

Relationships

relationships
types.Relationship[]
Array of relationship objects
users
types.User[]
Array of user objects referenced in relationships

SyncFriends

Sync friends from external platforms. Request: friends.SyncFriendsResponse: ()
platform_user_id
string
required
User’s identifier on the platform
hashed_platform_user_id
bytes
required
Hashed platform user identifier
platform_user_name
string
User’s name on the platform (optional)
platform
string
required
Platform identifier (e.g., “discord”, “twitter”)
friend_ids_hashed
bytes[]
required
Array of hashed friend identifiers
community_ids_hashed
bytes[]
required
Array of hashed community identifiers

ChangeRelationship

Change relationship with another user. Request: friends.ChangeRelationshipResponse: ()
user
refs.UserRef
required
Reference to the user
change
RelationshipChangeType
required
Type of relationship change to perform

RelationshipChangeType

Enum values:
INVALID
0
Invalid/unknown type
REQUEST_FRIEND
1
Send friend request
ACCEPT_FRIEND
2
Accept friend request
REMOVE_FRIEND
3
Remove friend or cancel request
BLOCK
4
Block user
UNBLOCK
5
Unblock user

Protocol Definition

syntax = "proto3";

package tangle.client.friends;
import "types.proto";
import "refs.proto";

// friends.getRelationships -> Relationships
message GetRelationships {}
message Relationships {
  repeated types.Relationship relationships = 1;
  repeated types.User users = 2;
}

// friends.syncFriends -> ()
message SyncFriends {
  string platform_user_id = 1;
  bytes hashed_platform_user_id = 2;
  optional string platform_user_name = 3;
  string platform = 4;
  repeated bytes friend_ids_hashed = 5;
  repeated bytes community_ids_hashed = 6;
}

// friends.changeRelationship -> ()
message ChangeRelationship {
  refs.UserRef user = 1;
  RelationshipChangeType change = 2;

  enum RelationshipChangeType {
    INVALID = 0;
    REQUEST_FRIEND = 1;
    ACCEPT_FRIEND = 2;
    REMOVE_FRIEND = 3;
    BLOCK = 4;
    UNBLOCK = 5;
  }
}

Build docs developers (and LLMs) love