mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-03 00:31:58 +00:00
Merge websocket crate into api_common
This commit is contained in:
parent
f02892b23b
commit
8892c39bac
158 changed files with 438 additions and 144 deletions
|
@ -20,6 +20,7 @@ lemmy_db_views = { workspace = true, features = ["full"] }
|
|||
lemmy_db_views_moderator = { workspace = true, features = ["full"] }
|
||||
lemmy_db_views_actor = { workspace = true, features = ["full"] }
|
||||
lemmy_api_common = { workspace = true, features = ["full"] }
|
||||
activitypub_federation = { workspace = true }
|
||||
diesel = { workspace = true }
|
||||
bcrypt = { workspace = true }
|
||||
chrono = { workspace = true }
|
||||
|
|
|
@ -5,6 +5,14 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
utils::{check_community_ban, check_downvotes_enabled, get_local_user_view_from_jwt},
|
||||
websocket::{send::send_comment_ws_message, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
fetcher::post_or_comment::PostOrComment,
|
||||
protocol::activities::voting::{
|
||||
undo_vote::UndoVote,
|
||||
vote::{Vote, VoteType},
|
||||
},
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
newtypes::LocalUserId,
|
||||
|
@ -17,6 +25,7 @@ use lemmy_db_schema::{
|
|||
};
|
||||
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[async_trait::async_trait(?Send)]
|
||||
impl Perform for CreateCommentLike {
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
comment::{CommentResponse, SaveComment},
|
||||
context::LemmyContext,
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::comment::{CommentSaved, CommentSavedForm},
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
utils::{check_community_ban, get_local_user_view_from_jwt},
|
||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
comment::{ListCommentReports, ListCommentReportsResponse},
|
||||
context::LemmyContext,
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_views::comment_report_view::CommentReportQuery;
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
utils::{get_local_user_view_from_jwt, is_mod_or_admin},
|
||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{source::comment_report::CommentReport, traits::Reportable};
|
||||
use lemmy_db_views::structs::CommentReportView;
|
||||
|
|
|
@ -5,6 +5,11 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
utils::{get_local_user_view_from_jwt, is_mod_or_admin},
|
||||
websocket::{messages::SendCommunityRoomMessage, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
objects::{community::ApubCommunity, person::ApubPerson},
|
||||
protocol::activities::community::{add_mod::AddMod, remove_mod::RemoveMod},
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -5,6 +5,12 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
utils::{get_local_user_view_from_jwt, is_mod_or_admin, remove_user_data_in_community},
|
||||
websocket::{messages::SendCommunityRoomMessage, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
activities::block::SiteOrCommunity,
|
||||
objects::{community::ApubCommunity, person::ApubPerson},
|
||||
protocol::activities::block::{block_user::BlockUser, undo_block_user::UndoBlockUser},
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
community::{BlockCommunity, BlockCommunityResponse},
|
||||
context::LemmyContext,
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
community::{CommunityResponse, FollowCommunity},
|
||||
context::LemmyContext,
|
||||
utils::{check_community_ban, check_community_deleted_or_removed, get_local_user_view_from_jwt},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::community::{Community, CommunityFollower, CommunityFollowerForm},
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
utils::{get_local_user_view_from_jwt, is_admin},
|
||||
websocket::{send::send_community_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
community::{GetCommunityResponse, TransferCommunity},
|
||||
context::LemmyContext,
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -1,8 +1,81 @@
|
|||
use actix_web::web::Data;
|
||||
use captcha::Captcha;
|
||||
use lemmy_api_common::{context::LemmyContext, utils::local_site_to_slur_regex};
|
||||
use lemmy_api_common::{
|
||||
comment::{
|
||||
CreateCommentLike,
|
||||
CreateCommentReport,
|
||||
ListCommentReports,
|
||||
ResolveCommentReport,
|
||||
SaveComment,
|
||||
},
|
||||
community::{
|
||||
AddModToCommunity,
|
||||
BanFromCommunity,
|
||||
BlockCommunity,
|
||||
FollowCommunity,
|
||||
TransferCommunity,
|
||||
},
|
||||
person::{
|
||||
AddAdmin,
|
||||
BanPerson,
|
||||
BlockPerson,
|
||||
ChangePassword,
|
||||
GetBannedPersons,
|
||||
GetCaptcha,
|
||||
GetPersonMentions,
|
||||
GetReplies,
|
||||
GetReportCount,
|
||||
GetUnreadCount,
|
||||
Login,
|
||||
MarkAllAsRead,
|
||||
MarkCommentReplyAsRead,
|
||||
MarkPersonMentionAsRead,
|
||||
PasswordChangeAfterReset,
|
||||
PasswordReset,
|
||||
SaveUserSettings,
|
||||
VerifyEmail,
|
||||
},
|
||||
post::{
|
||||
CreatePostLike,
|
||||
CreatePostReport,
|
||||
GetSiteMetadata,
|
||||
ListPostReports,
|
||||
LockPost,
|
||||
MarkPostAsRead,
|
||||
ResolvePostReport,
|
||||
SavePost,
|
||||
StickyPost,
|
||||
},
|
||||
private_message::{
|
||||
CreatePrivateMessageReport,
|
||||
ListPrivateMessageReports,
|
||||
MarkPrivateMessageAsRead,
|
||||
ResolvePrivateMessageReport,
|
||||
},
|
||||
site::{
|
||||
ApproveRegistrationApplication,
|
||||
GetModlog,
|
||||
GetUnreadRegistrationApplicationCount,
|
||||
LeaveAdmin,
|
||||
ListRegistrationApplications,
|
||||
PurgeComment,
|
||||
PurgeCommunity,
|
||||
PurgePerson,
|
||||
PurgePost,
|
||||
ResolveObject,
|
||||
Search,
|
||||
},
|
||||
utils::local_site_to_slur_regex,
|
||||
websocket::{
|
||||
serialize_websocket_message,
|
||||
structs::{CommunityJoin, ModJoin, PostJoin, UserJoin},
|
||||
UserOperation,
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::source::local_site::LocalSite;
|
||||
use lemmy_utils::{error::LemmyError, utils::check_slurs, ConnectionId};
|
||||
use serde::Deserialize;
|
||||
|
||||
mod comment;
|
||||
mod comment_report;
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
person::{AddAdmin, AddAdminResponse},
|
||||
utils::{get_local_user_view_from_jwt, is_admin},
|
||||
websocket::{messages::SendAllMessage, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -5,6 +5,11 @@ use lemmy_api_common::{
|
|||
person::{BanPerson, BanPersonResponse},
|
||||
utils::{get_local_user_view_from_jwt, is_admin, remove_user_data},
|
||||
websocket::{messages::SendAllMessage, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
activities::block::SiteOrCommunity,
|
||||
protocol::activities::block::{block_user::BlockUser, undo_block_user::UndoBlockUser},
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{BlockPerson, BlockPersonResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::person_block::{PersonBlock, PersonBlockForm},
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{ChangePassword, LoginResponse},
|
||||
utils::{get_local_user_view_from_jwt, password_length_check},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::source::local_user::LocalUser;
|
||||
use lemmy_utils::{claims::Claims, error::LemmyError, ConnectionId};
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{LoginResponse, PasswordChangeAfterReset},
|
||||
utils::password_length_check,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::source::{
|
||||
local_user::LocalUser,
|
||||
|
|
|
@ -3,9 +3,9 @@ use actix_web::web::Data;
|
|||
use captcha::{gen, Difficulty};
|
||||
use chrono::Duration;
|
||||
use lemmy_api_common::{
|
||||
context::LemmyContext,
|
||||
person::{CaptchaResponse, GetCaptcha, GetCaptchaResponse},
|
||||
websocket::messages::CaptchaItem,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{source::local_site::LocalSite, utils::naive_now};
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{BannedPersonsResponse, GetBannedPersons},
|
||||
utils::{get_local_user_view_from_jwt, is_admin},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_views_actor::structs::PersonViewSafe;
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{Login, LoginResponse},
|
||||
utils::{check_registration_application, check_user_valid},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::source::local_site::LocalSite;
|
||||
use lemmy_db_views::structs::LocalUserView;
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{GetPersonMentions, GetPersonMentionsResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_views_actor::person_mention_view::PersonMentionQuery;
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{GetReplies, GetRepliesResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_views_actor::comment_reply_view::CommentReplyQuery;
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{GetRepliesResponse, MarkAllAsRead},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::source::{
|
||||
comment_reply::CommentReply,
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{MarkPersonMentionAsRead, PersonMentionResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::person_mention::{PersonMention, PersonMentionUpdateForm},
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{CommentReplyResponse, MarkCommentReplyAsRead},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::comment_reply::{CommentReply, CommentReplyUpdateForm},
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{GetUnreadCount, GetUnreadCountResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_views::structs::PrivateMessageView;
|
||||
use lemmy_db_views_actor::structs::{CommentReplyView, PersonMentionView};
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{GetReportCount, GetReportCountResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_views::structs::{CommentReportView, PostReportView, PrivateMessageReportView};
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{PasswordReset, PasswordResetResponse},
|
||||
utils::send_password_reset_email,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_views::structs::LocalUserView;
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{LoginResponse, SaveUserSettings},
|
||||
utils::{get_local_user_view_from_jwt, send_verification_email},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
person::{VerifyEmail, VerifyEmailResponse},
|
||||
utils::send_email_verification_success,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
post::{GetSiteMetadata, GetSiteMetadataResponse},
|
||||
request::fetch_site_metadata,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
||||
|
|
|
@ -11,6 +11,15 @@ use lemmy_api_common::{
|
|||
mark_post_as_read,
|
||||
},
|
||||
websocket::{send::send_post_ws_message, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
fetcher::post_or_comment::PostOrComment,
|
||||
objects::post::ApubPost,
|
||||
protocol::activities::voting::{
|
||||
undo_vote::UndoVote,
|
||||
vote::{Vote, VoteType},
|
||||
},
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -10,6 +10,11 @@ use lemmy_api_common::{
|
|||
is_mod_or_admin,
|
||||
},
|
||||
websocket::{send::send_post_ws_message, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
objects::post::ApubPost,
|
||||
protocol::activities::{create_or_update::page::CreateOrUpdatePage, CreateOrUpdateType},
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
post::{MarkPostAsRead, PostResponse},
|
||||
utils::{get_local_user_view_from_jwt, mark_post_as_read, mark_post_as_unread},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_views::structs::PostView;
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
post::{PostResponse, SavePost},
|
||||
utils::{get_local_user_view_from_jwt, mark_post_as_read},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::post::{PostSaved, PostSavedForm},
|
||||
|
|
|
@ -10,6 +10,11 @@ use lemmy_api_common::{
|
|||
is_mod_or_admin,
|
||||
},
|
||||
websocket::{send::send_post_ws_message, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
objects::post::ApubPost,
|
||||
protocol::activities::{create_or_update::page::CreateOrUpdatePage, CreateOrUpdateType},
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
post::{CreatePostReport, PostReportResponse},
|
||||
utils::{check_community_ban, get_local_user_view_from_jwt},
|
||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
post::{ListPostReports, ListPostReportsResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_views::post_report_view::PostReportQuery;
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
post::{PostReportResponse, ResolvePostReport},
|
||||
utils::{get_local_user_view_from_jwt, is_mod_or_admin},
|
||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{source::post_report::PostReport, traits::Reportable};
|
||||
use lemmy_db_views::structs::PostReportView;
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
private_message::{MarkPrivateMessageAsRead, PrivateMessageResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
websocket::{send::send_pm_ws_message, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::private_message::{PrivateMessage, PrivateMessageUpdateForm},
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
private_message::{CreatePrivateMessageReport, PrivateMessageReportResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
newtypes::CommunityId,
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
private_message::{ListPrivateMessageReports, ListPrivateMessageReportsResponse},
|
||||
utils::{get_local_user_view_from_jwt, is_admin},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_views::private_message_report_view::PrivateMessageReportQuery;
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
private_message::{PrivateMessageReportResponse, ResolvePrivateMessageReport},
|
||||
utils::{get_local_user_view_from_jwt, is_admin},
|
||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
newtypes::CommunityId,
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
site::{GetSiteResponse, LeaveAdmin},
|
||||
utils::{get_local_user_view_from_jwt, is_admin},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
site::{GetModlog, GetModlogResponse},
|
||||
utils::{check_private_instance, get_local_user_view_from_jwt_opt, is_admin, is_mod_or_admin},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
newtypes::{CommunityId, PersonId},
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
site::{PurgeComment, PurgeItemResponse},
|
||||
utils::{get_local_user_view_from_jwt, is_admin},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
request::purge_image_from_pictrs,
|
||||
site::{PurgeCommunity, PurgeItemResponse},
|
||||
utils::{get_local_user_view_from_jwt, is_admin, purge_image_posts_for_community},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
request::purge_image_from_pictrs,
|
||||
site::{PurgeItemResponse, PurgePerson},
|
||||
utils::{get_local_user_view_from_jwt, is_admin, purge_image_posts_for_person},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
request::purge_image_from_pictrs,
|
||||
site::{PurgeItemResponse, PurgePost},
|
||||
utils::{get_local_user_view_from_jwt, is_admin},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
site::{ApproveRegistrationApplication, RegistrationApplicationResponse},
|
||||
utils::{get_local_user_view_from_jwt, is_admin, send_application_approved_email},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
site::{ListRegistrationApplications, ListRegistrationApplicationsResponse},
|
||||
utils::{get_local_user_view_from_jwt, is_admin},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::source::local_site::LocalSite;
|
||||
use lemmy_db_views::registration_application_view::RegistrationApplicationQuery;
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
site::{GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse},
|
||||
utils::{get_local_user_view_from_jwt, is_admin},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::source::local_site::LocalSite;
|
||||
use lemmy_db_views::structs::RegistrationApplicationView;
|
||||
|
|
|
@ -16,6 +16,7 @@ use lemmy_api_common::{
|
|||
UserJoinResponse,
|
||||
},
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
||||
|
|
|
@ -20,3 +20,72 @@ pub extern crate lemmy_db_schema;
|
|||
pub extern crate lemmy_db_views;
|
||||
pub extern crate lemmy_db_views_actor;
|
||||
pub extern crate lemmy_db_views_moderator;
|
||||
|
||||
use crate::websocket::chat_server::ChatServer;
|
||||
use actix::Addr;
|
||||
use lemmy_db_schema::{source::secret::Secret, utils::DbPool};
|
||||
use lemmy_utils::{
|
||||
rate_limit::RateLimitCell,
|
||||
settings::{structs::Settings, SETTINGS},
|
||||
};
|
||||
use reqwest_middleware::ClientWithMiddleware;
|
||||
|
||||
pub struct LemmyContext {
|
||||
pool: DbPool,
|
||||
chat_server: Addr<ChatServer>,
|
||||
client: ClientWithMiddleware,
|
||||
settings: Settings,
|
||||
secret: Secret,
|
||||
rate_limit_cell: RateLimitCell,
|
||||
}
|
||||
|
||||
impl LemmyContext {
|
||||
pub fn create(
|
||||
pool: DbPool,
|
||||
chat_server: Addr<ChatServer>,
|
||||
client: ClientWithMiddleware,
|
||||
settings: Settings,
|
||||
secret: Secret,
|
||||
settings_updated_channel: RateLimitCell,
|
||||
) -> LemmyContext {
|
||||
LemmyContext {
|
||||
pool,
|
||||
chat_server,
|
||||
client,
|
||||
settings,
|
||||
secret,
|
||||
rate_limit_cell: settings_updated_channel,
|
||||
}
|
||||
}
|
||||
pub fn pool(&self) -> &DbPool {
|
||||
&self.pool
|
||||
}
|
||||
pub fn chat_server(&self) -> &Addr<ChatServer> {
|
||||
&self.chat_server
|
||||
}
|
||||
pub fn client(&self) -> &ClientWithMiddleware {
|
||||
&self.client
|
||||
}
|
||||
pub fn settings(&self) -> &'static Settings {
|
||||
&SETTINGS
|
||||
}
|
||||
pub fn secret(&self) -> &Secret {
|
||||
&self.secret
|
||||
}
|
||||
pub fn settings_updated_channel(&self) -> &RateLimitCell {
|
||||
&self.rate_limit_cell
|
||||
}
|
||||
}
|
||||
|
||||
impl Clone for LemmyContext {
|
||||
fn clone(&self) -> Self {
|
||||
LemmyContext {
|
||||
pool: self.pool.clone(),
|
||||
chat_server: self.chat_server.clone(),
|
||||
client: self.client.clone(),
|
||||
settings: self.settings.clone(),
|
||||
secret: self.secret.clone(),
|
||||
rate_limit_cell: self.rate_limit_cell.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
use crate::{
|
||||
comment::CommentResponse,
|
||||
context::LemmyContext,
|
||||
post::PostResponse,
|
||||
websocket::{
|
||||
messages::{CaptchaItem, StandardMessage, WsMessage},
|
||||
serialize_websocket_message,
|
||||
OperationType,
|
||||
UserOperation,
|
||||
UserOperationApub,
|
||||
UserOperationCrud,
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use actix::prelude::*;
|
||||
use anyhow::Context as acontext;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use crate::{
|
||||
context::LemmyContext,
|
||||
websocket::{
|
||||
chat_server::ChatServer,
|
||||
messages::{Connect, Disconnect, StandardMessage, WsMessage},
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use actix::prelude::*;
|
||||
use actix_web::{web, Error, HttpRequest, HttpResponse};
|
||||
|
|
|
@ -9,6 +9,7 @@ use crate::{
|
|||
messages::{SendComment, SendCommunityRoomMessage, SendPost, SendUserRoomMessage},
|
||||
OperationType,
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
newtypes::{CommentId, CommunityId, LocalUserId, PersonId, PostId, PrivateMessageId},
|
||||
|
|
|
@ -17,6 +17,17 @@ use lemmy_api_common::{
|
|||
send::{send_comment_ws_message, send_local_notifs},
|
||||
UserOperationCrud,
|
||||
},
|
||||
websocket::{
|
||||
send::{send_comment_ws_message, send_local_notifs},
|
||||
UserOperationCrud,
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
generate_local_apub_endpoint,
|
||||
objects::comment::ApubComment,
|
||||
protocol::activities::{create_or_update::note::CreateOrUpdateNote, CreateOrUpdateType},
|
||||
EndpointType,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -8,6 +8,7 @@ use lemmy_api_common::{
|
|||
send::{send_comment_ws_message, send_local_notifs},
|
||||
UserOperationCrud,
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
comment::{CommentResponse, GetComment},
|
||||
context::LemmyContext,
|
||||
utils::{check_private_instance, get_local_user_view_from_jwt_opt},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::source::local_site::LocalSite;
|
||||
use lemmy_db_views::structs::CommentView;
|
||||
|
|
|
@ -8,6 +8,7 @@ use lemmy_api_common::{
|
|||
send::{send_comment_ws_message, send_local_notifs},
|
||||
UserOperationCrud,
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -15,6 +15,11 @@ use lemmy_api_common::{
|
|||
send::{send_comment_ws_message, send_local_notifs},
|
||||
UserOperationCrud,
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::protocol::activities::{
|
||||
create_or_update::note::CreateOrUpdateNote,
|
||||
CreateOrUpdateType,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -3,17 +3,16 @@ use activitypub_federation::core::signatures::generate_actor_keypair;
|
|||
use actix_web::web::Data;
|
||||
use lemmy_api_common::{
|
||||
community::{CommunityResponse, CreateCommunity},
|
||||
context::LemmyContext,
|
||||
utils::{
|
||||
utils::{get_local_user_view_from_jwt, is_admin, local_site_to_slur_regex},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
generate_followers_url,
|
||||
generate_inbox_url,
|
||||
generate_local_apub_endpoint,
|
||||
generate_shared_inbox_url,
|
||||
get_local_user_view_from_jwt,
|
||||
is_admin,
|
||||
local_site_to_slur_regex,
|
||||
objects::community::ApubCommunity,
|
||||
EndpointType,
|
||||
},
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::community::{
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
utils::get_local_user_view_from_jwt,
|
||||
websocket::{send::send_community_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::community::{Community, CommunityUpdateForm},
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
community::{ListCommunities, ListCommunitiesResponse},
|
||||
context::LemmyContext,
|
||||
utils::{check_private_instance, get_local_user_view_from_jwt_opt},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{source::local_site::LocalSite, traits::DeleteableOrRemoveable};
|
||||
use lemmy_db_views_actor::community_view::CommunityQuery;
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
utils::{get_local_user_view_from_jwt, is_admin},
|
||||
websocket::{send::send_community_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
utils::{get_local_user_view_from_jwt, local_site_to_slur_regex},
|
||||
websocket::{send::send_community_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
newtypes::PersonId,
|
||||
|
|
|
@ -1,6 +1,28 @@
|
|||
use actix_web::web::Data;
|
||||
use lemmy_api_common::context::LemmyContext;
|
||||
use actix_web::{web, web::Data};
|
||||
use lemmy_api_common::{
|
||||
comment::{CreateComment, DeleteComment, EditComment, GetComment, GetComments, RemoveComment},
|
||||
community::{
|
||||
CreateCommunity,
|
||||
DeleteCommunity,
|
||||
EditCommunity,
|
||||
GetCommunity,
|
||||
ListCommunities,
|
||||
RemoveCommunity,
|
||||
},
|
||||
person::{DeleteAccount, GetPersonDetails, Register},
|
||||
post::{CreatePost, DeletePost, EditPost, GetPost, GetPosts, RemovePost},
|
||||
private_message::{
|
||||
CreatePrivateMessage,
|
||||
DeletePrivateMessage,
|
||||
EditPrivateMessage,
|
||||
GetPrivateMessages,
|
||||
},
|
||||
site::{CreateSite, EditSite, GetSite},
|
||||
websocket::{serialize_websocket_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
use serde::Deserialize;
|
||||
|
||||
mod comment;
|
||||
mod community;
|
||||
|
|
|
@ -15,6 +15,13 @@ use lemmy_api_common::{
|
|||
EndpointType,
|
||||
},
|
||||
websocket::{send::send_post_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
generate_local_apub_endpoint,
|
||||
objects::post::ApubPost,
|
||||
protocol::activities::{create_or_update::page::CreateOrUpdatePage, CreateOrUpdateType},
|
||||
EndpointType,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
impls::actor_language::default_post_language,
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
post::{DeletePost, PostResponse},
|
||||
utils::{check_community_ban, check_community_deleted_or_removed, get_local_user_view_from_jwt},
|
||||
websocket::{send::send_post_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::post::{Post, PostUpdateForm},
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
post::{GetPost, GetPostResponse},
|
||||
utils::{check_private_instance, get_local_user_view_from_jwt_opt, mark_post_as_read},
|
||||
websocket::messages::GetPostUsersOnline,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
aggregates::structs::{PersonPostAggregates, PersonPostAggregatesForm},
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
post::{PostResponse, RemovePost},
|
||||
utils::{check_community_ban, get_local_user_view_from_jwt, is_mod_or_admin},
|
||||
websocket::{send::send_post_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -11,6 +11,11 @@ use lemmy_api_common::{
|
|||
local_site_to_slur_regex,
|
||||
},
|
||||
websocket::{send::send_post_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::protocol::activities::{
|
||||
create_or_update::page::CreateOrUpdatePage,
|
||||
CreateOrUpdateType,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -13,6 +13,15 @@ use lemmy_api_common::{
|
|||
EndpointType,
|
||||
},
|
||||
websocket::{send::send_pm_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
generate_local_apub_endpoint,
|
||||
protocol::activities::{
|
||||
create_or_update::chat_message::CreateOrUpdateChatMessage,
|
||||
CreateOrUpdateType,
|
||||
},
|
||||
EndpointType,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
private_message::{DeletePrivateMessage, PrivateMessageResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
websocket::{send::send_pm_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::private_message::{PrivateMessage, PrivateMessageUpdateForm},
|
||||
|
|
|
@ -4,6 +4,7 @@ use lemmy_api_common::{
|
|||
context::LemmyContext,
|
||||
private_message::{GetPrivateMessages, PrivateMessagesResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::traits::DeleteableOrRemoveable;
|
||||
use lemmy_db_views::private_message_view::PrivateMessageQuery;
|
||||
|
|
|
@ -5,6 +5,11 @@ use lemmy_api_common::{
|
|||
private_message::{EditPrivateMessage, PrivateMessageResponse},
|
||||
utils::{get_local_user_view_from_jwt, local_site_to_slur_regex},
|
||||
websocket::{send::send_pm_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::protocol::activities::{
|
||||
create_or_update::chat_message::CreateOrUpdateChatMessage,
|
||||
CreateOrUpdateType,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -12,6 +12,7 @@ use lemmy_api_common::{
|
|||
local_site_to_slur_regex,
|
||||
site_description_length_check,
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
newtypes::DbUrl,
|
||||
|
|
|
@ -5,6 +5,7 @@ use lemmy_api_common::{
|
|||
site::{GetSite, GetSiteResponse, MyUserInfo},
|
||||
utils::{build_federated_instances, get_local_user_settings_view_from_jwt_opt},
|
||||
websocket::messages::GetUsersOnline,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::source::{actor_language::SiteLanguage, language::Language, tagline::Tagline};
|
||||
use lemmy_db_views::structs::{LocalUserDiscussionLanguageView, SiteView};
|
||||
|
|
|
@ -11,6 +11,7 @@ use lemmy_api_common::{
|
|||
site_description_length_check,
|
||||
},
|
||||
websocket::{messages::SendAllMessage, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -16,6 +16,13 @@ use lemmy_api_common::{
|
|||
EndpointType,
|
||||
},
|
||||
websocket::messages::CheckCaptcha,
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_apub::{
|
||||
generate_inbox_url,
|
||||
generate_local_apub_endpoint,
|
||||
generate_shared_inbox_url,
|
||||
EndpointType,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
aggregates::structs::PersonAggregates,
|
||||
|
|
|
@ -4,7 +4,8 @@ use bcrypt::verify;
|
|||
use lemmy_api_common::{
|
||||
context::LemmyContext,
|
||||
person::{DeleteAccount, DeleteAccountResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
utils::{delete_user_account, get_local_user_view_from_jwt},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ use activitystreams_kinds::{activity::BlockType, public};
|
|||
use anyhow::anyhow;
|
||||
use chrono::NaiveDateTime;
|
||||
use lemmy_api_common::{
|
||||
context::LemmyContext,
|
||||
utils::{remove_user_data, remove_user_data_in_community},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -9,19 +9,9 @@ use crate::{
|
|||
};
|
||||
use activitypub_federation::{core::object_id::ObjectId, traits::ApubObject};
|
||||
use chrono::NaiveDateTime;
|
||||
use lemmy_api_common::{
|
||||
community::{BanFromCommunity, BanFromCommunityResponse},
|
||||
context::LemmyContext,
|
||||
person::{BanPerson, BanPersonResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{community::Community, person::Person, site::Site},
|
||||
traits::Crud,
|
||||
utils::DbPool,
|
||||
};
|
||||
use lemmy_db_views::structs::SiteView;
|
||||
use lemmy_utils::{error::LemmyError, utils::naive_from_unix};
|
||||
use lemmy_api_common::LemmyContext;
|
||||
use lemmy_db_schema::{source::site::Site, utils::DbPool};
|
||||
use lemmy_utils::error::LemmyError;
|
||||
use serde::Deserialize;
|
||||
use url::Url;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ use activitypub_federation::{
|
|||
utils::verify_domains_match,
|
||||
};
|
||||
use activitystreams_kinds::{activity::UndoType, public};
|
||||
use lemmy_api_common::context::LemmyContext;
|
||||
use lemmy_api_common::LemmyContext;
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
community::{CommunityPersonBan, CommunityPersonBanForm},
|
||||
|
|
|
@ -23,11 +23,7 @@ use activitypub_federation::{
|
|||
traits::{ActivityHandler, Actor},
|
||||
};
|
||||
use activitystreams_kinds::{activity::AddType, public};
|
||||
use lemmy_api_common::{
|
||||
community::{AddModToCommunity, AddModToCommunityResponse},
|
||||
context::LemmyContext,
|
||||
utils::{generate_moderators_url, get_local_user_view_from_jwt},
|
||||
};
|
||||
use lemmy_api_common::LemmyContext;
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
community::{Community, CommunityModerator, CommunityModeratorForm},
|
||||
|
|
|
@ -18,7 +18,7 @@ use crate::{
|
|||
};
|
||||
use activitypub_federation::{core::object_id::ObjectId, data::Data, traits::ActivityHandler};
|
||||
use activitystreams_kinds::{activity::AnnounceType, public};
|
||||
use lemmy_api_common::context::LemmyContext;
|
||||
use lemmy_api_common::LemmyContext;
|
||||
use lemmy_utils::error::LemmyError;
|
||||
use serde_json::Value;
|
||||
use tracing::debug;
|
||||
|
|
|
@ -6,7 +6,7 @@ use crate::{
|
|||
protocol::activities::community::announce::AnnounceActivity,
|
||||
};
|
||||
use activitypub_federation::{core::object_id::ObjectId, traits::Actor};
|
||||
use lemmy_api_common::context::LemmyContext;
|
||||
use lemmy_api_common::LemmyContext;
|
||||
use lemmy_db_schema::source::person::PersonFollower;
|
||||
use lemmy_utils::error::LemmyError;
|
||||
use url::Url;
|
||||
|
|
|
@ -19,7 +19,7 @@ use activitypub_federation::{
|
|||
traits::{ActivityHandler, Actor},
|
||||
};
|
||||
use activitystreams_kinds::{activity::RemoveType, public};
|
||||
use lemmy_api_common::{context::LemmyContext, utils::generate_moderators_url};
|
||||
use lemmy_api_common::LemmyContext;
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
community::{CommunityModerator, CommunityModeratorForm},
|
||||
|
|
|
@ -14,11 +14,10 @@ use activitypub_federation::{
|
|||
};
|
||||
use activitystreams_kinds::activity::FlagType;
|
||||
use lemmy_api_common::{
|
||||
comment::{CommentReportResponse, CreateCommentReport},
|
||||
context::LemmyContext,
|
||||
post::{CreatePostReport, PostReportResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
comment::CommentReportResponse,
|
||||
post::PostReportResponse,
|
||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -19,10 +19,8 @@ use activitypub_federation::{
|
|||
};
|
||||
use activitystreams_kinds::{activity::UpdateType, public};
|
||||
use lemmy_api_common::{
|
||||
community::{CommunityResponse, EditCommunity, HideCommunity},
|
||||
context::LemmyContext,
|
||||
utils::get_local_user_view_from_jwt,
|
||||
websocket::{send::send_community_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{source::community::Community, traits::Crud};
|
||||
use lemmy_utils::error::LemmyError;
|
||||
|
|
|
@ -26,10 +26,9 @@ use activitypub_federation::{
|
|||
};
|
||||
use activitystreams_kinds::public;
|
||||
use lemmy_api_common::{
|
||||
comment::{CommentResponse, CreateComment, EditComment},
|
||||
context::LemmyContext,
|
||||
utils::check_post_deleted_or_removed,
|
||||
websocket::{send::send_comment_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
newtypes::PersonId,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::{local_instance, objects::person::ApubPerson};
|
||||
use activitypub_federation::core::object_id::ObjectId;
|
||||
use lemmy_api_common::{context::LemmyContext, websocket::send::send_local_notifs};
|
||||
use lemmy_api_common::{websocket::send::send_local_notifs, LemmyContext};
|
||||
use lemmy_db_schema::{
|
||||
newtypes::LocalUserId,
|
||||
source::{comment::Comment, post::Post},
|
||||
|
|
|
@ -24,10 +24,8 @@ use activitypub_federation::{
|
|||
};
|
||||
use activitystreams_kinds::public;
|
||||
use lemmy_api_common::{
|
||||
context::LemmyContext,
|
||||
post::{CreatePost, EditPost, LockPost, PostResponse, StickyPost},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
websocket::{send::send_post_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
newtypes::PersonId,
|
||||
|
|
|
@ -15,15 +15,10 @@ use activitypub_federation::{
|
|||
utils::verify_domains_match,
|
||||
};
|
||||
use lemmy_api_common::{
|
||||
context::LemmyContext,
|
||||
private_message::{CreatePrivateMessage, EditPrivateMessage, PrivateMessageResponse},
|
||||
websocket::{send::send_pm_ws_message, UserOperationCrud},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
newtypes::PersonId,
|
||||
source::{person::Person, private_message::PrivateMessage},
|
||||
traits::Crud,
|
||||
};
|
||||
use lemmy_db_schema::{source::person::Person, traits::Crud};
|
||||
use lemmy_utils::error::LemmyError;
|
||||
use url::Url;
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@ use crate::{
|
|||
use activitypub_federation::{core::object_id::ObjectId, data::Data, traits::ActivityHandler};
|
||||
use activitystreams_kinds::activity::DeleteType;
|
||||
use lemmy_api_common::{
|
||||
context::LemmyContext,
|
||||
websocket::{
|
||||
send::{send_comment_ws_message_simple, send_community_ws_message, send_post_ws_message},
|
||||
UserOperationCrud,
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -12,11 +12,7 @@ use activitypub_federation::{
|
|||
utils::verify_urls_match,
|
||||
};
|
||||
use activitystreams_kinds::{activity::DeleteType, public};
|
||||
use lemmy_api_common::{
|
||||
context::LemmyContext,
|
||||
person::{DeleteAccount, DeleteAccountResponse},
|
||||
utils::{delete_user_account, get_local_user_view_from_jwt},
|
||||
};
|
||||
use lemmy_api_common::{utils::delete_user_account, LemmyContext};
|
||||
use lemmy_utils::error::LemmyError;
|
||||
use url::Url;
|
||||
|
||||
|
|
|
@ -30,12 +30,6 @@ use activitypub_federation::{
|
|||
};
|
||||
use activitystreams_kinds::public;
|
||||
use lemmy_api_common::{
|
||||
comment::{CommentResponse, DeleteComment, RemoveComment},
|
||||
community::{CommunityResponse, DeleteCommunity, RemoveCommunity},
|
||||
context::LemmyContext,
|
||||
post::{DeletePost, PostResponse, RemovePost},
|
||||
private_message::{DeletePrivateMessage, PrivateMessageResponse},
|
||||
utils::get_local_user_view_from_jwt,
|
||||
websocket::{
|
||||
send::{
|
||||
send_comment_ws_message_simple,
|
||||
|
@ -45,6 +39,7 @@ use lemmy_api_common::{
|
|||
},
|
||||
UserOperationCrud,
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
|
@ -10,11 +10,11 @@ use crate::{
|
|||
use activitypub_federation::{core::object_id::ObjectId, data::Data, traits::ActivityHandler};
|
||||
use activitystreams_kinds::activity::UndoType;
|
||||
use lemmy_api_common::{
|
||||
context::LemmyContext,
|
||||
websocket::{
|
||||
send::{send_comment_ws_message_simple, send_community_ws_message, send_post_ws_message},
|
||||
UserOperationCrud,
|
||||
},
|
||||
LemmyContext,
|
||||
};
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue