2018-05-12 20:14:43 +00:00
|
|
|
/*
|
2018-05-14 03:24:41 +00:00
|
|
|
* This file is part of ActivityStreams Types.
|
2018-05-12 20:14:43 +00:00
|
|
|
*
|
|
|
|
* Copyright © 2018 Riley Trautman
|
|
|
|
*
|
2018-05-14 03:24:41 +00:00
|
|
|
* ActivityStreams Types is free software: you can redistribute it and/or modify
|
2018-05-12 20:14:43 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2018-05-14 03:24:41 +00:00
|
|
|
* ActivityStreams Types is distributed in the hope that it will be useful,
|
2018-05-12 20:14:43 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-05-14 03:24:41 +00:00
|
|
|
* along with ActivityStreams Types. If not, see <http://www.gnu.org/licenses/>.
|
2018-05-12 20:14:43 +00:00
|
|
|
*/
|
|
|
|
|
2018-05-19 00:38:14 +00:00
|
|
|
use activitystreams_traits::{Activity, Object};
|
2018-05-12 05:31:33 +00:00
|
|
|
|
2018-05-19 00:38:14 +00:00
|
|
|
use super::{
|
2018-08-03 21:22:34 +00:00
|
|
|
kind::FlagType,
|
2018-08-04 03:43:01 +00:00
|
|
|
properties::{ActivityProperties, FlagProperties},
|
|
|
|
ActivityExt,
|
2018-05-19 00:38:14 +00:00
|
|
|
};
|
2018-08-04 03:43:01 +00:00
|
|
|
use object::{properties::ObjectProperties, ObjectExt};
|
2018-05-12 05:31:33 +00:00
|
|
|
|
2018-05-14 06:18:12 +00:00
|
|
|
/// Indicates that the actor is "flagging" the object.
|
|
|
|
///
|
|
|
|
/// Flagging is defined in the sense common to many social platforms as reporting content as being
|
|
|
|
/// inappropriate for any number of reasons.
|
2018-05-13 20:58:47 +00:00
|
|
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
2018-05-12 05:31:33 +00:00
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
pub struct Flag {
|
|
|
|
#[serde(rename = "type")]
|
2019-01-28 18:57:03 +00:00
|
|
|
#[serde(alias = "objectType")]
|
|
|
|
#[serde(alias = "verb")]
|
2018-05-14 06:18:12 +00:00
|
|
|
pub kind: FlagType,
|
2018-05-12 19:35:10 +00:00
|
|
|
|
2018-05-19 00:38:14 +00:00
|
|
|
/// Adds all valid flag properties to this struct
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub flag_props: FlagProperties,
|
2018-05-12 19:35:10 +00:00
|
|
|
|
2018-05-14 06:18:12 +00:00
|
|
|
/// Adds all valid object properties to this struct
|
2018-05-12 05:31:33 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub object_props: ObjectProperties,
|
2018-05-12 19:35:10 +00:00
|
|
|
|
2018-05-14 06:18:12 +00:00
|
|
|
/// Adds all valid activity properties to this struct
|
2018-05-12 05:31:33 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub activity_props: ActivityProperties,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Object for Flag {}
|
2018-08-03 21:22:34 +00:00
|
|
|
impl ObjectExt for Flag {
|
|
|
|
fn props(&self) -> &ObjectProperties {
|
|
|
|
&self.object_props
|
|
|
|
}
|
|
|
|
|
|
|
|
fn props_mut(&mut self) -> &mut ObjectProperties {
|
|
|
|
&mut self.object_props
|
|
|
|
}
|
|
|
|
}
|
2018-05-12 05:31:33 +00:00
|
|
|
impl Activity for Flag {}
|
2018-08-03 21:22:34 +00:00
|
|
|
impl ActivityExt for Flag {
|
|
|
|
fn props(&self) -> &ActivityProperties {
|
|
|
|
&self.activity_props
|
|
|
|
}
|
|
|
|
|
|
|
|
fn props_mut(&mut self) -> &mut ActivityProperties {
|
|
|
|
&mut self.activity_props
|
|
|
|
}
|
|
|
|
}
|