syntax = "proto3"; package protocol.chat.v1; import "harmonytypes/v1/types.proto"; option go_package = "github.com/harmony-development/legato/gen/chat/v1"; // The kind of a guild. message GuildKind { // A "normal" guild as in a guild that allows multiple channels. message Normal {} // A "room" guild as in a guild that only has one channel. // // - Clients should not show a channel list for guilds of this type. message Room {} // A "direct message" guild as in a guild that has at most two members, // and has only one channel. // // - Clients should not show a channel list for guilds of this type. // - Clients should show this guild in the guild list with the profile picture // and the username of the other user. // - Servers should "upgrade" this guild to a "room" guild if another // user joins the guild. A name should be crafted using the algorithm // described below: // - Get at most 3 members' usernames, by their // - Concat them with ", " as a seperator. message DirectMessage { // Whether this direct message was rejected by the invitee or not. bool rejected = 1; } // The kind. If this is empty, assume it is `Normal`. oneof kind { // A "normal" guild. Normal normal = 1; // A "room" guild. Room room = 2; // A "direct message" guild. DirectMessage direct_message = 3; } } // Object representing a guild without the ID part. message Guild { // The name of the guild. // // This will be empty if the guild kind is "direct message". See // the documentation of "direct message" guild kind on how to display // a name for those guilds. string name = 1; // The picture HMC of the guild. optional string picture = 2; // User ID of the owners of the guild. repeated uint64 owner_ids = 3; // The kind of this guild. GuildKind kind = 4; // Metadata of the guild. optional harmonytypes.v1.Metadata metadata = 5; } // Object representing a guild with the ID part. message GuildWithId { // The ID of the guild. uint64 guild_id = 1; // The guild. Guild guild = 2; } // Object representing an invite without the ID part. message Invite { // Possible uses of this invite. A use of `0` means infinite uses. uint32 possible_uses = 1; // Total use count of this invite. uint32 use_count = 2; } // Invite with ID. message InviteWithId { // ID of the invite. string invite_id = 1; // The invite data. Invite invite = 2; } // A pending invite. message PendingInvite { // Invite ID of the invite. string invite_id = 1; // Server ID of the server the inviter is on. optional string server_id = 2; // User ID of the inviter. uint64 inviter_id = 3; } // Object representing a guild list entry. message GuildListEntry { // Guild ID of this guild entry. uint64 guild_id = 1; // Server ID of the homeserver of this guild. string server_id = 2; } // A reason for why a user has left a guild. enum LeaveReason { // The user left the guild willingly. LEAVE_REASON_WILLINGLY_UNSPECIFIED = 0; // The user was banned from the guild. LEAVE_REASON_BANNED = 1; // The user was kicked from the guild. LEAVE_REASON_KICKED = 2; } // Request type used in `CreateGuild` endpoint. message CreateGuildRequest { // The name of the guild. string name = 1; // The picture HMC of the guild. optional string picture = 2; // Metadata of the guild. optional harmonytypes.v1.Metadata metadata = 3; } // Used in the `CreateGuild` endpoint. message CreateGuildResponse { // Guild ID of the guild that was created. uint64 guild_id = 1; } // Request type used in `CreateRoom` endpoint. message CreateRoomRequest { // The name of the guild. string name = 1; // The picture HMC of the guild. optional string picture = 2; // Metadata of the guild. optional harmonytypes.v1.Metadata metadata = 3; } // Used in the `CreateRoom` endpoint. message CreateRoomResponse { // Guild ID of the guild that was created. uint64 guild_id = 1; } // Used in the `CreateDirectMessage` endpoint. message CreateDirectMessageRequest { // The user name of the user to DM with. string user_name = 1; // The server ID of the server the user is on. // // Should be left unspecified if it's a user on the homeserver. optional string server_id = 2; } // Used in the `CreateDirectMessage` endpoint. message CreateDirectMessageResponse { // Guild ID of the just created "direct message" guild. uint64 guild_id = 1; } // Used in the `CreateInvite` endpoint. message CreateInviteRequest { // Guild ID of the guild to create an invite in. uint64 guild_id = 1; // The name of the invite. string name = 2; // The possible uses of the invite. // // A possible use of `0` means that the invite can be used infinitely many times. uint32 possible_uses = 3; } // Used in the `CreateInvite` endpoint. message CreateInviteResponse { // The invite ID of the invite that was created. string invite_id = 1; } // Used in the `GetGuildList` endpoint. message GetGuildListRequest {} // Used in the `GetGuildList` endpoint. message GetGuildListResponse { // Guild list returned by the server. repeated GuildListEntry guilds = 1; } // Used in the `GetGuild` endpoint. message GetGuildRequest { // Guild ID of the guild to get information about. uint64 guild_id = 1; } // Used in the `GetGuild` endpoint. message GetGuildResponse { // The information of the guild requested. Guild guild = 1; } // Used in the `GetGuildInvites` endpoint. message GetGuildInvitesRequest { // Guild ID of the guild you want to get invites of. uint64 guild_id = 1; } // Used in the `GetGuildInvites` endpoint. message GetGuildInvitesResponse { // The invites of the guild, with IDs. repeated InviteWithId invites = 1; } // Used in the `GetGuildMembers` endpoint. message GetGuildMembersRequest { // Guild ID of the guild you want to get members of. uint64 guild_id = 1; } // Used in the `GetGuildMembers` endpoint. message GetGuildMembersResponse { // User IDs of all the guild members. repeated uint64 members = 1; } // Used in the `UpdateGuildInformation` endpoint. message UpdateGuildInformationRequest { // Guild ID of the guild you want to update the information of. uint64 guild_id = 1; // New name for the guild. optional string new_name = 2; // New picture for the guild. optional string new_picture = 3; // New metadata for the guild. optional harmonytypes.v1.Metadata new_metadata = 4; } // Used in the `UpdateGuildInformation` endpoint. message UpdateGuildInformationResponse {} // Used in the `UpgradeRoomToGuild` endpoint. message UpgradeRoomToGuildRequest { // Guild ID of the "room" guild to upgrade to a "normal" guild. uint64 guild_id = 1; } // Used in the `UpgradeRoomToGuild` endpoint. message UpgradeRoomToGuildResponse {} // Used in the `DeleteGuild` endpoint. message DeleteGuildRequest { // Guild ID of the guild you want to delete. uint64 guild_id = 1; } // Used in the `DeleteGuild` endpoint. message DeleteGuildResponse {} // Used in the `DeleteInvite` endpoint. message DeleteInviteRequest { // Guild ID of the guild where the invite is located. uint64 guild_id = 1; // Invite ID of the invite you want to delete. string invite_id = 2; } // Used in the `DeleteInvite` endpoint. message DeleteInviteResponse {} // Used in the `JoinGuild` endpoint. message JoinGuildRequest { // Invite ID of the guild you want to join. string invite_id = 1; } // Used in the `JoinGuild` endpoint. message JoinGuildResponse { // Guild ID of the guild you joined. uint64 guild_id = 1; } // Used in the `PreviewGuild` endpoint. message PreviewGuildRequest { // Invite ID of the guild you want to get information from. string invite_id = 1; } // Used in the `PreviewGuild` endpoint. message PreviewGuildResponse { // Name of the guild requested. string name = 1; // Picture of the guild requested. optional string picture = 2; // Member count of the guild requested. uint64 member_count = 3; } // Used in the `LeaveGuild` endpoint. message LeaveGuildRequest { // Guild ID of the guild you want to leave. uint64 guild_id = 1; } // Used in the `LeaveGuild` endpoint. message LeaveGuildResponse {} // Used in `BanUser` endpoint. message BanUserRequest { // The guild ID of the guild to ban the user from. uint64 guild_id = 1; // The ID of the user to ban. uint64 user_id = 2; } // Used in `BanUser` endpoint. message BanUserResponse {} // Used in `KickUser` endpoint. message KickUserRequest { // The guild ID of the guild to kick the user from. uint64 guild_id = 1; // The user ID of the user to kick. uint64 user_id = 2; } // Used in `KickUser` endpoint. message KickUserResponse {} // Used in `UnbanUser` endpoint. message UnbanUserRequest { // The guild ID of the guild to unban the user from. uint64 guild_id = 1; // The user ID of the user to unban. uint64 user_id = 2; } // Used in `UnbanUser` endpoint. message UnbanUserResponse {} // Used in `GetBannedUsers` endpoint. message GetBannedUsersRequest { // Guild ID to get banned users for. uint64 guild_id = 1; } // Used in `GetBannedUsers` endpoint. message GetBannedUsersResponse { // The user IDs of banned users. repeated uint64 banned_users = 1; } // Request for GrantOwnership message GrantOwnershipRequest { // Guild ID of the guild to give a user ownership on. uint64 guild_id = 1; // The ID of the new owner to add. uint64 new_owner_id = 2; } // Response for GrantOwnership message GrantOwnershipResponse {} // Request for GiveUpOwnership message GiveUpOwnershipRequest { // Guild ID to give up your ownership on. uint64 guild_id = 1; } // Response for GiveUpOwnership message GiveUpOwnershipResponse {} // Used in `GetPendingInvites` endpoint. message GetPendingInvitesRequest {} // Used in `GetPendingInvites` endpoint. message GetPendingInvitesResponse { // The pending invite(s). repeated PendingInvite pending_invites = 1; } // Used in `RejectPendingInvite` endpoint. message RejectPendingInviteRequest { // Invite ID of the pending invite to reject. string invite_id = 1; // Server ID of the pending invite to reject. optional string server_id = 2; } // Used in `RejectPendingInvite` endpoint. message RejectPendingInviteResponse {} // Used in `IgnorePendingInvite` endpoint. message IgnorePendingInviteRequest { // ID of the pending invite to ignore. string invite_id = 1; // Server ID of the pending invite to reject. optional string server_id = 2; } // Used in `IgnorePendingInvite` endpoint. message IgnorePendingInviteResponse {} // Used in `InviteUserToGuild` endpoint. message InviteUserToGuildRequest { // User name of the user to invite. string user_name = 1; // Server ID of the user if they are on another server. optional string server_id = 2; // Guild ID of the guild to invite to. uint64 guild_id = 3; } // Used in `InviteUserToGuild` endpoint. message InviteUserToGuildResponse {}