chorus/types/events/
relationship.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5use crate::types::{events::WebSocketEvent, Relationship, RelationshipType, Snowflake};
6use serde::{Deserialize, Serialize};
7
8#[derive(Debug, Deserialize, Serialize, Default, Clone, WebSocketEvent)]
9/// See <https://github.com/spacebarchat/server/issues/204>
10pub struct RelationshipAdd {
11    #[serde(flatten)]
12    pub relationship: Relationship,
13    pub should_notify: bool,
14}
15
16#[derive(Debug, Deserialize, Serialize, Default, Clone, WebSocketEvent, PartialEq, Eq, Hash, PartialOrd, Ord, Copy)]
17/// See <https://github.com/spacebarchat/server/issues/203>
18pub struct RelationshipRemove {
19    pub id: Snowflake,
20    #[serde(rename = "type")]
21    pub relationship_type: RelationshipType,
22}
23