fetcher::user_or_community::{PersonOrGroupType, UserOrCommunity},
local_instance,
objects::{community::ApubCommunity, person::ApubPerson, post::ApubPost},
- protocol::{ImageObject, Source},
+ protocol::{objects::LanguageTag, ImageObject, Source},
};
use activitypub_federation::{
core::object_id::ObjectId,
use activitystreams_kinds::{link::LinkType, object::ImageType};
use chrono::{DateTime, FixedOffset};
use itertools::Itertools;
-use lemmy_db_schema::{newtypes::DbUrl, source::language::Language};
+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;
-#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
pub enum PageType {
Page,
Article,
pub(crate) language: Option<LanguageTag>,
}
-#[derive(Clone, Debug, Deserialize, Serialize)]
-#[serde(rename_all = "camelCase")]
-pub(crate) struct LanguageTag {
- pub(crate) identifier: String,
- pub(crate) name: String,
-}
-
-impl LanguageTag {
- pub(crate) fn new(lang: Language) -> Option<LanguageTag> {
- // undetermined
- if lang.code == "und" {
- None
- } else {
- Some(LanguageTag {
- identifier: lang.code,
- name: lang.name,
- })
- }
- }
-}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct Link {