mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-08 09:24:17 +00:00
Merge branch 'main' into bearer-token
This commit is contained in:
commit
ed8dae99f1
24
Cargo.lock
generated
24
Cargo.lock
generated
|
@ -2621,7 +2621,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_api"
|
name = "lemmy_api"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activitypub_federation",
|
"activitypub_federation",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
|
@ -2651,7 +2651,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_api_common"
|
name = "lemmy_api_common"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activitypub_federation",
|
"activitypub_federation",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
|
@ -2683,7 +2683,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_api_crud"
|
name = "lemmy_api_crud"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activitypub_federation",
|
"activitypub_federation",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
|
@ -2705,7 +2705,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_apub"
|
name = "lemmy_apub"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activitypub_federation",
|
"activitypub_federation",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
|
@ -2742,7 +2742,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_db_schema"
|
name = "lemmy_db_schema"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activitypub_federation",
|
"activitypub_federation",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
@ -2778,7 +2778,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_db_views"
|
name = "lemmy_db_views"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"diesel",
|
"diesel",
|
||||||
|
@ -2796,7 +2796,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_db_views_actor"
|
name = "lemmy_db_views_actor"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"diesel",
|
"diesel",
|
||||||
|
@ -2809,7 +2809,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_db_views_moderator"
|
name = "lemmy_db_views_moderator"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"diesel",
|
"diesel",
|
||||||
"diesel-async",
|
"diesel-async",
|
||||||
|
@ -2821,7 +2821,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_federate"
|
name = "lemmy_federate"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activitypub_federation",
|
"activitypub_federation",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -2853,7 +2853,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_routes"
|
name = "lemmy_routes"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activitypub_federation",
|
"activitypub_federation",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
|
@ -2878,7 +2878,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_server"
|
name = "lemmy_server"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activitypub_federation",
|
"activitypub_federation",
|
||||||
"actix-cors",
|
"actix-cors",
|
||||||
|
@ -2926,7 +2926,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_utils"
|
name = "lemmy_utils"
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
24
Cargo.toml
24
Cargo.toml
|
@ -1,5 +1,5 @@
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.18.1"
|
version = "0.18.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "A link aggregator for the fediverse"
|
description = "A link aggregator for the fediverse"
|
||||||
license = "AGPL-3.0"
|
license = "AGPL-3.0"
|
||||||
|
@ -58,16 +58,16 @@ members = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
lemmy_api = { version = "=0.18.1", path = "./crates/api" }
|
lemmy_api = { version = "=0.18.4", path = "./crates/api" }
|
||||||
lemmy_api_crud = { version = "=0.18.1", path = "./crates/api_crud" }
|
lemmy_api_crud = { version = "=0.18.4", path = "./crates/api_crud" }
|
||||||
lemmy_apub = { version = "=0.18.1", path = "./crates/apub" }
|
lemmy_apub = { version = "=0.18.4", path = "./crates/apub" }
|
||||||
lemmy_utils = { version = "=0.18.1", path = "./crates/utils" }
|
lemmy_utils = { version = "=0.18.4", path = "./crates/utils" }
|
||||||
lemmy_db_schema = { version = "=0.18.1", path = "./crates/db_schema" }
|
lemmy_db_schema = { version = "=0.18.4", path = "./crates/db_schema" }
|
||||||
lemmy_api_common = { version = "=0.18.1", path = "./crates/api_common" }
|
lemmy_api_common = { version = "=0.18.4", path = "./crates/api_common" }
|
||||||
lemmy_routes = { version = "=0.18.1", path = "./crates/routes" }
|
lemmy_routes = { version = "=0.18.4", path = "./crates/routes" }
|
||||||
lemmy_db_views = { version = "=0.18.1", path = "./crates/db_views" }
|
lemmy_db_views = { version = "=0.18.4", path = "./crates/db_views" }
|
||||||
lemmy_db_views_actor = { version = "=0.18.1", path = "./crates/db_views_actor" }
|
lemmy_db_views_actor = { version = "=0.18.4", path = "./crates/db_views_actor" }
|
||||||
lemmy_db_views_moderator = { version = "=0.18.1", path = "./crates/db_views_moderator" }
|
lemmy_db_views_moderator = { version = "=0.18.4", path = "./crates/db_views_moderator" }
|
||||||
activitypub_federation = { version = "0.5.0-beta.3", default-features = false, features = [
|
activitypub_federation = { version = "0.5.0-beta.3", default-features = false, features = [
|
||||||
"actix-web",
|
"actix-web",
|
||||||
] }
|
] }
|
||||||
|
@ -169,5 +169,5 @@ prometheus = { version = "0.13.3", features = ["process"], optional = true }
|
||||||
actix-web-prom = { version = "0.6.0", optional = true }
|
actix-web-prom = { version = "0.6.0", optional = true }
|
||||||
serial_test = { workspace = true }
|
serial_test = { workspace = true }
|
||||||
clap = { version = "4.3.19", features = ["derive"] }
|
clap = { version = "4.3.19", features = ["derive"] }
|
||||||
lemmy_federate = { version = "0.18.1", path = "crates/federate" }
|
|
||||||
actix-web-httpauth = { workspace = true }
|
actix-web-httpauth = { workspace = true }
|
||||||
|
lemmy_federate = { version = "0.18.4", path = "crates/federate" }
|
||||||
|
|
|
@ -9,7 +9,10 @@ use lemmy_api_common::{
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
community::{
|
community::{
|
||||||
CommunityFollower, CommunityFollowerForm, CommunityPersonBan, CommunityPersonBanForm,
|
CommunityFollower,
|
||||||
|
CommunityFollowerForm,
|
||||||
|
CommunityPersonBan,
|
||||||
|
CommunityPersonBanForm,
|
||||||
},
|
},
|
||||||
moderator::{ModBanFromCommunity, ModBanFromCommunityForm},
|
moderator::{ModBanFromCommunity, ModBanFromCommunityForm},
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,7 +5,8 @@ use lemmy_api_common::{
|
||||||
utils::password_length_check,
|
utils::password_length_check,
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::{
|
use lemmy_db_schema::source::{
|
||||||
local_user::LocalUser, password_reset_request::PasswordResetRequest,
|
local_user::LocalUser,
|
||||||
|
password_reset_request::PasswordResetRequest,
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::{LemmyError, LemmyErrorExt, LemmyErrorType};
|
use lemmy_utils::error::{LemmyError, LemmyErrorExt, LemmyErrorType};
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,9 @@ use crate::{build_totp_2fa, generate_totp_2fa_secret};
|
||||||
use activitypub_federation::config::Data;
|
use activitypub_federation::config::Data;
|
||||||
use actix_web::web::Json;
|
use actix_web::web::Json;
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
context::LemmyContext, person::GenerateTotpSecretResponse, sensitive::Sensitive,
|
context::LemmyContext,
|
||||||
|
person::GenerateTotpSecretResponse,
|
||||||
|
sensitive::Sensitive,
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::local_user::{LocalUser, LocalUserUpdateForm},
|
source::local_user::{LocalUser, LocalUserUpdateForm},
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
use actix_web::web::{Data, Json};
|
use actix_web::web::{Data, Json};
|
||||||
use lemmy_api_common::{context::LemmyContext, person::GetRepliesResponse};
|
use lemmy_api_common::{context::LemmyContext, person::GetRepliesResponse};
|
||||||
use lemmy_db_schema::source::{
|
use lemmy_db_schema::source::{
|
||||||
comment_reply::CommentReply, person_mention::PersonMention, private_message::PrivateMessage,
|
comment_reply::CommentReply,
|
||||||
|
person_mention::PersonMention,
|
||||||
|
private_message::PrivateMessage,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::error::{LemmyError, LemmyErrorExt, LemmyErrorType};
|
use lemmy_utils::error::{LemmyError, LemmyErrorExt, LemmyErrorType};
|
||||||
|
|
|
@ -4,7 +4,10 @@ use lemmy_api_common::{
|
||||||
person::{GetReportCount, GetReportCountResponse},
|
person::{GetReportCount, GetReportCountResponse},
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{
|
use lemmy_db_views::structs::{
|
||||||
CommentReportView, LocalUserView, PostReportView, PrivateMessageReportView,
|
CommentReportView,
|
||||||
|
LocalUserView,
|
||||||
|
PostReportView,
|
||||||
|
PrivateMessageReportView,
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,9 @@ use lemmy_api_common::{
|
||||||
post::{CreatePostLike, PostResponse},
|
post::{CreatePostLike, PostResponse},
|
||||||
send_activity::{ActivityChannel, SendActivityData},
|
send_activity::{ActivityChannel, SendActivityData},
|
||||||
utils::{
|
utils::{
|
||||||
check_community_ban, check_community_deleted_or_removed, check_downvotes_enabled,
|
check_community_ban,
|
||||||
|
check_community_deleted_or_removed,
|
||||||
|
check_downvotes_enabled,
|
||||||
mark_post_as_read,
|
mark_post_as_read,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,8 @@ use lemmy_api_common::{
|
||||||
utils::is_admin,
|
utils::is_admin,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::{
|
use lemmy_db_views::{
|
||||||
private_message_report_view::PrivateMessageReportQuery, structs::LocalUserView,
|
private_message_report_view::PrivateMessageReportQuery,
|
||||||
|
structs::LocalUserView,
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
use actix_web::web::{Data, Json};
|
use actix_web::web::{Data, Json};
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
context::LemmyContext, site::GetFederatedInstancesResponse, utils::build_federated_instances,
|
context::LemmyContext,
|
||||||
|
site::GetFederatedInstancesResponse,
|
||||||
|
utils::build_federated_instances,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::SiteView;
|
use lemmy_db_views::structs::SiteView;
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
|
@ -11,10 +11,22 @@ use lemmy_db_schema::{
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_db_views_moderator::structs::{
|
use lemmy_db_views_moderator::structs::{
|
||||||
AdminPurgeCommentView, AdminPurgeCommunityView, AdminPurgePersonView, AdminPurgePostView,
|
AdminPurgeCommentView,
|
||||||
ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModFeaturePostView,
|
AdminPurgeCommunityView,
|
||||||
ModHideCommunityView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView,
|
AdminPurgePersonView,
|
||||||
ModRemovePostView, ModTransferCommunityView, ModlogListParams,
|
AdminPurgePostView,
|
||||||
|
ModAddCommunityView,
|
||||||
|
ModAddView,
|
||||||
|
ModBanFromCommunityView,
|
||||||
|
ModBanView,
|
||||||
|
ModFeaturePostView,
|
||||||
|
ModHideCommunityView,
|
||||||
|
ModLockPostView,
|
||||||
|
ModRemoveCommentView,
|
||||||
|
ModRemoveCommunityView,
|
||||||
|
ModRemovePostView,
|
||||||
|
ModTransferCommunityView,
|
||||||
|
ModlogListParams,
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
use ModlogActionType::*;
|
use ModlogActionType::*;
|
||||||
|
|
|
@ -6,7 +6,8 @@ use lemmy_api_common::{
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::local_site::LocalSite;
|
use lemmy_db_schema::source::local_site::LocalSite;
|
||||||
use lemmy_db_views::{
|
use lemmy_db_views::{
|
||||||
registration_application_view::RegistrationApplicationQuery, structs::LocalUserView,
|
registration_application_view::RegistrationApplicationQuery,
|
||||||
|
structs::LocalUserView,
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
use actix_web::web::{Data, Json};
|
use actix_web::web::{Data, Json};
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
context::LemmyContext, site::GetUnreadRegistrationApplicationCountResponse, utils::is_admin,
|
context::LemmyContext,
|
||||||
|
site::GetUnreadRegistrationApplicationCountResponse,
|
||||||
|
utils::is_admin,
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::local_site::LocalSite;
|
use lemmy_db_schema::source::local_site::LocalSite;
|
||||||
use lemmy_db_views::structs::{LocalUserView, RegistrationApplicationView};
|
use lemmy_db_views::structs::{LocalUserView, RegistrationApplicationView};
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::{CommentId, CommentReportId, CommunityId, LanguageId, LocalUserId, PostId},
|
newtypes::{CommentId, CommentReportId, CommunityId, LanguageId, LocalUserId, PostId},
|
||||||
CommentSortType, ListingType,
|
CommentSortType,
|
||||||
|
ListingType,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{CommentReportView, CommentView};
|
use lemmy_db_views::structs::{CommentReportView, CommentView};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::{CommunityId, LanguageId, PersonId},
|
newtypes::{CommunityId, LanguageId, PersonId},
|
||||||
source::site::Site,
|
source::site::Site,
|
||||||
ListingType, SortType,
|
ListingType,
|
||||||
|
SortType,
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView, PersonView};
|
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView, PersonView};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
use crate::sensitive::Sensitive;
|
use crate::sensitive::Sensitive;
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::{CommentReplyId, CommunityId, LanguageId, PersonId, PersonMentionId},
|
newtypes::{CommentReplyId, CommunityId, LanguageId, PersonId, PersonMentionId},
|
||||||
CommentSortType, ListingType, SortType,
|
CommentSortType,
|
||||||
|
ListingType,
|
||||||
|
SortType,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{CommentView, PostView};
|
use lemmy_db_views::structs::{CommentView, PostView};
|
||||||
use lemmy_db_views_actor::structs::{
|
use lemmy_db_views_actor::structs::{
|
||||||
CommentReplyView, CommunityModeratorView, PersonMentionView, PersonView,
|
CommentReplyView,
|
||||||
|
CommunityModeratorView,
|
||||||
|
PersonMentionView,
|
||||||
|
PersonView,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_with::skip_serializing_none;
|
use serde_with::skip_serializing_none;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::{CommentId, CommunityId, DbUrl, LanguageId, PostId, PostReportId},
|
newtypes::{CommentId, CommunityId, DbUrl, LanguageId, PostId, PostReportId},
|
||||||
ListingType, PostFeatureType, SortType,
|
ListingType,
|
||||||
|
PostFeatureType,
|
||||||
|
SortType,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{PaginationCursor, PostReportView, PostView};
|
use lemmy_db_views::structs::{PaginationCursor, PostReportView, PostView};
|
||||||
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
|
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
|
||||||
|
|
|
@ -302,7 +302,10 @@ mod tests {
|
||||||
#![allow(clippy::indexing_slicing)]
|
#![allow(clippy::indexing_slicing)]
|
||||||
|
|
||||||
use crate::request::{
|
use crate::request::{
|
||||||
build_user_agent, fetch_site_metadata, html_to_site_metadata, SiteMetadata,
|
build_user_agent,
|
||||||
|
fetch_site_metadata,
|
||||||
|
html_to_site_metadata,
|
||||||
|
SiteMetadata,
|
||||||
};
|
};
|
||||||
use lemmy_utils::settings::SETTINGS;
|
use lemmy_utils::settings::SETTINGS;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
|
@ -9,7 +9,10 @@ use futures::future::BoxFuture;
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::{CommunityId, DbUrl, PersonId},
|
newtypes::{CommunityId, DbUrl, PersonId},
|
||||||
source::{
|
source::{
|
||||||
comment::Comment, community::Community, person::Person, post::Post,
|
comment::Comment,
|
||||||
|
community::Community,
|
||||||
|
person::Person,
|
||||||
|
post::Post,
|
||||||
private_message::PrivateMessage,
|
private_message::PrivateMessage,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,20 +1,45 @@
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::{CommentId, CommunityId, InstanceId, LanguageId, PersonId, PostId},
|
newtypes::{CommentId, CommunityId, InstanceId, LanguageId, PersonId, PostId},
|
||||||
source::{instance::Instance, language::Language, tagline::Tagline},
|
source::{instance::Instance, language::Language, tagline::Tagline},
|
||||||
ListingType, ModlogActionType, RegistrationMode, SearchType, SortType,
|
ListingType,
|
||||||
|
ModlogActionType,
|
||||||
|
RegistrationMode,
|
||||||
|
SearchType,
|
||||||
|
SortType,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{
|
use lemmy_db_views::structs::{
|
||||||
CommentView, CustomEmojiView, LocalUserView, PostView, RegistrationApplicationView, SiteView,
|
CommentView,
|
||||||
|
CustomEmojiView,
|
||||||
|
LocalUserView,
|
||||||
|
PostView,
|
||||||
|
RegistrationApplicationView,
|
||||||
|
SiteView,
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::{
|
use lemmy_db_views_actor::structs::{
|
||||||
CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView,
|
CommunityBlockView,
|
||||||
InstanceBlockView, PersonBlockView, PersonView,
|
CommunityFollowerView,
|
||||||
|
CommunityModeratorView,
|
||||||
|
CommunityView,
|
||||||
|
InstanceBlockView,
|
||||||
|
PersonBlockView,
|
||||||
|
PersonView,
|
||||||
};
|
};
|
||||||
use lemmy_db_views_moderator::structs::{
|
use lemmy_db_views_moderator::structs::{
|
||||||
AdminPurgeCommentView, AdminPurgeCommunityView, AdminPurgePersonView, AdminPurgePostView,
|
AdminPurgeCommentView,
|
||||||
ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModFeaturePostView,
|
AdminPurgeCommunityView,
|
||||||
ModHideCommunityView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView,
|
AdminPurgePersonView,
|
||||||
ModRemovePostView, ModTransferCommunityView,
|
AdminPurgePostView,
|
||||||
|
ModAddCommunityView,
|
||||||
|
ModAddView,
|
||||||
|
ModBanFromCommunityView,
|
||||||
|
ModBanView,
|
||||||
|
ModFeaturePostView,
|
||||||
|
ModHideCommunityView,
|
||||||
|
ModLockPostView,
|
||||||
|
ModRemoveCommentView,
|
||||||
|
ModRemoveCommunityView,
|
||||||
|
ModRemovePostView,
|
||||||
|
ModTransferCommunityView,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_with::skip_serializing_none;
|
use serde_with::skip_serializing_none;
|
||||||
|
|
|
@ -21,7 +21,9 @@ use lemmy_db_schema::{
|
||||||
};
|
};
|
||||||
use lemmy_db_views::{comment_view::CommentQuery, structs::LocalUserView};
|
use lemmy_db_views::{comment_view::CommentQuery, structs::LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::{
|
use lemmy_db_views_actor::structs::{
|
||||||
CommunityModeratorView, CommunityPersonBanView, CommunityView,
|
CommunityModeratorView,
|
||||||
|
CommunityPersonBanView,
|
||||||
|
CommunityView,
|
||||||
};
|
};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
email::{send_email, translations::Lang},
|
email::{send_email, translations::Lang},
|
||||||
|
|
|
@ -6,8 +6,13 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
send_activity::{ActivityChannel, SendActivityData},
|
send_activity::{ActivityChannel, SendActivityData},
|
||||||
utils::{
|
utils::{
|
||||||
check_community_ban, check_community_deleted_or_removed, check_post_deleted_or_removed,
|
check_community_ban,
|
||||||
generate_local_apub_endpoint, get_post, local_site_to_slur_regex, sanitize_html_api,
|
check_community_deleted_or_removed,
|
||||||
|
check_post_deleted_or_removed,
|
||||||
|
generate_local_apub_endpoint,
|
||||||
|
get_post,
|
||||||
|
local_site_to_slur_regex,
|
||||||
|
sanitize_html_api,
|
||||||
EndpointType,
|
EndpointType,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -26,7 +31,9 @@ use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyError, LemmyErrorExt, LemmyErrorType},
|
error::{LemmyError, LemmyErrorExt, LemmyErrorType},
|
||||||
utils::{
|
utils::{
|
||||||
mention::scrape_text_for_mentions, slurs::remove_slurs, validation::is_valid_body_field,
|
mention::scrape_text_for_mentions,
|
||||||
|
slurs::remove_slurs,
|
||||||
|
validation::is_valid_body_field,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,9 @@ use lemmy_db_views::structs::{CommentView, LocalUserView};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyError, LemmyErrorExt, LemmyErrorType},
|
error::{LemmyError, LemmyErrorExt, LemmyErrorType},
|
||||||
utils::{
|
utils::{
|
||||||
mention::scrape_text_for_mentions, slurs::remove_slurs, validation::is_valid_body_field,
|
mention::scrape_text_for_mentions,
|
||||||
|
slurs::remove_slurs,
|
||||||
|
validation::is_valid_body_field,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,16 +5,26 @@ use lemmy_api_common::{
|
||||||
community::{CommunityResponse, CreateCommunity},
|
community::{CommunityResponse, CreateCommunity},
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{
|
utils::{
|
||||||
generate_followers_url, generate_inbox_url, generate_local_apub_endpoint,
|
generate_followers_url,
|
||||||
generate_shared_inbox_url, is_admin, local_site_to_slur_regex, sanitize_html_api,
|
generate_inbox_url,
|
||||||
sanitize_html_api_opt, EndpointType,
|
generate_local_apub_endpoint,
|
||||||
|
generate_shared_inbox_url,
|
||||||
|
is_admin,
|
||||||
|
local_site_to_slur_regex,
|
||||||
|
sanitize_html_api,
|
||||||
|
sanitize_html_api_opt,
|
||||||
|
EndpointType,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
actor_language::{CommunityLanguage, SiteLanguage},
|
actor_language::{CommunityLanguage, SiteLanguage},
|
||||||
community::{
|
community::{
|
||||||
Community, CommunityFollower, CommunityFollowerForm, CommunityInsertForm, CommunityModerator,
|
Community,
|
||||||
|
CommunityFollower,
|
||||||
|
CommunityFollowerForm,
|
||||||
|
CommunityInsertForm,
|
||||||
|
CommunityModerator,
|
||||||
CommunityModeratorForm,
|
CommunityModeratorForm,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,9 +7,15 @@ use lemmy_api_common::{
|
||||||
request::fetch_site_data,
|
request::fetch_site_data,
|
||||||
send_activity::{ActivityChannel, SendActivityData},
|
send_activity::{ActivityChannel, SendActivityData},
|
||||||
utils::{
|
utils::{
|
||||||
check_community_ban, check_community_deleted_or_removed, generate_local_apub_endpoint,
|
check_community_ban,
|
||||||
honeypot_check, local_site_to_slur_regex, mark_post_as_read, sanitize_html_api,
|
check_community_deleted_or_removed,
|
||||||
sanitize_html_api_opt, EndpointType,
|
generate_local_apub_endpoint,
|
||||||
|
honeypot_check,
|
||||||
|
local_site_to_slur_regex,
|
||||||
|
mark_post_as_read,
|
||||||
|
sanitize_html_api,
|
||||||
|
sanitize_html_api_opt,
|
||||||
|
EndpointType,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
|
|
|
@ -5,8 +5,13 @@ use lemmy_api_common::{
|
||||||
private_message::{CreatePrivateMessage, PrivateMessageResponse},
|
private_message::{CreatePrivateMessage, PrivateMessageResponse},
|
||||||
send_activity::{ActivityChannel, SendActivityData},
|
send_activity::{ActivityChannel, SendActivityData},
|
||||||
utils::{
|
utils::{
|
||||||
check_person_block, generate_local_apub_endpoint, get_interface_language,
|
check_person_block,
|
||||||
local_site_to_slur_regex, sanitize_html_api, send_email_to_user, EndpointType,
|
generate_local_apub_endpoint,
|
||||||
|
get_interface_language,
|
||||||
|
local_site_to_slur_regex,
|
||||||
|
sanitize_html_api,
|
||||||
|
send_email_to_user,
|
||||||
|
EndpointType,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
|
|
|
@ -5,8 +5,11 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
site::{CreateSite, SiteResponse},
|
site::{CreateSite, SiteResponse},
|
||||||
utils::{
|
utils::{
|
||||||
generate_site_inbox_url, is_admin, local_site_rate_limit_to_rate_limit_config,
|
generate_site_inbox_url,
|
||||||
sanitize_html_api, sanitize_html_api_opt,
|
is_admin,
|
||||||
|
local_site_rate_limit_to_rate_limit_config,
|
||||||
|
sanitize_html_api,
|
||||||
|
sanitize_html_api_opt,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
|
@ -26,8 +29,11 @@ use lemmy_utils::{
|
||||||
utils::{
|
utils::{
|
||||||
slurs::{check_slurs, check_slurs_opt},
|
slurs::{check_slurs, check_slurs_opt},
|
||||||
validation::{
|
validation::{
|
||||||
build_and_check_regex, check_site_visibility_valid, is_valid_body_field,
|
build_and_check_regex,
|
||||||
site_description_length_check, site_name_length_check,
|
check_site_visibility_valid,
|
||||||
|
is_valid_body_field,
|
||||||
|
site_description_length_check,
|
||||||
|
site_name_length_check,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,8 +10,12 @@ use lemmy_db_schema::source::{
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{CustomEmojiView, LocalUserView, SiteView};
|
use lemmy_db_views::structs::{CustomEmojiView, LocalUserView, SiteView};
|
||||||
use lemmy_db_views_actor::structs::{
|
use lemmy_db_views_actor::structs::{
|
||||||
CommunityBlockView, CommunityFollowerView, CommunityModeratorView, InstanceBlockView,
|
CommunityBlockView,
|
||||||
PersonBlockView, PersonView,
|
CommunityFollowerView,
|
||||||
|
CommunityModeratorView,
|
||||||
|
InstanceBlockView,
|
||||||
|
PersonBlockView,
|
||||||
|
PersonView,
|
||||||
};
|
};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyError, LemmyErrorExt, LemmyErrorType},
|
error::{LemmyError, LemmyErrorExt, LemmyErrorType},
|
||||||
|
|
|
@ -26,8 +26,11 @@ use lemmy_utils::{
|
||||||
utils::{
|
utils::{
|
||||||
slurs::check_slurs_opt,
|
slurs::check_slurs_opt,
|
||||||
validation::{
|
validation::{
|
||||||
build_and_check_regex, check_site_visibility_valid, is_valid_body_field,
|
build_and_check_regex,
|
||||||
site_description_length_check, site_name_length_check,
|
check_site_visibility_valid,
|
||||||
|
is_valid_body_field,
|
||||||
|
site_description_length_check,
|
||||||
|
site_name_length_check,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,9 +4,17 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{LoginResponse, Register},
|
person::{LoginResponse, Register},
|
||||||
utils::{
|
utils::{
|
||||||
generate_inbox_url, generate_local_apub_endpoint, generate_shared_inbox_url, honeypot_check,
|
generate_inbox_url,
|
||||||
local_site_to_slur_regex, password_length_check, sanitize_html_api, sanitize_html_api_opt,
|
generate_local_apub_endpoint,
|
||||||
send_new_applicant_email_to_admins, send_verification_email, EndpointType,
|
generate_shared_inbox_url,
|
||||||
|
honeypot_check,
|
||||||
|
local_site_to_slur_regex,
|
||||||
|
password_length_check,
|
||||||
|
sanitize_html_api,
|
||||||
|
sanitize_html_api_opt,
|
||||||
|
send_new_applicant_email_to_admins,
|
||||||
|
send_verification_email,
|
||||||
|
EndpointType,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
|
|
|
@ -2,7 +2,10 @@ use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
block::{generate_cc, SiteOrCommunity},
|
block::{generate_cc, SiteOrCommunity},
|
||||||
community::send_activity_in_community,
|
community::send_activity_in_community,
|
||||||
generate_activity_id, send_lemmy_activity, verify_is_public, verify_mod_action,
|
generate_activity_id,
|
||||||
|
send_lemmy_activity,
|
||||||
|
verify_is_public,
|
||||||
|
verify_mod_action,
|
||||||
verify_person_in_community,
|
verify_person_in_community,
|
||||||
},
|
},
|
||||||
activity_lists::AnnouncableActivities,
|
activity_lists::AnnouncableActivities,
|
||||||
|
@ -26,7 +29,10 @@ use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
activity::ActivitySendTargets,
|
activity::ActivitySendTargets,
|
||||||
community::{
|
community::{
|
||||||
CommunityFollower, CommunityFollowerForm, CommunityPersonBan, CommunityPersonBanForm,
|
CommunityFollower,
|
||||||
|
CommunityFollowerForm,
|
||||||
|
CommunityPersonBan,
|
||||||
|
CommunityPersonBanForm,
|
||||||
},
|
},
|
||||||
moderator::{ModBan, ModBanForm, ModBanFromCommunity, ModBanFromCommunityForm},
|
moderator::{ModBan, ModBanForm, ModBanFromCommunity, ModBanFromCommunityForm},
|
||||||
person::{Person, PersonUpdateForm},
|
person::{Person, PersonUpdateForm},
|
||||||
|
|
|
@ -2,7 +2,9 @@ use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
block::{generate_cc, SiteOrCommunity},
|
block::{generate_cc, SiteOrCommunity},
|
||||||
community::send_activity_in_community,
|
community::send_activity_in_community,
|
||||||
generate_activity_id, send_lemmy_activity, verify_is_public,
|
generate_activity_id,
|
||||||
|
send_lemmy_activity,
|
||||||
|
verify_is_public,
|
||||||
},
|
},
|
||||||
activity_lists::AnnouncableActivities,
|
activity_lists::AnnouncableActivities,
|
||||||
insert_received_activity,
|
insert_received_activity,
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
generate_activity_id, generate_announce_activity_id, send_lemmy_activity, verify_is_public,
|
generate_activity_id,
|
||||||
|
generate_announce_activity_id,
|
||||||
|
send_lemmy_activity,
|
||||||
|
verify_is_public,
|
||||||
verify_person_in_community,
|
verify_person_in_community,
|
||||||
},
|
},
|
||||||
activity_lists::AnnouncableActivities,
|
activity_lists::AnnouncableActivities,
|
||||||
|
@ -8,7 +11,9 @@ use crate::{
|
||||||
objects::community::ApubCommunity,
|
objects::community::ApubCommunity,
|
||||||
protocol::{
|
protocol::{
|
||||||
activities::community::announce::{AnnounceActivity, RawAnnouncableActivities},
|
activities::community::announce::{AnnounceActivity, RawAnnouncableActivities},
|
||||||
Id, IdOrNestedObject, InCommunity,
|
Id,
|
||||||
|
IdOrNestedObject,
|
||||||
|
InCommunity,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
community::send_activity_in_community, generate_activity_id, verify_is_public,
|
community::send_activity_in_community,
|
||||||
verify_mod_action, verify_person_in_community,
|
generate_activity_id,
|
||||||
|
verify_is_public,
|
||||||
|
verify_mod_action,
|
||||||
|
verify_person_in_community,
|
||||||
},
|
},
|
||||||
activity_lists::AnnouncableActivities,
|
activity_lists::AnnouncableActivities,
|
||||||
insert_received_activity,
|
insert_received_activity,
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
community::send_activity_in_community, generate_activity_id, verify_is_public,
|
community::send_activity_in_community,
|
||||||
verify_mod_action, verify_person_in_community,
|
generate_activity_id,
|
||||||
|
verify_is_public,
|
||||||
|
verify_mod_action,
|
||||||
|
verify_person_in_community,
|
||||||
},
|
},
|
||||||
activity_lists::AnnouncableActivities,
|
activity_lists::AnnouncableActivities,
|
||||||
insert_received_activity,
|
insert_received_activity,
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
check_community_deleted_or_removed, community::send_activity_in_community,
|
check_community_deleted_or_removed,
|
||||||
generate_activity_id, verify_is_public, verify_mod_action, verify_person_in_community,
|
community::send_activity_in_community,
|
||||||
|
generate_activity_id,
|
||||||
|
verify_is_public,
|
||||||
|
verify_mod_action,
|
||||||
|
verify_person_in_community,
|
||||||
},
|
},
|
||||||
activity_lists::AnnouncableActivities,
|
activity_lists::AnnouncableActivities,
|
||||||
insert_received_activity,
|
insert_received_activity,
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
community::send_activity_in_community, generate_activity_id, verify_is_public,
|
community::send_activity_in_community,
|
||||||
verify_mod_action, verify_person_in_community,
|
generate_activity_id,
|
||||||
|
verify_is_public,
|
||||||
|
verify_mod_action,
|
||||||
|
verify_person_in_community,
|
||||||
},
|
},
|
||||||
activity_lists::AnnouncableActivities,
|
activity_lists::AnnouncableActivities,
|
||||||
insert_received_activity,
|
insert_received_activity,
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
check_community_deleted_or_removed, community::send_activity_in_community,
|
check_community_deleted_or_removed,
|
||||||
generate_activity_id, verify_is_public, verify_person_in_community,
|
community::send_activity_in_community,
|
||||||
|
generate_activity_id,
|
||||||
|
verify_is_public,
|
||||||
|
verify_person_in_community,
|
||||||
},
|
},
|
||||||
activity_lists::AnnouncableActivities,
|
activity_lists::AnnouncableActivities,
|
||||||
insert_received_activity,
|
insert_received_activity,
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
check_community_deleted_or_removed, community::send_activity_in_community,
|
check_community_deleted_or_removed,
|
||||||
generate_activity_id, verify_is_public, verify_mod_action, verify_person_in_community,
|
community::send_activity_in_community,
|
||||||
|
generate_activity_id,
|
||||||
|
verify_is_public,
|
||||||
|
verify_mod_action,
|
||||||
|
verify_person_in_community,
|
||||||
},
|
},
|
||||||
activity_lists::AnnouncableActivities,
|
activity_lists::AnnouncableActivities,
|
||||||
insert_received_activity,
|
insert_received_activity,
|
||||||
|
|
|
@ -3,7 +3,8 @@ use crate::{
|
||||||
insert_received_activity,
|
insert_received_activity,
|
||||||
objects::{person::ApubPerson, private_message::ApubPrivateMessage},
|
objects::{person::ApubPerson, private_message::ApubPrivateMessage},
|
||||||
protocol::activities::{
|
protocol::activities::{
|
||||||
create_or_update::chat_message::CreateOrUpdateChatMessage, CreateOrUpdateType,
|
create_or_update::chat_message::CreateOrUpdateChatMessage,
|
||||||
|
CreateOrUpdateType,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
|
|
|
@ -14,8 +14,12 @@ use lemmy_db_schema::{
|
||||||
comment::{Comment, CommentUpdateForm},
|
comment::{Comment, CommentUpdateForm},
|
||||||
community::{Community, CommunityUpdateForm},
|
community::{Community, CommunityUpdateForm},
|
||||||
moderator::{
|
moderator::{
|
||||||
ModRemoveComment, ModRemoveCommentForm, ModRemoveCommunity, ModRemoveCommunityForm,
|
ModRemoveComment,
|
||||||
ModRemovePost, ModRemovePostForm,
|
ModRemoveCommentForm,
|
||||||
|
ModRemoveCommunity,
|
||||||
|
ModRemoveCommunityForm,
|
||||||
|
ModRemovePost,
|
||||||
|
ModRemovePostForm,
|
||||||
},
|
},
|
||||||
post::{Post, PostUpdateForm},
|
post::{Post, PostUpdateForm},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,11 +1,18 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
community::send_activity_in_community, send_lemmy_activity, verify_is_public,
|
community::send_activity_in_community,
|
||||||
verify_mod_action, verify_person, verify_person_in_community,
|
send_lemmy_activity,
|
||||||
|
verify_is_public,
|
||||||
|
verify_mod_action,
|
||||||
|
verify_person,
|
||||||
|
verify_person_in_community,
|
||||||
},
|
},
|
||||||
activity_lists::AnnouncableActivities,
|
activity_lists::AnnouncableActivities,
|
||||||
objects::{
|
objects::{
|
||||||
comment::ApubComment, community::ApubCommunity, person::ApubPerson, post::ApubPost,
|
comment::ApubComment,
|
||||||
|
community::ApubCommunity,
|
||||||
|
person::ApubPerson,
|
||||||
|
post::ApubPost,
|
||||||
private_message::ApubPrivateMessage,
|
private_message::ApubPrivateMessage,
|
||||||
},
|
},
|
||||||
protocol::{
|
protocol::{
|
||||||
|
|
|
@ -14,8 +14,12 @@ use lemmy_db_schema::{
|
||||||
comment::{Comment, CommentUpdateForm},
|
comment::{Comment, CommentUpdateForm},
|
||||||
community::{Community, CommunityUpdateForm},
|
community::{Community, CommunityUpdateForm},
|
||||||
moderator::{
|
moderator::{
|
||||||
ModRemoveComment, ModRemoveCommentForm, ModRemoveCommunity, ModRemoveCommunityForm,
|
ModRemoveComment,
|
||||||
ModRemovePost, ModRemovePostForm,
|
ModRemoveCommentForm,
|
||||||
|
ModRemoveCommunity,
|
||||||
|
ModRemoveCommunityForm,
|
||||||
|
ModRemovePost,
|
||||||
|
ModRemovePostForm,
|
||||||
},
|
},
|
||||||
post::{Post, PostUpdateForm},
|
post::{Post, PostUpdateForm},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
generate_activity_id, send_lemmy_activity, verify_person, verify_person_in_community,
|
generate_activity_id,
|
||||||
|
send_lemmy_activity,
|
||||||
|
verify_person,
|
||||||
|
verify_person_in_community,
|
||||||
},
|
},
|
||||||
fetcher::user_or_community::UserOrCommunity,
|
fetcher::user_or_community::UserOrCommunity,
|
||||||
insert_received_activity,
|
insert_received_activity,
|
||||||
|
|
|
@ -9,8 +9,11 @@ use crate::{
|
||||||
},
|
},
|
||||||
create_or_update::private_message::send_create_or_update_pm,
|
create_or_update::private_message::send_create_or_update_pm,
|
||||||
deletion::{
|
deletion::{
|
||||||
delete_user::delete_user, send_apub_delete_in_community, send_apub_delete_in_community_new,
|
delete_user::delete_user,
|
||||||
send_apub_delete_private_message, DeletableObjects,
|
send_apub_delete_in_community,
|
||||||
|
send_apub_delete_in_community_new,
|
||||||
|
send_apub_delete_private_message,
|
||||||
|
DeletableObjects,
|
||||||
},
|
},
|
||||||
voting::send_like_activity,
|
voting::send_like_activity,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
generate_activity_id, verify_person_in_community,
|
generate_activity_id,
|
||||||
|
verify_person_in_community,
|
||||||
voting::{undo_vote_comment, undo_vote_post},
|
voting::{undo_vote_comment, undo_vote_post},
|
||||||
},
|
},
|
||||||
insert_received_activity,
|
insert_received_activity,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{
|
activities::{
|
||||||
generate_activity_id, verify_person_in_community,
|
generate_activity_id,
|
||||||
|
verify_person_in_community,
|
||||||
voting::{vote_comment, vote_post},
|
voting::{vote_comment, vote_post},
|
||||||
},
|
},
|
||||||
insert_received_activity,
|
insert_received_activity,
|
||||||
|
|
|
@ -12,7 +12,9 @@ use crate::{
|
||||||
update::UpdateCommunity,
|
update::UpdateCommunity,
|
||||||
},
|
},
|
||||||
create_or_update::{
|
create_or_update::{
|
||||||
chat_message::CreateOrUpdateChatMessage, note::CreateOrUpdateNote, page::CreateOrUpdatePage,
|
chat_message::CreateOrUpdateChatMessage,
|
||||||
|
note::CreateOrUpdateNote,
|
||||||
|
page::CreateOrUpdatePage,
|
||||||
},
|
},
|
||||||
deletion::{delete::Delete, delete_user::DeleteUser, undo_delete::UndoDelete},
|
deletion::{delete::Delete, delete_user::DeleteUser, undo_delete::UndoDelete},
|
||||||
following::{accept::AcceptFollow, follow::Follow, undo_follow::UndoFollow},
|
following::{accept::AcceptFollow, follow::Follow, undo_follow::UndoFollow},
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
api::listing_type_with_default, fetcher::resolve_actor_identifier,
|
api::listing_type_with_default,
|
||||||
|
fetcher::resolve_actor_identifier,
|
||||||
objects::community::ApubCommunity,
|
objects::community::ApubCommunity,
|
||||||
};
|
};
|
||||||
use activitypub_federation::config::Data;
|
use activitypub_federation::config::Data;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
api::listing_type_with_default, fetcher::resolve_actor_identifier,
|
api::listing_type_with_default,
|
||||||
|
fetcher::resolve_actor_identifier,
|
||||||
objects::community::ApubCommunity,
|
objects::community::ApubCommunity,
|
||||||
};
|
};
|
||||||
use activitypub_federation::config::Data;
|
use activitypub_federation::config::Data;
|
||||||
|
|
|
@ -7,7 +7,10 @@ use lemmy_api_common::{
|
||||||
utils::{check_private_instance, is_mod_or_admin_opt},
|
utils::{check_private_instance, is_mod_or_admin_opt},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::{
|
use lemmy_db_schema::source::{
|
||||||
actor_language::CommunityLanguage, community::Community, local_site::LocalSite, site::Site,
|
actor_language::CommunityLanguage,
|
||||||
|
community::Community,
|
||||||
|
local_site::LocalSite,
|
||||||
|
site::Site,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
|
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
use crate::fetcher::search::{
|
use crate::fetcher::search::{
|
||||||
search_query_to_object_id, search_query_to_object_id_local, SearchableObjects,
|
search_query_to_object_id,
|
||||||
|
search_query_to_object_id_local,
|
||||||
|
SearchableObjects,
|
||||||
};
|
};
|
||||||
use activitypub_federation::config::Data;
|
use activitypub_federation::config::Data;
|
||||||
use actix_web::web::{Json, Query};
|
use actix_web::web::{Json, Query};
|
||||||
|
|
|
@ -3,8 +3,11 @@ use crate::{
|
||||||
protocol::collections::group_moderators::GroupModerators,
|
protocol::collections::group_moderators::GroupModerators,
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, kinds::collection::OrderedCollectionType,
|
config::Data,
|
||||||
protocol::verification::verify_domains_match, traits::Collection,
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::collection::OrderedCollectionType,
|
||||||
|
protocol::verification::verify_domains_match,
|
||||||
|
traits::Collection,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::{context::LemmyContext, utils::generate_moderators_url};
|
use lemmy_api_common::{context::LemmyContext, utils::generate_moderators_url};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
|
@ -105,7 +108,8 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
objects::{
|
objects::{
|
||||||
community::tests::parse_lemmy_community, person::tests::parse_lemmy_person,
|
community::tests::parse_lemmy_community,
|
||||||
|
person::tests::parse_lemmy_person,
|
||||||
tests::init_context,
|
tests::init_context,
|
||||||
},
|
},
|
||||||
protocol::tests::file_to_json_object,
|
protocol::tests::file_to_json_object,
|
||||||
|
|
|
@ -3,7 +3,8 @@ use crate::{
|
||||||
objects::{community::ApubCommunity, post::ApubPost},
|
objects::{community::ApubCommunity, post::ApubPost},
|
||||||
protocol::{
|
protocol::{
|
||||||
activities::{
|
activities::{
|
||||||
community::announce::AnnounceActivity, create_or_update::page::CreateOrUpdatePage,
|
community::announce::AnnounceActivity,
|
||||||
|
create_or_update::page::CreateOrUpdatePage,
|
||||||
CreateOrUpdateType,
|
CreateOrUpdateType,
|
||||||
},
|
},
|
||||||
collections::group_outbox::GroupOutbox,
|
collections::group_outbox::GroupOutbox,
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activity_lists::GroupInboxActivities,
|
activity_lists::GroupInboxActivities,
|
||||||
collections::{
|
collections::{
|
||||||
community_featured::ApubCommunityFeatured, community_moderators::ApubCommunityModerators,
|
community_featured::ApubCommunityFeatured,
|
||||||
|
community_moderators::ApubCommunityModerators,
|
||||||
community_outbox::ApubCommunityOutbox,
|
community_outbox::ApubCommunityOutbox,
|
||||||
},
|
},
|
||||||
http::{create_apub_response, create_apub_tombstone_response},
|
http::{create_apub_response, create_apub_tombstone_response},
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activity_lists::SharedInboxActivities, fetcher::user_or_community::UserOrCommunity,
|
activity_lists::SharedInboxActivities,
|
||||||
protocol::objects::tombstone::Tombstone, CONTEXT,
|
fetcher::user_or_community::UserOrCommunity,
|
||||||
|
protocol::objects::tombstone::Tombstone,
|
||||||
|
CONTEXT,
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
actix_web::inbox::receive_activity, config::Data, protocol::context::WithContext,
|
actix_web::inbox::receive_activity,
|
||||||
|
config::Data,
|
||||||
|
protocol::context::WithContext,
|
||||||
FEDERATION_CONTENT_TYPE,
|
FEDERATION_CONTENT_TYPE,
|
||||||
};
|
};
|
||||||
use actix_web::{web, web::Bytes, HttpRequest, HttpResponse};
|
use actix_web::{web, web::Bytes, HttpRequest, HttpResponse};
|
||||||
|
|
|
@ -6,7 +6,10 @@ use crate::{
|
||||||
protocol::collections::empty_outbox::EmptyOutbox,
|
protocol::collections::empty_outbox::EmptyOutbox,
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
actix_web::inbox::receive_activity, config::Data, protocol::context::WithContext, traits::Object,
|
actix_web::inbox::receive_activity,
|
||||||
|
config::Data,
|
||||||
|
protocol::context::WithContext,
|
||||||
|
traits::Object,
|
||||||
};
|
};
|
||||||
use actix_web::{web, web::Bytes, HttpRequest, HttpResponse};
|
use actix_web::{web, web::Bytes, HttpRequest, HttpResponse};
|
||||||
use lemmy_api_common::{context::LemmyContext, utils::generate_outbox_url};
|
use lemmy_api_common::{context::LemmyContext, utils::generate_outbox_url};
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
use crate::http::{
|
use crate::http::{
|
||||||
comment::get_apub_comment,
|
comment::get_apub_comment,
|
||||||
community::{
|
community::{
|
||||||
community_inbox, get_apub_community_featured, get_apub_community_followers,
|
community_inbox,
|
||||||
get_apub_community_http, get_apub_community_moderators, get_apub_community_outbox,
|
get_apub_community_featured,
|
||||||
|
get_apub_community_followers,
|
||||||
|
get_apub_community_http,
|
||||||
|
get_apub_community_moderators,
|
||||||
|
get_apub_community_outbox,
|
||||||
},
|
},
|
||||||
get_activity,
|
get_activity,
|
||||||
person::{get_apub_person_http, get_apub_person_outbox, person_inbox},
|
person::{get_apub_person_http, get_apub_person_outbox, person_inbox},
|
||||||
|
|
|
@ -5,7 +5,10 @@ use crate::{
|
||||||
protocol::collections::empty_outbox::EmptyOutbox,
|
protocol::collections::empty_outbox::EmptyOutbox,
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
actix_web::inbox::receive_activity, config::Data, protocol::context::WithContext, traits::Object,
|
actix_web::inbox::receive_activity,
|
||||||
|
config::Data,
|
||||||
|
protocol::context::WithContext,
|
||||||
|
traits::Object,
|
||||||
};
|
};
|
||||||
use actix_web::{web::Bytes, HttpRequest, HttpResponse};
|
use actix_web::{web::Bytes, HttpRequest, HttpResponse};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
|
|
|
@ -5,7 +5,8 @@ use crate::{
|
||||||
objects::{read_from_string_or_source, verify_is_remote_object},
|
objects::{read_from_string_or_source, verify_is_remote_object},
|
||||||
protocol::{
|
protocol::{
|
||||||
objects::{note::Note, LanguageTag},
|
objects::{note::Note, LanguageTag},
|
||||||
InCommunity, Source,
|
InCommunity,
|
||||||
|
Source,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::GetActorType,
|
activities::GetActorType,
|
||||||
check_apub_id_valid, local_site_data_cached,
|
check_apub_id_valid,
|
||||||
|
local_site_data_cached,
|
||||||
objects::instance::fetch_instance_actor_for_object,
|
objects::instance::fetch_instance_actor_for_object,
|
||||||
protocol::{
|
protocol::{
|
||||||
objects::{group::Group, Endpoints, LanguageTag},
|
objects::{group::Group, Endpoints, LanguageTag},
|
||||||
ImageObject, Source,
|
ImageObject,
|
||||||
|
Source,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::GetActorType,
|
activities::GetActorType,
|
||||||
check_apub_id_valid_with_strictness, local_site_data_cached,
|
check_apub_id_valid_with_strictness,
|
||||||
|
local_site_data_cached,
|
||||||
objects::read_from_string_or_source_opt,
|
objects::read_from_string_or_source_opt,
|
||||||
protocol::{
|
protocol::{
|
||||||
objects::{instance::Instance, LanguageTag},
|
objects::{instance::Instance, LanguageTag},
|
||||||
ImageObject, Source,
|
ImageObject,
|
||||||
|
Source,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::GetActorType,
|
activities::GetActorType,
|
||||||
check_apub_id_valid_with_strictness, local_site_data_cached,
|
check_apub_id_valid_with_strictness,
|
||||||
|
local_site_data_cached,
|
||||||
objects::{instance::fetch_instance_actor_for_object, read_from_string_or_source_opt},
|
objects::{instance::fetch_instance_actor_for_object, read_from_string_or_source_opt},
|
||||||
protocol::{
|
protocol::{
|
||||||
objects::{
|
objects::{
|
||||||
person::{Person, UserTypes},
|
person::{Person, UserTypes},
|
||||||
Endpoints,
|
Endpoints,
|
||||||
},
|
},
|
||||||
ImageObject, Source,
|
ImageObject,
|
||||||
|
Source,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
|
@ -19,7 +21,9 @@ use chrono::{DateTime, Utc};
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{
|
utils::{
|
||||||
generate_outbox_url, local_site_opt_to_slur_regex, sanitize_html_federation,
|
generate_outbox_url,
|
||||||
|
local_site_opt_to_slur_regex,
|
||||||
|
sanitize_html_federation,
|
||||||
sanitize_html_federation_opt,
|
sanitize_html_federation_opt,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
activities::{verify_is_public, verify_person_in_community},
|
activities::{verify_is_public, verify_person_in_community},
|
||||||
check_apub_id_valid_with_strictness, local_site_data_cached,
|
check_apub_id_valid_with_strictness,
|
||||||
|
local_site_data_cached,
|
||||||
objects::{read_from_string_or_source_opt, verify_is_remote_object},
|
objects::{read_from_string_or_source_opt, verify_is_remote_object},
|
||||||
protocol::{
|
protocol::{
|
||||||
objects::{
|
objects::{
|
||||||
page::{Attachment, AttributedTo, Page, PageType},
|
page::{Attachment, AttributedTo, Page, PageType},
|
||||||
LanguageTag,
|
LanguageTag,
|
||||||
},
|
},
|
||||||
ImageObject, InCommunity, Source,
|
ImageObject,
|
||||||
|
InCommunity,
|
||||||
|
Source,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
|
@ -23,8 +26,11 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
request::fetch_site_data,
|
request::fetch_site_data,
|
||||||
utils::{
|
utils::{
|
||||||
is_mod_or_admin, local_site_opt_to_sensitive, local_site_opt_to_slur_regex,
|
is_mod_or_admin,
|
||||||
sanitize_html_federation, sanitize_html_federation_opt,
|
local_site_opt_to_sensitive,
|
||||||
|
local_site_opt_to_slur_regex,
|
||||||
|
sanitize_html_federation,
|
||||||
|
sanitize_html_federation_opt,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
|
@ -294,7 +300,9 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
objects::{
|
objects::{
|
||||||
community::tests::parse_lemmy_community, person::tests::parse_lemmy_person, post::ApubPost,
|
community::tests::parse_lemmy_community,
|
||||||
|
person::tests::parse_lemmy_person,
|
||||||
|
post::ApubPost,
|
||||||
tests::init_context,
|
tests::init_context,
|
||||||
},
|
},
|
||||||
protocol::tests::file_to_json_object,
|
protocol::tests::file_to_json_object,
|
||||||
|
|
|
@ -4,7 +4,9 @@ use crate::{
|
||||||
protocol::InCommunity,
|
protocol::InCommunity,
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, kinds::activity::BlockType,
|
config::Data,
|
||||||
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::BlockType,
|
||||||
protocol::helpers::deserialize_one_or_many,
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
|
|
|
@ -4,7 +4,9 @@ use crate::{
|
||||||
protocol::{activities::block::block_user::BlockUser, InCommunity},
|
protocol::{activities::block::block_user::BlockUser, InCommunity},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, kinds::activity::UndoType,
|
config::Data,
|
||||||
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::UndoType,
|
||||||
protocol::helpers::deserialize_one_or_many,
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use crate::{objects::community::ApubCommunity, protocol::IdOrNestedObject};
|
use crate::{objects::community::ApubCommunity, protocol::IdOrNestedObject};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
fetch::object_id::ObjectId, kinds::activity::AnnounceType,
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::AnnounceType,
|
||||||
protocol::helpers::deserialize_one_or_many,
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
|
@ -4,7 +4,9 @@ use crate::{
|
||||||
protocol::InCommunity,
|
protocol::InCommunity,
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, kinds::activity::AddType,
|
config::Data,
|
||||||
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::AddType,
|
||||||
protocol::helpers::deserialize_one_or_many,
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
|
|
|
@ -4,7 +4,9 @@ use crate::{
|
||||||
protocol::InCommunity,
|
protocol::InCommunity,
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, kinds::activity::RemoveType,
|
config::Data,
|
||||||
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::RemoveType,
|
||||||
protocol::helpers::deserialize_one_or_many,
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
|
|
|
@ -4,7 +4,9 @@ use crate::{
|
||||||
protocol::InCommunity,
|
protocol::InCommunity,
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, kinds::activity::UndoType,
|
config::Data,
|
||||||
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::UndoType,
|
||||||
protocol::helpers::deserialize_one_or_many,
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
|
|
|
@ -5,7 +5,9 @@ use crate::{
|
||||||
protocol::InCommunity,
|
protocol::InCommunity,
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, kinds::activity::FlagType,
|
config::Data,
|
||||||
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::FlagType,
|
||||||
protocol::helpers::deserialize_one,
|
protocol::helpers::deserialize_one,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
|
|
|
@ -4,7 +4,9 @@ use crate::{
|
||||||
protocol::{objects::group::Group, InCommunity},
|
protocol::{objects::group::Group, InCommunity},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, kinds::activity::UpdateType,
|
config::Data,
|
||||||
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::UpdateType,
|
||||||
protocol::helpers::deserialize_one_or_many,
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
|
|
|
@ -9,7 +9,9 @@ mod tests {
|
||||||
|
|
||||||
use crate::protocol::{
|
use crate::protocol::{
|
||||||
activities::create_or_update::{
|
activities::create_or_update::{
|
||||||
chat_message::CreateOrUpdateChatMessage, note::CreateOrUpdateNote, page::CreateOrUpdatePage,
|
chat_message::CreateOrUpdateChatMessage,
|
||||||
|
note::CreateOrUpdateNote,
|
||||||
|
page::CreateOrUpdatePage,
|
||||||
},
|
},
|
||||||
tests::test_parse_lemmy_item,
|
tests::test_parse_lemmy_item,
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,9 @@ use crate::{
|
||||||
protocol::{activities::CreateOrUpdateType, objects::note::Note, InCommunity},
|
protocol::{activities::CreateOrUpdateType, objects::note::Note, InCommunity},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, protocol::helpers::deserialize_one_or_many,
|
config::Data,
|
||||||
|
fetch::object_id::ObjectId,
|
||||||
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
use lemmy_db_schema::{source::community::Community, traits::Crud};
|
use lemmy_db_schema::{source::community::Community, traits::Crud};
|
||||||
|
|
|
@ -4,7 +4,9 @@ use crate::{
|
||||||
protocol::{activities::CreateOrUpdateType, objects::page::Page, InCommunity},
|
protocol::{activities::CreateOrUpdateType, objects::page::Page, InCommunity},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, protocol::helpers::deserialize_one_or_many,
|
config::Data,
|
||||||
|
fetch::object_id::ObjectId,
|
||||||
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
|
@ -4,7 +4,9 @@ use crate::{
|
||||||
protocol::{objects::tombstone::Tombstone, IdOrNestedObject, InCommunity},
|
protocol::{objects::tombstone::Tombstone, IdOrNestedObject, InCommunity},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, kinds::activity::DeleteType,
|
config::Data,
|
||||||
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::DeleteType,
|
||||||
protocol::helpers::deserialize_one_or_many,
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use crate::objects::person::ApubPerson;
|
use crate::objects::person::ApubPerson;
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
fetch::object_id::ObjectId, kinds::activity::DeleteType,
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::DeleteType,
|
||||||
protocol::helpers::deserialize_one_or_many,
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
|
@ -4,7 +4,9 @@ use crate::{
|
||||||
protocol::{activities::deletion::delete::Delete, InCommunity},
|
protocol::{activities::deletion::delete::Delete, InCommunity},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::object_id::ObjectId, kinds::activity::UndoType,
|
config::Data,
|
||||||
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::UndoType,
|
||||||
protocol::helpers::deserialize_one_or_many,
|
protocol::helpers::deserialize_one_or_many,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
|
|
|
@ -3,7 +3,8 @@ use crate::{
|
||||||
protocol::activities::following::follow::Follow,
|
protocol::activities::following::follow::Follow,
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
fetch::object_id::ObjectId, kinds::activity::AcceptType,
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::AcceptType,
|
||||||
protocol::helpers::deserialize_skip_error,
|
protocol::helpers::deserialize_skip_error,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use crate::{fetcher::user_or_community::UserOrCommunity, objects::person::ApubPerson};
|
use crate::{fetcher::user_or_community::UserOrCommunity, objects::person::ApubPerson};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
fetch::object_id::ObjectId, kinds::activity::FollowType,
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::FollowType,
|
||||||
protocol::helpers::deserialize_skip_error,
|
protocol::helpers::deserialize_skip_error,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
use crate::{objects::person::ApubPerson, protocol::activities::following::follow::Follow};
|
use crate::{objects::person::ApubPerson, protocol::activities::following::follow::Follow};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
fetch::object_id::ObjectId, kinds::activity::UndoType, protocol::helpers::deserialize_skip_error,
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::activity::UndoType,
|
||||||
|
protocol::helpers::deserialize_skip_error,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use crate::objects::person::ApubPerson;
|
use crate::objects::person::ApubPerson;
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
fetch::object_id::ObjectId, kinds::collection::OrderedCollectionType,
|
fetch::object_id::ObjectId,
|
||||||
|
kinds::collection::OrderedCollectionType,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
|
@ -11,8 +11,11 @@ mod tests {
|
||||||
|
|
||||||
use crate::protocol::{
|
use crate::protocol::{
|
||||||
collections::{
|
collections::{
|
||||||
empty_outbox::EmptyOutbox, group_featured::GroupFeatured, group_followers::GroupFollowers,
|
empty_outbox::EmptyOutbox,
|
||||||
group_moderators::GroupModerators, group_outbox::GroupOutbox,
|
group_featured::GroupFeatured,
|
||||||
|
group_followers::GroupFollowers,
|
||||||
|
group_moderators::GroupModerators,
|
||||||
|
group_outbox::GroupOutbox,
|
||||||
},
|
},
|
||||||
tests::{test_json, test_parse_lemmy_item},
|
tests::{test_json, test_parse_lemmy_item},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
use crate::objects::community::ApubCommunity;
|
use crate::objects::community::ApubCommunity;
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data, fetch::fetch_object_http, kinds::object::ImageType,
|
config::Data,
|
||||||
|
fetch::fetch_object_http,
|
||||||
|
kinds::object::ImageType,
|
||||||
protocol::values::MediaTypeMarkdown,
|
protocol::values::MediaTypeMarkdown,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
|
|
|
@ -1,21 +1,25 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
check_apub_id_valid_with_strictness,
|
check_apub_id_valid_with_strictness,
|
||||||
collections::{
|
collections::{
|
||||||
community_featured::ApubCommunityFeatured, community_moderators::ApubCommunityModerators,
|
community_featured::ApubCommunityFeatured,
|
||||||
|
community_moderators::ApubCommunityModerators,
|
||||||
community_outbox::ApubCommunityOutbox,
|
community_outbox::ApubCommunityOutbox,
|
||||||
},
|
},
|
||||||
local_site_data_cached,
|
local_site_data_cached,
|
||||||
objects::{community::ApubCommunity, read_from_string_or_source_opt},
|
objects::{community::ApubCommunity, read_from_string_or_source_opt},
|
||||||
protocol::{
|
protocol::{
|
||||||
objects::{Endpoints, LanguageTag},
|
objects::{Endpoints, LanguageTag},
|
||||||
ImageObject, Source,
|
ImageObject,
|
||||||
|
Source,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
fetch::{collection_id::CollectionId, object_id::ObjectId},
|
fetch::{collection_id::CollectionId, object_id::ObjectId},
|
||||||
kinds::actor::GroupType,
|
kinds::actor::GroupType,
|
||||||
protocol::{
|
protocol::{
|
||||||
helpers::deserialize_skip_error, public_key::PublicKey, verification::verify_domains_match,
|
helpers::deserialize_skip_error,
|
||||||
|
public_key::PublicKey,
|
||||||
|
verification::verify_domains_match,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
impls::actor_language::UNDETERMINED_ID, newtypes::LanguageId, source::language::Language,
|
impls::actor_language::UNDETERMINED_ID,
|
||||||
|
newtypes::LanguageId,
|
||||||
|
source::language::Language,
|
||||||
utils::DbPool,
|
utils::DbPool,
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
@ -98,8 +100,13 @@ mod tests {
|
||||||
|
|
||||||
use crate::protocol::{
|
use crate::protocol::{
|
||||||
objects::{
|
objects::{
|
||||||
chat_message::ChatMessage, group::Group, instance::Instance, note::Note, page::Page,
|
chat_message::ChatMessage,
|
||||||
person::Person, tombstone::Tombstone,
|
group::Group,
|
||||||
|
instance::Instance,
|
||||||
|
note::Note,
|
||||||
|
page::Page,
|
||||||
|
person::Person,
|
||||||
|
tombstone::Tombstone,
|
||||||
},
|
},
|
||||||
tests::{test_json, test_parse_lemmy_item},
|
tests::{test_json, test_parse_lemmy_item},
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,8 @@ use crate::{
|
||||||
schema::{community_aggregates, post, post_aggregates},
|
schema::{community_aggregates, post, post_aggregates},
|
||||||
utils::{
|
utils::{
|
||||||
functions::{hot_rank, scaled_rank},
|
functions::{hot_rank, scaled_rank},
|
||||||
get_conn, DbPool,
|
get_conn,
|
||||||
|
DbPool,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use diesel::{result::Error, ExpressionMethods, JoinOnDsl, QueryDsl};
|
use diesel::{result::Error, ExpressionMethods, JoinOnDsl, QueryDsl};
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
use crate::newtypes::{CommentId, CommunityId, InstanceId, PersonId, PostId, SiteId};
|
use crate::newtypes::{CommentId, CommunityId, InstanceId, PersonId, PostId, SiteId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::{
|
use crate::schema::{
|
||||||
comment_aggregates, community_aggregates, person_aggregates, person_post_aggregates,
|
comment_aggregates,
|
||||||
post_aggregates, site_aggregates,
|
community_aggregates,
|
||||||
|
person_aggregates,
|
||||||
|
person_post_aggregates,
|
||||||
|
post_aggregates,
|
||||||
|
site_aggregates,
|
||||||
};
|
};
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
|
@ -7,7 +7,8 @@ use crate::{
|
||||||
use diesel::{
|
use diesel::{
|
||||||
dsl::insert_into,
|
dsl::insert_into,
|
||||||
result::{DatabaseErrorKind, Error, Error::DatabaseError},
|
result::{DatabaseErrorKind, Error, Error::DatabaseError},
|
||||||
ExpressionMethods, QueryDsl,
|
ExpressionMethods,
|
||||||
|
QueryDsl,
|
||||||
};
|
};
|
||||||
use diesel_async::RunQueryDsl;
|
use diesel_async::RunQueryDsl;
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,12 @@ use crate::{
|
||||||
schema::{local_site, site, site_language},
|
schema::{local_site, site, site_language},
|
||||||
source::{
|
source::{
|
||||||
actor_language::{
|
actor_language::{
|
||||||
CommunityLanguage, CommunityLanguageForm, LocalUserLanguage, LocalUserLanguageForm,
|
CommunityLanguage,
|
||||||
SiteLanguage, SiteLanguageForm,
|
CommunityLanguageForm,
|
||||||
|
LocalUserLanguage,
|
||||||
|
LocalUserLanguageForm,
|
||||||
|
SiteLanguage,
|
||||||
|
SiteLanguageForm,
|
||||||
},
|
},
|
||||||
language::Language,
|
language::Language,
|
||||||
site::Site,
|
site::Site,
|
||||||
|
@ -17,7 +21,9 @@ use diesel::{
|
||||||
dsl::{count, exists},
|
dsl::{count, exists},
|
||||||
insert_into,
|
insert_into,
|
||||||
result::Error,
|
result::Error,
|
||||||
select, ExpressionMethods, QueryDsl,
|
select,
|
||||||
|
ExpressionMethods,
|
||||||
|
QueryDsl,
|
||||||
};
|
};
|
||||||
use diesel_async::{AsyncPgConnection, RunQueryDsl};
|
use diesel_async::{AsyncPgConnection, RunQueryDsl};
|
||||||
use lemmy_utils::error::{LemmyError, LemmyErrorType};
|
use lemmy_utils::error::{LemmyError, LemmyErrorType};
|
||||||
|
@ -31,7 +37,9 @@ impl LocalUserLanguage {
|
||||||
for_local_user_id: LocalUserId,
|
for_local_user_id: LocalUserId,
|
||||||
) -> Result<Vec<LanguageId>, Error> {
|
) -> Result<Vec<LanguageId>, Error> {
|
||||||
use crate::schema::local_user_language::dsl::{
|
use crate::schema::local_user_language::dsl::{
|
||||||
language_id, local_user_id, local_user_language,
|
language_id,
|
||||||
|
local_user_id,
|
||||||
|
local_user_language,
|
||||||
};
|
};
|
||||||
let conn = &mut get_conn(pool).await?;
|
let conn = &mut get_conn(pool).await?;
|
||||||
|
|
||||||
|
@ -214,7 +222,9 @@ impl CommunityLanguage {
|
||||||
for_instance_id: InstanceId,
|
for_instance_id: InstanceId,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
use crate::schema::{
|
use crate::schema::{
|
||||||
community::dsl as c, community_language::dsl as cl, site_language::dsl as sl,
|
community::dsl as c,
|
||||||
|
community_language::dsl as cl,
|
||||||
|
site_language::dsl as sl,
|
||||||
};
|
};
|
||||||
let community_languages: Vec<LanguageId> = cl::community_language
|
let community_languages: Vec<LanguageId> = cl::community_language
|
||||||
.left_outer_join(sl::site_language.on(cl::language_id.eq(sl::language_id)))
|
.left_outer_join(sl::site_language.on(cl::language_id.eq(sl::language_id)))
|
||||||
|
@ -380,8 +390,17 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
impls::actor_language::{
|
impls::actor_language::{
|
||||||
convert_read_languages, convert_update_languages, default_post_language, get_conn,
|
convert_read_languages,
|
||||||
CommunityLanguage, DbPool, Language, LanguageId, LocalUserLanguage, QueryDsl, RunQueryDsl,
|
convert_update_languages,
|
||||||
|
default_post_language,
|
||||||
|
get_conn,
|
||||||
|
CommunityLanguage,
|
||||||
|
DbPool,
|
||||||
|
Language,
|
||||||
|
LanguageId,
|
||||||
|
LocalUserLanguage,
|
||||||
|
QueryDsl,
|
||||||
|
RunQueryDsl,
|
||||||
SiteLanguage,
|
SiteLanguage,
|
||||||
},
|
},
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,13 @@ use crate::{
|
||||||
utils::{functions::lower, get_conn, DbPool},
|
utils::{functions::lower, get_conn, DbPool},
|
||||||
};
|
};
|
||||||
use diesel::{
|
use diesel::{
|
||||||
delete, dsl::exists, insert_into, result::Error, select, ExpressionMethods, QueryDsl,
|
delete,
|
||||||
|
dsl::exists,
|
||||||
|
insert_into,
|
||||||
|
result::Error,
|
||||||
|
select,
|
||||||
|
ExpressionMethods,
|
||||||
|
QueryDsl,
|
||||||
};
|
};
|
||||||
use diesel_async::RunQueryDsl;
|
use diesel_async::RunQueryDsl;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,12 @@ use crate::{
|
||||||
newtypes::{CommentId, DbUrl, PersonId},
|
newtypes::{CommentId, DbUrl, PersonId},
|
||||||
schema::comment::dsl::{ap_id, comment, content, creator_id, deleted, path, removed, updated},
|
schema::comment::dsl::{ap_id, comment, content, creator_id, deleted, path, removed, updated},
|
||||||
source::comment::{
|
source::comment::{
|
||||||
Comment, CommentInsertForm, CommentLike, CommentLikeForm, CommentSaved, CommentSavedForm,
|
Comment,
|
||||||
|
CommentInsertForm,
|
||||||
|
CommentLike,
|
||||||
|
CommentLikeForm,
|
||||||
|
CommentSaved,
|
||||||
|
CommentSavedForm,
|
||||||
CommentUpdateForm,
|
CommentUpdateForm,
|
||||||
},
|
},
|
||||||
traits::{Crud, Likeable, Saveable},
|
traits::{Crud, Likeable, Saveable},
|
||||||
|
@ -11,7 +16,8 @@ use crate::{
|
||||||
use diesel::{
|
use diesel::{
|
||||||
dsl::{insert_into, sql_query},
|
dsl::{insert_into, sql_query},
|
||||||
result::Error,
|
result::Error,
|
||||||
ExpressionMethods, QueryDsl,
|
ExpressionMethods,
|
||||||
|
QueryDsl,
|
||||||
};
|
};
|
||||||
use diesel_async::RunQueryDsl;
|
use diesel_async::RunQueryDsl;
|
||||||
use diesel_ltree::Ltree;
|
use diesel_ltree::Ltree;
|
||||||
|
@ -243,7 +249,12 @@ mod tests {
|
||||||
newtypes::LanguageId,
|
newtypes::LanguageId,
|
||||||
source::{
|
source::{
|
||||||
comment::{
|
comment::{
|
||||||
Comment, CommentInsertForm, CommentLike, CommentLikeForm, CommentSaved, CommentSavedForm,
|
Comment,
|
||||||
|
CommentInsertForm,
|
||||||
|
CommentLike,
|
||||||
|
CommentLikeForm,
|
||||||
|
CommentSaved,
|
||||||
|
CommentSavedForm,
|
||||||
CommentUpdateForm,
|
CommentUpdateForm,
|
||||||
},
|
},
|
||||||
community::{Community, CommunityInsertForm},
|
community::{Community, CommunityInsertForm},
|
||||||
|
|
|
@ -8,7 +8,8 @@ use crate::{
|
||||||
use diesel::{
|
use diesel::{
|
||||||
dsl::{insert_into, update},
|
dsl::{insert_into, update},
|
||||||
result::Error,
|
result::Error,
|
||||||
ExpressionMethods, QueryDsl,
|
ExpressionMethods,
|
||||||
|
QueryDsl,
|
||||||
};
|
};
|
||||||
use diesel_async::RunQueryDsl;
|
use diesel_async::RunQueryDsl;
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,15 @@ use crate::{
|
||||||
source::{
|
source::{
|
||||||
actor_language::CommunityLanguage,
|
actor_language::CommunityLanguage,
|
||||||
community::{
|
community::{
|
||||||
Community, CommunityFollower, CommunityFollowerForm, CommunityInsertForm, CommunityModerator,
|
Community,
|
||||||
CommunityModeratorForm, CommunityPersonBan, CommunityPersonBanForm, CommunityUpdateForm,
|
CommunityFollower,
|
||||||
|
CommunityFollowerForm,
|
||||||
|
CommunityInsertForm,
|
||||||
|
CommunityModerator,
|
||||||
|
CommunityModeratorForm,
|
||||||
|
CommunityPersonBan,
|
||||||
|
CommunityPersonBanForm,
|
||||||
|
CommunityUpdateForm,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
traits::{ApubActor, Bannable, Crud, Followable, Joinable},
|
traits::{ApubActor, Bannable, Crud, Followable, Joinable},
|
||||||
|
@ -13,8 +20,16 @@ use crate::{
|
||||||
SubscribedType,
|
SubscribedType,
|
||||||
};
|
};
|
||||||
use diesel::{
|
use diesel::{
|
||||||
deserialize, dsl, dsl::insert_into, pg::Pg, result::Error, sql_types, ExpressionMethods,
|
deserialize,
|
||||||
NullableExpressionMethods, QueryDsl, Queryable,
|
dsl,
|
||||||
|
dsl::insert_into,
|
||||||
|
pg::Pg,
|
||||||
|
result::Error,
|
||||||
|
sql_types,
|
||||||
|
ExpressionMethods,
|
||||||
|
NullableExpressionMethods,
|
||||||
|
QueryDsl,
|
||||||
|
Queryable,
|
||||||
};
|
};
|
||||||
use diesel_async::RunQueryDsl;
|
use diesel_async::RunQueryDsl;
|
||||||
|
|
||||||
|
@ -247,7 +262,10 @@ impl Followable for CommunityFollower {
|
||||||
person_id_: PersonId,
|
person_id_: PersonId,
|
||||||
) -> Result<Self, Error> {
|
) -> Result<Self, Error> {
|
||||||
use crate::schema::community_follower::dsl::{
|
use crate::schema::community_follower::dsl::{
|
||||||
community_follower, community_id, pending, person_id,
|
community_follower,
|
||||||
|
community_id,
|
||||||
|
pending,
|
||||||
|
person_id,
|
||||||
};
|
};
|
||||||
let conn = &mut get_conn(pool).await?;
|
let conn = &mut get_conn(pool).await?;
|
||||||
diesel::update(
|
diesel::update(
|
||||||
|
@ -331,8 +349,14 @@ mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
source::{
|
source::{
|
||||||
community::{
|
community::{
|
||||||
Community, CommunityFollower, CommunityFollowerForm, CommunityInsertForm,
|
Community,
|
||||||
CommunityModerator, CommunityModeratorForm, CommunityPersonBan, CommunityPersonBanForm,
|
CommunityFollower,
|
||||||
|
CommunityFollowerForm,
|
||||||
|
CommunityInsertForm,
|
||||||
|
CommunityModerator,
|
||||||
|
CommunityModeratorForm,
|
||||||
|
CommunityPersonBan,
|
||||||
|
CommunityPersonBanForm,
|
||||||
CommunityUpdateForm,
|
CommunityUpdateForm,
|
||||||
},
|
},
|
||||||
instance::Instance,
|
instance::Instance,
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
newtypes::LocalUserId,
|
newtypes::LocalUserId,
|
||||||
schema::email_verification::dsl::{
|
schema::email_verification::dsl::{
|
||||||
email_verification, local_user_id, published, verification_token,
|
email_verification,
|
||||||
|
local_user_id,
|
||||||
|
published,
|
||||||
|
verification_token,
|
||||||
},
|
},
|
||||||
source::email_verification::{EmailVerification, EmailVerificationForm},
|
source::email_verification::{EmailVerification, EmailVerificationForm},
|
||||||
utils::{get_conn, DbPool},
|
utils::{get_conn, DbPool},
|
||||||
|
@ -11,7 +14,9 @@ use diesel::{
|
||||||
insert_into,
|
insert_into,
|
||||||
result::Error,
|
result::Error,
|
||||||
sql_types::Timestamptz,
|
sql_types::Timestamptz,
|
||||||
ExpressionMethods, IntoSql, QueryDsl,
|
ExpressionMethods,
|
||||||
|
IntoSql,
|
||||||
|
QueryDsl,
|
||||||
};
|
};
|
||||||
use diesel_async::RunQueryDsl;
|
use diesel_async::RunQueryDsl;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,10 @@ use diesel::{
|
||||||
dsl::{count_star, insert_into},
|
dsl::{count_star, insert_into},
|
||||||
result::Error,
|
result::Error,
|
||||||
sql_types::{Nullable, Timestamptz},
|
sql_types::{Nullable, Timestamptz},
|
||||||
ExpressionMethods, NullableExpressionMethods, QueryDsl, SelectableHelper,
|
ExpressionMethods,
|
||||||
|
NullableExpressionMethods,
|
||||||
|
QueryDsl,
|
||||||
|
SelectableHelper,
|
||||||
};
|
};
|
||||||
use diesel_async::RunQueryDsl;
|
use diesel_async::RunQueryDsl;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
schema::local_site_rate_limit,
|
schema::local_site_rate_limit,
|
||||||
source::local_site_rate_limit::{
|
source::local_site_rate_limit::{
|
||||||
LocalSiteRateLimit, LocalSiteRateLimitInsertForm, LocalSiteRateLimitUpdateForm,
|
LocalSiteRateLimit,
|
||||||
|
LocalSiteRateLimitInsertForm,
|
||||||
|
LocalSiteRateLimitUpdateForm,
|
||||||
},
|
},
|
||||||
utils::{get_conn, DbPool},
|
utils::{get_conn, DbPool},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
newtypes::LocalUserId,
|
newtypes::LocalUserId,
|
||||||
schema::local_user::dsl::{
|
schema::local_user::dsl::{
|
||||||
accepted_application, email, email_verified, local_user, password_encrypted, validator_time,
|
accepted_application,
|
||||||
|
email,
|
||||||
|
email_verified,
|
||||||
|
local_user,
|
||||||
|
password_encrypted,
|
||||||
|
validator_time,
|
||||||
},
|
},
|
||||||
source::{
|
source::{
|
||||||
actor_language::{LocalUserLanguage, SiteLanguage},
|
actor_language::{LocalUserLanguage, SiteLanguage},
|
||||||
|
|
|
@ -1,12 +1,35 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
source::moderator::{
|
source::moderator::{
|
||||||
AdminPurgeComment, AdminPurgeCommentForm, AdminPurgeCommunity, AdminPurgeCommunityForm,
|
AdminPurgeComment,
|
||||||
AdminPurgePerson, AdminPurgePersonForm, AdminPurgePost, AdminPurgePostForm, ModAdd,
|
AdminPurgeCommentForm,
|
||||||
ModAddCommunity, ModAddCommunityForm, ModAddForm, ModBan, ModBanForm, ModBanFromCommunity,
|
AdminPurgeCommunity,
|
||||||
ModBanFromCommunityForm, ModFeaturePost, ModFeaturePostForm, ModHideCommunity,
|
AdminPurgeCommunityForm,
|
||||||
ModHideCommunityForm, ModLockPost, ModLockPostForm, ModRemoveComment, ModRemoveCommentForm,
|
AdminPurgePerson,
|
||||||
ModRemoveCommunity, ModRemoveCommunityForm, ModRemovePost, ModRemovePostForm,
|
AdminPurgePersonForm,
|
||||||
ModTransferCommunity, ModTransferCommunityForm,
|
AdminPurgePost,
|
||||||
|
AdminPurgePostForm,
|
||||||
|
ModAdd,
|
||||||
|
ModAddCommunity,
|
||||||
|
ModAddCommunityForm,
|
||||||
|
ModAddForm,
|
||||||
|
ModBan,
|
||||||
|
ModBanForm,
|
||||||
|
ModBanFromCommunity,
|
||||||
|
ModBanFromCommunityForm,
|
||||||
|
ModFeaturePost,
|
||||||
|
ModFeaturePostForm,
|
||||||
|
ModHideCommunity,
|
||||||
|
ModHideCommunityForm,
|
||||||
|
ModLockPost,
|
||||||
|
ModLockPostForm,
|
||||||
|
ModRemoveComment,
|
||||||
|
ModRemoveCommentForm,
|
||||||
|
ModRemoveCommunity,
|
||||||
|
ModRemoveCommunityForm,
|
||||||
|
ModRemovePost,
|
||||||
|
ModRemovePostForm,
|
||||||
|
ModTransferCommunity,
|
||||||
|
ModTransferCommunityForm,
|
||||||
},
|
},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
utils::{get_conn, DbPool},
|
utils::{get_conn, DbPool},
|
||||||
|
@ -452,10 +475,24 @@ mod tests {
|
||||||
community::{Community, CommunityInsertForm},
|
community::{Community, CommunityInsertForm},
|
||||||
instance::Instance,
|
instance::Instance,
|
||||||
moderator::{
|
moderator::{
|
||||||
ModAdd, ModAddCommunity, ModAddCommunityForm, ModAddForm, ModBan, ModBanForm,
|
ModAdd,
|
||||||
ModBanFromCommunity, ModBanFromCommunityForm, ModFeaturePost, ModFeaturePostForm,
|
ModAddCommunity,
|
||||||
ModLockPost, ModLockPostForm, ModRemoveComment, ModRemoveCommentForm, ModRemoveCommunity,
|
ModAddCommunityForm,
|
||||||
ModRemoveCommunityForm, ModRemovePost, ModRemovePostForm,
|
ModAddForm,
|
||||||
|
ModBan,
|
||||||
|
ModBanForm,
|
||||||
|
ModBanFromCommunity,
|
||||||
|
ModBanFromCommunityForm,
|
||||||
|
ModFeaturePost,
|
||||||
|
ModFeaturePostForm,
|
||||||
|
ModLockPost,
|
||||||
|
ModLockPostForm,
|
||||||
|
ModRemoveComment,
|
||||||
|
ModRemoveCommentForm,
|
||||||
|
ModRemoveCommunity,
|
||||||
|
ModRemoveCommunityForm,
|
||||||
|
ModRemovePost,
|
||||||
|
ModRemovePostForm,
|
||||||
},
|
},
|
||||||
person::{Person, PersonInsertForm},
|
person::{Person, PersonInsertForm},
|
||||||
post::{Post, PostInsertForm},
|
post::{Post, PostInsertForm},
|
||||||
|
|
|
@ -9,7 +9,9 @@ use diesel::{
|
||||||
dsl::{insert_into, now, IntervalDsl},
|
dsl::{insert_into, now, IntervalDsl},
|
||||||
result::Error,
|
result::Error,
|
||||||
sql_types::Timestamptz,
|
sql_types::Timestamptz,
|
||||||
ExpressionMethods, IntoSql, QueryDsl,
|
ExpressionMethods,
|
||||||
|
IntoSql,
|
||||||
|
QueryDsl,
|
||||||
};
|
};
|
||||||
use diesel_async::RunQueryDsl;
|
use diesel_async::RunQueryDsl;
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue