2018-05-12 20:14:43 +00:00
|
|
|
/*
|
2020-03-11 14:56:36 +00:00
|
|
|
* This file is part of ActivityStreams.
|
2018-05-12 20:14:43 +00:00
|
|
|
*
|
2020-03-10 19:55:15 +00:00
|
|
|
* Copyright © 2020 Riley Trautman
|
2018-05-12 20:14:43 +00:00
|
|
|
*
|
2020-03-11 14:56:36 +00:00
|
|
|
* ActivityStreams 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.
|
|
|
|
*
|
2020-03-11 14:56:36 +00:00
|
|
|
* ActivityStreams 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
|
2020-03-11 14:56:36 +00:00
|
|
|
* along with ActivityStreams. If not, see <http://www.gnu.org/licenses/>.
|
2018-05-12 20:14:43 +00:00
|
|
|
*/
|
|
|
|
|
2020-03-11 14:56:36 +00:00
|
|
|
use crate::{
|
2020-03-11 16:17:40 +00:00
|
|
|
link::{kind::*, properties::*, Link},
|
|
|
|
PropRefs,
|
2018-05-19 00:38:14 +00:00
|
|
|
};
|
2020-03-11 16:17:40 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2018-05-12 05:31:33 +00:00
|
|
|
|
2020-03-11 16:17:40 +00:00
|
|
|
#[cfg(feature = "types")]
|
|
|
|
/// A specialized Link that represents an @mention.
|
|
|
|
#[derive(Clone, Debug, Default, Deserialize, PropRefs, Serialize)]
|
2018-05-12 05:31:33 +00:00
|
|
|
#[serde(rename_all = "camelCase")]
|
2020-03-11 16:17:40 +00:00
|
|
|
pub struct Mention {
|
2018-05-12 05:31:33 +00:00
|
|
|
#[serde(rename = "type")]
|
2019-01-28 18:57:03 +00:00
|
|
|
#[serde(alias = "objectType")]
|
|
|
|
#[serde(alias = "verb")]
|
2020-03-11 16:17:40 +00:00
|
|
|
kind: MentionType,
|
2018-05-12 19:35:10 +00:00
|
|
|
|
2020-03-11 16:17:40 +00:00
|
|
|
/// Adds all valid link properties to this struct
|
2018-05-12 05:31:33 +00:00
|
|
|
#[serde(flatten)]
|
2020-03-11 16:17:40 +00:00
|
|
|
#[activitystreams(Link)]
|
|
|
|
pub link_props: LinkProperties,
|
2018-05-12 05:31:33 +00:00
|
|
|
}
|