};
use chrono::{DateTime, FixedOffset};
use itertools::Itertools;
+use lemmy_api_common::context::LemmyContext;
use lemmy_db_schema::newtypes::DbUrl;
use lemmy_utils::error::LemmyError;
-use lemmy_websocket::LemmyContext;
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;
use url::Url;
pub(crate) media_type: Option<MediaTypeMarkdownOrHtml>,
#[serde(deserialize_with = "deserialize_skip_error", default)]
pub(crate) source: Option<Source>,
- /// deprecated, use attachment field
- #[serde(deserialize_with = "deserialize_skip_error", default)]
- pub(crate) url: Option<Url>,
/// most software uses array type for attachment field, so we do the same. nevertheless, we only
/// use the first item
#[serde(default)]
.dereference_local(context)
.await;
- let stickied_changed = Page::is_stickied_changed(&old_post, &self.stickied);
+ let featured_changed = Page::is_featured_changed(&old_post, &self.stickied);
let locked_changed = Page::is_locked_changed(&old_post, &self.comments_enabled);
- Ok(stickied_changed || locked_changed)
+ Ok(featured_changed || locked_changed)
}
- pub(crate) fn is_stickied_changed<E>(
+ pub(crate) fn is_featured_changed<E>(
old_post: &Result<ApubPost, E>,
- new_stickied: &Option<bool>,
+ new_featured_community: &Option<bool>,
) -> bool {
- if let Some(new_stickied) = new_stickied {
+ if let Some(new_featured_community) = new_featured_community {
if let Ok(old_post) = old_post {
- return new_stickied != &old_post.stickied;
+ return new_featured_community != &old_post.featured_community;
}
}