edition="2021"
imports_layout="HorizontalVertical"
imports_granularity="Crate"
-reorder_imports=true
+group_imports="One"
\ No newline at end of file
+use crate::PerformCrud;
use actix_web::web::Data;
use lemmy_api_common::{
comment::{CommentResponse, EditComment},
UserOperationCrud,
};
-use crate::PerformCrud;
-
#[async_trait::async_trait(?Send)]
impl PerformCrud for EditComment {
type Response = CommentResponse;
+use crate::{
+ activities::{
+ block::{generate_cc, SiteOrCommunity},
+ community::{announce::GetCommunity, send_activity_in_community},
+ generate_activity_id,
+ send_lemmy_activity,
+ verify_is_public,
+ },
+ activity_lists::AnnouncableActivities,
+ local_instance,
+ objects::{community::ApubCommunity, instance::remote_instance_inboxes, person::ApubPerson},
+ protocol::activities::block::{block_user::BlockUser, undo_block_user::UndoBlockUser},
+ ActorType,
+};
use activitypub_federation::{
core::object_id::ObjectId,
data::Data,
use lemmy_websocket::LemmyContext;
use url::Url;
-use crate::{
- activities::{
- block::{generate_cc, SiteOrCommunity},
- community::{announce::GetCommunity, send_activity_in_community},
- generate_activity_id,
- send_lemmy_activity,
- verify_is_public,
- },
- activity_lists::AnnouncableActivities,
- local_instance,
- objects::{community::ApubCommunity, instance::remote_instance_inboxes, person::ApubPerson},
- protocol::activities::block::{block_user::BlockUser, undo_block_user::UndoBlockUser},
- ActorType,
-};
-
impl UndoBlockUser {
#[tracing::instrument(skip_all)]
pub async fn send(
+use crate::{
+ objects::{comment::ApubComment, person::ApubPerson, post::ApubPost},
+ protocol::activities::voting::vote::VoteType,
+};
use lemmy_api_common::utils::blocking;
use lemmy_db_schema::{
source::{
UserOperation,
};
-use crate::{
- objects::{comment::ApubComment, person::ApubPerson, post::ApubPost},
- protocol::activities::voting::vote::VoteType,
-};
-
pub mod undo_vote;
pub mod vote;
-use lemmy_websocket::LemmyContext;
-
use crate::objects::community::ApubCommunity;
+use lemmy_websocket::LemmyContext;
pub(crate) mod community_moderators;
pub(crate) mod community_outbox;
use crate::newtypes::{CommentId, CommunityId, PersonId, PostId};
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::{
comment_aggregates,
post_aggregates,
site_aggregates,
};
+use serde::{Deserialize, Serialize};
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
SiteId,
SiteLanguageId,
};
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::local_user_language;
+use serde::{Deserialize, Serialize};
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
use crate::newtypes::{CommentId, DbUrl, LanguageId, LtreeDef, PersonId, PostId};
+#[cfg(feature = "full")]
+use crate::schema::{comment, comment_like, comment_saved};
use diesel_ltree::Ltree;
use serde::{Deserialize, Serialize};
use typed_builder::TypedBuilder;
-#[cfg(feature = "full")]
-use crate::schema::{comment, comment_like, comment_saved};
-
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))]
use crate::newtypes::{CommentId, CommentReplyId, PersonId};
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::comment_reply;
+use serde::{Deserialize, Serialize};
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
use crate::newtypes::{CommentId, CommentReportId, PersonId};
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::comment_report;
+use serde::{Deserialize, Serialize};
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
use crate::newtypes::{CommunityId, DbUrl, InstanceId, PersonId};
-use serde::{Deserialize, Serialize};
-use typed_builder::TypedBuilder;
-
#[cfg(feature = "full")]
use crate::schema::{community, community_follower, community_moderator, community_person_ban};
+use serde::{Deserialize, Serialize};
+use typed_builder::TypedBuilder;
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
use crate::newtypes::{CommunityBlockId, CommunityId, PersonId};
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::community_block;
+use serde::{Deserialize, Serialize};
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
use crate::newtypes::LocalUserId;
-
#[cfg(feature = "full")]
use crate::schema::email_verification;
use crate::newtypes::InstanceId;
-use serde::{Deserialize, Serialize};
-use std::fmt::Debug;
-
#[cfg(feature = "full")]
use crate::schema::federation_allowlist;
+use serde::{Deserialize, Serialize};
+use std::fmt::Debug;
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
use crate::newtypes::InstanceId;
-use serde::{Deserialize, Serialize};
-use std::fmt::Debug;
-
#[cfg(feature = "full")]
use crate::schema::federation_blocklist;
+use serde::{Deserialize, Serialize};
+use std::fmt::Debug;
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
use crate::newtypes::InstanceId;
-use std::fmt::Debug;
-
#[cfg(feature = "full")]
use crate::schema::instance;
+use std::fmt::Debug;
#[derive(PartialEq, Eq, Debug)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
use crate::newtypes::LanguageId;
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::language;
+use serde::{Deserialize, Serialize};
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
use crate::newtypes::{LocalSiteId, SiteId};
-use serde::{Deserialize, Serialize};
-use typed_builder::TypedBuilder;
-
#[cfg(feature = "full")]
use crate::schema::local_site;
+use serde::{Deserialize, Serialize};
+use typed_builder::TypedBuilder;
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
use crate::newtypes::LocalSiteId;
-use serde::{Deserialize, Serialize};
-use typed_builder::TypedBuilder;
-
#[cfg(feature = "full")]
use crate::schema::local_site_rate_limit;
+use serde::{Deserialize, Serialize};
+use typed_builder::TypedBuilder;
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
use crate::newtypes::{LocalUserId, PersonId};
-use serde::{Deserialize, Serialize};
-use typed_builder::TypedBuilder;
-
#[cfg(feature = "full")]
use crate::schema::local_user;
+use serde::{Deserialize, Serialize};
+use typed_builder::TypedBuilder;
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
use crate::newtypes::{CommentId, CommunityId, PersonId, PostId};
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::{
admin_purge_comment,
mod_sticky_post,
mod_transfer_community,
};
+use serde::{Deserialize, Serialize};
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
use crate::newtypes::LocalUserId;
-
#[cfg(feature = "full")]
use crate::schema::password_reset_request;
use crate::newtypes::{DbUrl, InstanceId, PersonId};
-use serde::{Deserialize, Serialize};
-use typed_builder::TypedBuilder;
-
#[cfg(feature = "full")]
use crate::schema::person;
+use serde::{Deserialize, Serialize};
+use typed_builder::TypedBuilder;
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
use crate::newtypes::{PersonBlockId, PersonId};
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::person_block;
+use serde::{Deserialize, Serialize};
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
use crate::newtypes::{CommentId, PersonId, PersonMentionId};
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::person_mention;
+use serde::{Deserialize, Serialize};
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
use crate::newtypes::{CommunityId, DbUrl, LanguageId, PersonId, PostId};
-use serde::{Deserialize, Serialize};
-use typed_builder::TypedBuilder;
-
#[cfg(feature = "full")]
use crate::schema::{post, post_like, post_read, post_saved};
+use serde::{Deserialize, Serialize};
+use typed_builder::TypedBuilder;
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
use crate::newtypes::{DbUrl, PersonId, PostId, PostReportId};
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::post_report;
+use serde::{Deserialize, Serialize};
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
#[cfg_attr(feature = "full", derive(Identifiable, Queryable, Associations))]
use crate::newtypes::{DbUrl, PersonId, PrivateMessageId};
-use serde::{Deserialize, Serialize};
-use typed_builder::TypedBuilder;
-
#[cfg(feature = "full")]
use crate::schema::private_message;
+use serde::{Deserialize, Serialize};
+use typed_builder::TypedBuilder;
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
use crate::newtypes::{PersonId, PrivateMessageId, PrivateMessageReportId};
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::private_message_report;
+use serde::{Deserialize, Serialize};
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
use crate::newtypes::{LocalUserId, PersonId};
-use serde::{Deserialize, Serialize};
-
#[cfg(feature = "full")]
use crate::schema::registration_application;
+use serde::{Deserialize, Serialize};
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
use crate::newtypes::{DbUrl, InstanceId, SiteId};
-use serde::{Deserialize, Serialize};
-use typed_builder::TypedBuilder;
-
#[cfg(feature = "full")]
use crate::schema::site;
+use serde::{Deserialize, Serialize};
+use typed_builder::TypedBuilder;
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
-use regex::RegexBuilder;
-
use crate::utils::{
is_valid_actor_name,
is_valid_display_name,
slur_check,
slurs_vec_to_str,
};
+use regex::RegexBuilder;
#[test]
fn test_mentions_regex() {