mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-07-03 12:35:54 +00:00
Add SendActivity trait so that api crates compile in parallel with lemmy_apub
This commit is contained in:
parent
8892c39bac
commit
d423044b60
|
@ -20,7 +20,6 @@ lemmy_db_views = { workspace = true, features = ["full"] }
|
||||||
lemmy_db_views_moderator = { workspace = true, features = ["full"] }
|
lemmy_db_views_moderator = { workspace = true, features = ["full"] }
|
||||||
lemmy_db_views_actor = { workspace = true, features = ["full"] }
|
lemmy_db_views_actor = { workspace = true, features = ["full"] }
|
||||||
lemmy_api_common = { workspace = true, features = ["full"] }
|
lemmy_api_common = { workspace = true, features = ["full"] }
|
||||||
activitypub_federation = { workspace = true }
|
|
||||||
diesel = { workspace = true }
|
diesel = { workspace = true }
|
||||||
bcrypt = { workspace = true }
|
bcrypt = { workspace = true }
|
||||||
chrono = { workspace = true }
|
chrono = { workspace = true }
|
||||||
|
|
|
@ -5,14 +5,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{check_community_ban, check_downvotes_enabled, get_local_user_view_from_jwt},
|
utils::{check_community_ban, check_downvotes_enabled, get_local_user_view_from_jwt},
|
||||||
websocket::{send::send_comment_ws_message, UserOperation},
|
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::{
|
use lemmy_db_schema::{
|
||||||
newtypes::LocalUserId,
|
newtypes::LocalUserId,
|
||||||
|
@ -25,7 +17,6 @@ use lemmy_db_schema::{
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
use lemmy_db_views::structs::{CommentView, LocalUserView};
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
use std::convert::TryInto;
|
|
||||||
|
|
||||||
#[async_trait::async_trait(?Send)]
|
#[async_trait::async_trait(?Send)]
|
||||||
impl Perform for CreateCommentLike {
|
impl Perform for CreateCommentLike {
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
comment::{CommentResponse, SaveComment},
|
comment::{CommentResponse, SaveComment},
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::comment::{CommentSaved, CommentSavedForm},
|
source::comment::{CommentSaved, CommentSavedForm},
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{check_community_ban, get_local_user_view_from_jwt},
|
utils::{check_community_ban, get_local_user_view_from_jwt},
|
||||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
comment::{ListCommentReports, ListCommentReportsResponse},
|
comment::{ListCommentReports, ListCommentReportsResponse},
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_views::comment_report_view::CommentReportQuery;
|
use lemmy_db_views::comment_report_view::CommentReportQuery;
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{get_local_user_view_from_jwt, is_mod_or_admin},
|
utils::{get_local_user_view_from_jwt, is_mod_or_admin},
|
||||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{source::comment_report::CommentReport, traits::Reportable};
|
use lemmy_db_schema::{source::comment_report::CommentReport, traits::Reportable};
|
||||||
use lemmy_db_views::structs::CommentReportView;
|
use lemmy_db_views::structs::CommentReportView;
|
||||||
|
|
|
@ -5,11 +5,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{get_local_user_view_from_jwt, is_mod_or_admin},
|
utils::{get_local_user_view_from_jwt, is_mod_or_admin},
|
||||||
websocket::{messages::SendCommunityRoomMessage, UserOperation},
|
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::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -5,12 +5,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{get_local_user_view_from_jwt, is_mod_or_admin, remove_user_data_in_community},
|
utils::{get_local_user_view_from_jwt, is_mod_or_admin, remove_user_data_in_community},
|
||||||
websocket::{messages::SendCommunityRoomMessage, UserOperation},
|
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::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
community::{BlockCommunity, BlockCommunityResponse},
|
community::{BlockCommunity, BlockCommunityResponse},
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
community::{CommunityResponse, FollowCommunity},
|
community::{CommunityResponse, FollowCommunity},
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{check_community_ban, check_community_deleted_or_removed, get_local_user_view_from_jwt},
|
utils::{check_community_ban, check_community_deleted_or_removed, get_local_user_view_from_jwt},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::community::{Community, CommunityFollower, CommunityFollowerForm},
|
source::community::{Community, CommunityFollower, CommunityFollowerForm},
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{get_local_user_view_from_jwt, is_admin},
|
utils::{get_local_user_view_from_jwt, is_admin},
|
||||||
websocket::{send::send_community_ws_message, UserOperationCrud},
|
websocket::{send::send_community_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
community::{GetCommunityResponse, TransferCommunity},
|
community::{GetCommunityResponse, TransferCommunity},
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -1,81 +1,8 @@
|
||||||
use actix_web::web::Data;
|
use actix_web::web::Data;
|
||||||
use captcha::Captcha;
|
use captcha::Captcha;
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{context::LemmyContext, utils::local_site_to_slur_regex};
|
||||||
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_db_schema::source::local_site::LocalSite;
|
||||||
use lemmy_utils::{error::LemmyError, utils::check_slurs, ConnectionId};
|
use lemmy_utils::{error::LemmyError, utils::check_slurs, ConnectionId};
|
||||||
use serde::Deserialize;
|
|
||||||
|
|
||||||
mod comment;
|
mod comment;
|
||||||
mod comment_report;
|
mod comment_report;
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
person::{AddAdmin, AddAdminResponse},
|
person::{AddAdmin, AddAdminResponse},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin},
|
utils::{get_local_user_view_from_jwt, is_admin},
|
||||||
websocket::{messages::SendAllMessage, UserOperation},
|
websocket::{messages::SendAllMessage, UserOperation},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -5,11 +5,6 @@ use lemmy_api_common::{
|
||||||
person::{BanPerson, BanPersonResponse},
|
person::{BanPerson, BanPersonResponse},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin, remove_user_data},
|
utils::{get_local_user_view_from_jwt, is_admin, remove_user_data},
|
||||||
websocket::{messages::SendAllMessage, UserOperation},
|
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::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{BlockPerson, BlockPersonResponse},
|
person::{BlockPerson, BlockPersonResponse},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::person_block::{PersonBlock, PersonBlockForm},
|
source::person_block::{PersonBlock, PersonBlockForm},
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{ChangePassword, LoginResponse},
|
person::{ChangePassword, LoginResponse},
|
||||||
utils::{get_local_user_view_from_jwt, password_length_check},
|
utils::{get_local_user_view_from_jwt, password_length_check},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::local_user::LocalUser;
|
use lemmy_db_schema::source::local_user::LocalUser;
|
||||||
use lemmy_utils::{claims::Claims, error::LemmyError, ConnectionId};
|
use lemmy_utils::{claims::Claims, error::LemmyError, ConnectionId};
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{LoginResponse, PasswordChangeAfterReset},
|
person::{LoginResponse, PasswordChangeAfterReset},
|
||||||
utils::password_length_check,
|
utils::password_length_check,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::{
|
use lemmy_db_schema::source::{
|
||||||
local_user::LocalUser,
|
local_user::LocalUser,
|
||||||
|
|
|
@ -3,9 +3,9 @@ use actix_web::web::Data;
|
||||||
use captcha::{gen, Difficulty};
|
use captcha::{gen, Difficulty};
|
||||||
use chrono::Duration;
|
use chrono::Duration;
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
|
context::LemmyContext,
|
||||||
person::{CaptchaResponse, GetCaptcha, GetCaptchaResponse},
|
person::{CaptchaResponse, GetCaptcha, GetCaptchaResponse},
|
||||||
websocket::messages::CaptchaItem,
|
websocket::messages::CaptchaItem,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{source::local_site::LocalSite, utils::naive_now};
|
use lemmy_db_schema::{source::local_site::LocalSite, utils::naive_now};
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{BannedPersonsResponse, GetBannedPersons},
|
person::{BannedPersonsResponse, GetBannedPersons},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin},
|
utils::{get_local_user_view_from_jwt, is_admin},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::PersonViewSafe;
|
use lemmy_db_views_actor::structs::PersonViewSafe;
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{Login, LoginResponse},
|
person::{Login, LoginResponse},
|
||||||
utils::{check_registration_application, check_user_valid},
|
utils::{check_registration_application, check_user_valid},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::local_site::LocalSite;
|
use lemmy_db_schema::source::local_site::LocalSite;
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{GetPersonMentions, GetPersonMentionsResponse},
|
person::{GetPersonMentions, GetPersonMentionsResponse},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::person_mention_view::PersonMentionQuery;
|
use lemmy_db_views_actor::person_mention_view::PersonMentionQuery;
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{GetReplies, GetRepliesResponse},
|
person::{GetReplies, GetRepliesResponse},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::comment_reply_view::CommentReplyQuery;
|
use lemmy_db_views_actor::comment_reply_view::CommentReplyQuery;
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{GetRepliesResponse, MarkAllAsRead},
|
person::{GetRepliesResponse, MarkAllAsRead},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::{
|
use lemmy_db_schema::source::{
|
||||||
comment_reply::CommentReply,
|
comment_reply::CommentReply,
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{MarkPersonMentionAsRead, PersonMentionResponse},
|
person::{MarkPersonMentionAsRead, PersonMentionResponse},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::person_mention::{PersonMention, PersonMentionUpdateForm},
|
source::person_mention::{PersonMention, PersonMentionUpdateForm},
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{CommentReplyResponse, MarkCommentReplyAsRead},
|
person::{CommentReplyResponse, MarkCommentReplyAsRead},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::comment_reply::{CommentReply, CommentReplyUpdateForm},
|
source::comment_reply::{CommentReply, CommentReplyUpdateForm},
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{GetUnreadCount, GetUnreadCountResponse},
|
person::{GetUnreadCount, GetUnreadCountResponse},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::PrivateMessageView;
|
use lemmy_db_views::structs::PrivateMessageView;
|
||||||
use lemmy_db_views_actor::structs::{CommentReplyView, PersonMentionView};
|
use lemmy_db_views_actor::structs::{CommentReplyView, PersonMentionView};
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{GetReportCount, GetReportCountResponse},
|
person::{GetReportCount, GetReportCountResponse},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{CommentReportView, PostReportView, PrivateMessageReportView};
|
use lemmy_db_views::structs::{CommentReportView, PostReportView, PrivateMessageReportView};
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{PasswordReset, PasswordResetResponse},
|
person::{PasswordReset, PasswordResetResponse},
|
||||||
utils::send_password_reset_email,
|
utils::send_password_reset_email,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::LocalUserView;
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{LoginResponse, SaveUserSettings},
|
person::{LoginResponse, SaveUserSettings},
|
||||||
utils::{get_local_user_view_from_jwt, send_verification_email},
|
utils::{get_local_user_view_from_jwt, send_verification_email},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{VerifyEmail, VerifyEmailResponse},
|
person::{VerifyEmail, VerifyEmailResponse},
|
||||||
utils::send_email_verification_success,
|
utils::send_email_verification_success,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
post::{GetSiteMetadata, GetSiteMetadataResponse},
|
post::{GetSiteMetadata, GetSiteMetadataResponse},
|
||||||
request::fetch_site_metadata,
|
request::fetch_site_metadata,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
||||||
|
|
|
@ -11,15 +11,6 @@ use lemmy_api_common::{
|
||||||
mark_post_as_read,
|
mark_post_as_read,
|
||||||
},
|
},
|
||||||
websocket::{send::send_post_ws_message, UserOperation},
|
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::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -10,11 +10,6 @@ use lemmy_api_common::{
|
||||||
is_mod_or_admin,
|
is_mod_or_admin,
|
||||||
},
|
},
|
||||||
websocket::{send::send_post_ws_message, UserOperation},
|
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::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
post::{MarkPostAsRead, PostResponse},
|
post::{MarkPostAsRead, PostResponse},
|
||||||
utils::{get_local_user_view_from_jwt, mark_post_as_read, mark_post_as_unread},
|
utils::{get_local_user_view_from_jwt, mark_post_as_read, mark_post_as_unread},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::PostView;
|
use lemmy_db_views::structs::PostView;
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
post::{PostResponse, SavePost},
|
post::{PostResponse, SavePost},
|
||||||
utils::{get_local_user_view_from_jwt, mark_post_as_read},
|
utils::{get_local_user_view_from_jwt, mark_post_as_read},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::post::{PostSaved, PostSavedForm},
|
source::post::{PostSaved, PostSavedForm},
|
||||||
|
|
|
@ -10,11 +10,6 @@ use lemmy_api_common::{
|
||||||
is_mod_or_admin,
|
is_mod_or_admin,
|
||||||
},
|
},
|
||||||
websocket::{send::send_post_ws_message, UserOperation},
|
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::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
post::{CreatePostReport, PostReportResponse},
|
post::{CreatePostReport, PostReportResponse},
|
||||||
utils::{check_community_ban, get_local_user_view_from_jwt},
|
utils::{check_community_ban, get_local_user_view_from_jwt},
|
||||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
post::{ListPostReports, ListPostReportsResponse},
|
post::{ListPostReports, ListPostReportsResponse},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_views::post_report_view::PostReportQuery;
|
use lemmy_db_views::post_report_view::PostReportQuery;
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
post::{PostReportResponse, ResolvePostReport},
|
post::{PostReportResponse, ResolvePostReport},
|
||||||
utils::{get_local_user_view_from_jwt, is_mod_or_admin},
|
utils::{get_local_user_view_from_jwt, is_mod_or_admin},
|
||||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{source::post_report::PostReport, traits::Reportable};
|
use lemmy_db_schema::{source::post_report::PostReport, traits::Reportable};
|
||||||
use lemmy_db_views::structs::PostReportView;
|
use lemmy_db_views::structs::PostReportView;
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
private_message::{MarkPrivateMessageAsRead, PrivateMessageResponse},
|
private_message::{MarkPrivateMessageAsRead, PrivateMessageResponse},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
websocket::{send::send_pm_ws_message, UserOperation},
|
websocket::{send::send_pm_ws_message, UserOperation},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::private_message::{PrivateMessage, PrivateMessageUpdateForm},
|
source::private_message::{PrivateMessage, PrivateMessageUpdateForm},
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
private_message::{CreatePrivateMessageReport, PrivateMessageReportResponse},
|
private_message::{CreatePrivateMessageReport, PrivateMessageReportResponse},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::CommunityId,
|
newtypes::CommunityId,
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
private_message::{ListPrivateMessageReports, ListPrivateMessageReportsResponse},
|
private_message::{ListPrivateMessageReports, ListPrivateMessageReportsResponse},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin},
|
utils::{get_local_user_view_from_jwt, is_admin},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_views::private_message_report_view::PrivateMessageReportQuery;
|
use lemmy_db_views::private_message_report_view::PrivateMessageReportQuery;
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
private_message::{PrivateMessageReportResponse, ResolvePrivateMessageReport},
|
private_message::{PrivateMessageReportResponse, ResolvePrivateMessageReport},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin},
|
utils::{get_local_user_view_from_jwt, is_admin},
|
||||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::CommunityId,
|
newtypes::CommunityId,
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
site::{GetSiteResponse, LeaveAdmin},
|
site::{GetSiteResponse, LeaveAdmin},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin},
|
utils::{get_local_user_view_from_jwt, is_admin},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
site::{GetModlog, GetModlogResponse},
|
site::{GetModlog, GetModlogResponse},
|
||||||
utils::{check_private_instance, get_local_user_view_from_jwt_opt, is_admin, is_mod_or_admin},
|
utils::{check_private_instance, get_local_user_view_from_jwt_opt, is_admin, is_mod_or_admin},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::{CommunityId, PersonId},
|
newtypes::{CommunityId, PersonId},
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
site::{PurgeComment, PurgeItemResponse},
|
site::{PurgeComment, PurgeItemResponse},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin},
|
utils::{get_local_user_view_from_jwt, is_admin},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
request::purge_image_from_pictrs,
|
request::purge_image_from_pictrs,
|
||||||
site::{PurgeCommunity, PurgeItemResponse},
|
site::{PurgeCommunity, PurgeItemResponse},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin, purge_image_posts_for_community},
|
utils::{get_local_user_view_from_jwt, is_admin, purge_image_posts_for_community},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
request::purge_image_from_pictrs,
|
request::purge_image_from_pictrs,
|
||||||
site::{PurgeItemResponse, PurgePerson},
|
site::{PurgeItemResponse, PurgePerson},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin, purge_image_posts_for_person},
|
utils::{get_local_user_view_from_jwt, is_admin, purge_image_posts_for_person},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
request::purge_image_from_pictrs,
|
request::purge_image_from_pictrs,
|
||||||
site::{PurgeItemResponse, PurgePost},
|
site::{PurgeItemResponse, PurgePost},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin},
|
utils::{get_local_user_view_from_jwt, is_admin},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
site::{ApproveRegistrationApplication, RegistrationApplicationResponse},
|
site::{ApproveRegistrationApplication, RegistrationApplicationResponse},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin, send_application_approved_email},
|
utils::{get_local_user_view_from_jwt, is_admin, send_application_approved_email},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
site::{ListRegistrationApplications, ListRegistrationApplicationsResponse},
|
site::{ListRegistrationApplications, ListRegistrationApplicationsResponse},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin},
|
utils::{get_local_user_view_from_jwt, is_admin},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::local_site::LocalSite;
|
use lemmy_db_schema::source::local_site::LocalSite;
|
||||||
use lemmy_db_views::registration_application_view::RegistrationApplicationQuery;
|
use lemmy_db_views::registration_application_view::RegistrationApplicationQuery;
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
site::{GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse},
|
site::{GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin},
|
utils::{get_local_user_view_from_jwt, is_admin},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::local_site::LocalSite;
|
use lemmy_db_schema::source::local_site::LocalSite;
|
||||||
use lemmy_db_views::structs::RegistrationApplicationView;
|
use lemmy_db_views::structs::RegistrationApplicationView;
|
||||||
|
|
|
@ -16,7 +16,6 @@ use lemmy_api_common::{
|
||||||
UserJoinResponse,
|
UserJoinResponse,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
||||||
|
|
|
@ -20,72 +20,3 @@ pub extern crate lemmy_db_schema;
|
||||||
pub extern crate lemmy_db_views;
|
pub extern crate lemmy_db_views;
|
||||||
pub extern crate lemmy_db_views_actor;
|
pub extern crate lemmy_db_views_actor;
|
||||||
pub extern crate lemmy_db_views_moderator;
|
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(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -808,3 +808,65 @@ pub fn generate_outbox_url(actor_id: &DbUrl) -> Result<DbUrl, ParseError> {
|
||||||
pub fn generate_moderators_url(community_id: &DbUrl) -> Result<DbUrl, LemmyError> {
|
pub fn generate_moderators_url(community_id: &DbUrl) -> Result<DbUrl, LemmyError> {
|
||||||
Ok(Url::parse(&format!("{}/moderators", community_id))?.into())
|
Ok(Url::parse(&format!("{}/moderators", community_id))?.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub enum EndpointType {
|
||||||
|
Community,
|
||||||
|
Person,
|
||||||
|
Post,
|
||||||
|
Comment,
|
||||||
|
PrivateMessage,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Generates an apub endpoint for a given domain, IE xyz.tld
|
||||||
|
pub fn generate_local_apub_endpoint(
|
||||||
|
endpoint_type: EndpointType,
|
||||||
|
name: &str,
|
||||||
|
domain: &str,
|
||||||
|
) -> Result<DbUrl, ParseError> {
|
||||||
|
let point = match endpoint_type {
|
||||||
|
EndpointType::Community => "c",
|
||||||
|
EndpointType::Person => "u",
|
||||||
|
EndpointType::Post => "post",
|
||||||
|
EndpointType::Comment => "comment",
|
||||||
|
EndpointType::PrivateMessage => "private_message",
|
||||||
|
};
|
||||||
|
|
||||||
|
Ok(Url::parse(&format!("{}/{}/{}", domain, point, name))?.into())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn generate_followers_url(actor_id: &DbUrl) -> Result<DbUrl, ParseError> {
|
||||||
|
Ok(Url::parse(&format!("{}/followers", actor_id))?.into())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn generate_inbox_url(actor_id: &DbUrl) -> Result<DbUrl, ParseError> {
|
||||||
|
Ok(Url::parse(&format!("{}/inbox", actor_id))?.into())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn generate_site_inbox_url(actor_id: &DbUrl) -> Result<DbUrl, ParseError> {
|
||||||
|
let mut actor_id: Url = actor_id.clone().into();
|
||||||
|
actor_id.set_path("site_inbox");
|
||||||
|
Ok(actor_id.into())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn generate_shared_inbox_url(actor_id: &DbUrl) -> Result<DbUrl, LemmyError> {
|
||||||
|
let actor_id: Url = actor_id.clone().into();
|
||||||
|
let url = format!(
|
||||||
|
"{}://{}{}/inbox",
|
||||||
|
&actor_id.scheme(),
|
||||||
|
&actor_id.host_str().context(location_info!())?,
|
||||||
|
if let Some(port) = actor_id.port() {
|
||||||
|
format!(":{}", port)
|
||||||
|
} else {
|
||||||
|
String::new()
|
||||||
|
},
|
||||||
|
);
|
||||||
|
Ok(Url::parse(&url)?.into())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn generate_outbox_url(actor_id: &DbUrl) -> Result<DbUrl, ParseError> {
|
||||||
|
Ok(Url::parse(&format!("{}/outbox", actor_id))?.into())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn generate_moderators_url(community_id: &DbUrl) -> Result<DbUrl, LemmyError> {
|
||||||
|
Ok(Url::parse(&format!("{}/moderators", community_id))?.into())
|
||||||
|
}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
comment::CommentResponse,
|
comment::CommentResponse,
|
||||||
|
context::LemmyContext,
|
||||||
post::PostResponse,
|
post::PostResponse,
|
||||||
websocket::{
|
websocket::{
|
||||||
messages::{CaptchaItem, StandardMessage, WsMessage},
|
messages::{CaptchaItem, StandardMessage, WsMessage},
|
||||||
serialize_websocket_message,
|
serialize_websocket_message,
|
||||||
OperationType,
|
OperationType,
|
||||||
UserOperation,
|
UserOperation,
|
||||||
|
UserOperationApub,
|
||||||
UserOperationCrud,
|
UserOperationCrud,
|
||||||
},
|
},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use actix::prelude::*;
|
use actix::prelude::*;
|
||||||
use anyhow::Context as acontext;
|
use anyhow::Context as acontext;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
|
context::LemmyContext,
|
||||||
websocket::{
|
websocket::{
|
||||||
chat_server::ChatServer,
|
chat_server::ChatServer,
|
||||||
messages::{Connect, Disconnect, StandardMessage, WsMessage},
|
messages::{Connect, Disconnect, StandardMessage, WsMessage},
|
||||||
},
|
},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use actix::prelude::*;
|
use actix::prelude::*;
|
||||||
use actix_web::{web, Error, HttpRequest, HttpResponse};
|
use actix_web::{web, Error, HttpRequest, HttpResponse};
|
||||||
|
|
|
@ -9,7 +9,6 @@ use crate::{
|
||||||
messages::{SendComment, SendCommunityRoomMessage, SendPost, SendUserRoomMessage},
|
messages::{SendComment, SendCommunityRoomMessage, SendPost, SendUserRoomMessage},
|
||||||
OperationType,
|
OperationType,
|
||||||
},
|
},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::{CommentId, CommunityId, LocalUserId, PersonId, PostId, PrivateMessageId},
|
newtypes::{CommentId, CommunityId, LocalUserId, PersonId, PostId, PrivateMessageId},
|
||||||
|
|
|
@ -17,17 +17,6 @@ use lemmy_api_common::{
|
||||||
send::{send_comment_ws_message, send_local_notifs},
|
send::{send_comment_ws_message, send_local_notifs},
|
||||||
UserOperationCrud,
|
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::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -8,7 +8,6 @@ use lemmy_api_common::{
|
||||||
send::{send_comment_ws_message, send_local_notifs},
|
send::{send_comment_ws_message, send_local_notifs},
|
||||||
UserOperationCrud,
|
UserOperationCrud,
|
||||||
},
|
},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
comment::{CommentResponse, GetComment},
|
comment::{CommentResponse, GetComment},
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{check_private_instance, get_local_user_view_from_jwt_opt},
|
utils::{check_private_instance, get_local_user_view_from_jwt_opt},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::local_site::LocalSite;
|
use lemmy_db_schema::source::local_site::LocalSite;
|
||||||
use lemmy_db_views::structs::CommentView;
|
use lemmy_db_views::structs::CommentView;
|
||||||
|
|
|
@ -8,7 +8,6 @@ use lemmy_api_common::{
|
||||||
send::{send_comment_ws_message, send_local_notifs},
|
send::{send_comment_ws_message, send_local_notifs},
|
||||||
UserOperationCrud,
|
UserOperationCrud,
|
||||||
},
|
},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -15,11 +15,6 @@ use lemmy_api_common::{
|
||||||
send::{send_comment_ws_message, send_local_notifs},
|
send::{send_comment_ws_message, send_local_notifs},
|
||||||
UserOperationCrud,
|
UserOperationCrud,
|
||||||
},
|
},
|
||||||
LemmyContext,
|
|
||||||
};
|
|
||||||
use lemmy_apub::protocol::activities::{
|
|
||||||
create_or_update::note::CreateOrUpdateNote,
|
|
||||||
CreateOrUpdateType,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -3,16 +3,17 @@ use activitypub_federation::core::signatures::generate_actor_keypair;
|
||||||
use actix_web::web::Data;
|
use actix_web::web::Data;
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
community::{CommunityResponse, CreateCommunity},
|
community::{CommunityResponse, CreateCommunity},
|
||||||
utils::{get_local_user_view_from_jwt, is_admin, local_site_to_slur_regex},
|
context::LemmyContext,
|
||||||
LemmyContext,
|
utils::{
|
||||||
};
|
generate_followers_url,
|
||||||
use lemmy_apub::{
|
generate_inbox_url,
|
||||||
generate_followers_url,
|
generate_local_apub_endpoint,
|
||||||
generate_inbox_url,
|
generate_shared_inbox_url,
|
||||||
generate_local_apub_endpoint,
|
get_local_user_view_from_jwt,
|
||||||
generate_shared_inbox_url,
|
is_admin,
|
||||||
objects::community::ApubCommunity,
|
local_site_to_slur_regex,
|
||||||
EndpointType,
|
EndpointType,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::community::{
|
source::community::{
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
websocket::{send::send_community_ws_message, UserOperationCrud},
|
websocket::{send::send_community_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::community::{Community, CommunityUpdateForm},
|
source::community::{Community, CommunityUpdateForm},
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
community::{ListCommunities, ListCommunitiesResponse},
|
community::{ListCommunities, ListCommunitiesResponse},
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{check_private_instance, get_local_user_view_from_jwt_opt},
|
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_schema::{source::local_site::LocalSite, traits::DeleteableOrRemoveable};
|
||||||
use lemmy_db_views_actor::community_view::CommunityQuery;
|
use lemmy_db_views_actor::community_view::CommunityQuery;
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{get_local_user_view_from_jwt, is_admin},
|
utils::{get_local_user_view_from_jwt, is_admin},
|
||||||
websocket::{send::send_community_ws_message, UserOperationCrud},
|
websocket::{send::send_community_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{get_local_user_view_from_jwt, local_site_to_slur_regex},
|
utils::{get_local_user_view_from_jwt, local_site_to_slur_regex},
|
||||||
websocket::{send::send_community_ws_message, UserOperationCrud},
|
websocket::{send::send_community_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::PersonId,
|
newtypes::PersonId,
|
||||||
|
|
|
@ -1,28 +1,6 @@
|
||||||
use actix_web::{web, web::Data};
|
use actix_web::web::Data;
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::context::LemmyContext;
|
||||||
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 lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
use serde::Deserialize;
|
|
||||||
|
|
||||||
mod comment;
|
mod comment;
|
||||||
mod community;
|
mod community;
|
||||||
|
|
|
@ -15,13 +15,6 @@ use lemmy_api_common::{
|
||||||
EndpointType,
|
EndpointType,
|
||||||
},
|
},
|
||||||
websocket::{send::send_post_ws_message, UserOperationCrud},
|
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::{
|
use lemmy_db_schema::{
|
||||||
impls::actor_language::default_post_language,
|
impls::actor_language::default_post_language,
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
post::{DeletePost, PostResponse},
|
post::{DeletePost, PostResponse},
|
||||||
utils::{check_community_ban, check_community_deleted_or_removed, get_local_user_view_from_jwt},
|
utils::{check_community_ban, check_community_deleted_or_removed, get_local_user_view_from_jwt},
|
||||||
websocket::{send::send_post_ws_message, UserOperationCrud},
|
websocket::{send::send_post_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::post::{Post, PostUpdateForm},
|
source::post::{Post, PostUpdateForm},
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
post::{GetPost, GetPostResponse},
|
post::{GetPost, GetPostResponse},
|
||||||
utils::{check_private_instance, get_local_user_view_from_jwt_opt, mark_post_as_read},
|
utils::{check_private_instance, get_local_user_view_from_jwt_opt, mark_post_as_read},
|
||||||
websocket::messages::GetPostUsersOnline,
|
websocket::messages::GetPostUsersOnline,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
aggregates::structs::{PersonPostAggregates, PersonPostAggregatesForm},
|
aggregates::structs::{PersonPostAggregates, PersonPostAggregatesForm},
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
post::{PostResponse, RemovePost},
|
post::{PostResponse, RemovePost},
|
||||||
utils::{check_community_ban, get_local_user_view_from_jwt, is_mod_or_admin},
|
utils::{check_community_ban, get_local_user_view_from_jwt, is_mod_or_admin},
|
||||||
websocket::{send::send_post_ws_message, UserOperationCrud},
|
websocket::{send::send_post_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -11,11 +11,6 @@ use lemmy_api_common::{
|
||||||
local_site_to_slur_regex,
|
local_site_to_slur_regex,
|
||||||
},
|
},
|
||||||
websocket::{send::send_post_ws_message, UserOperationCrud},
|
websocket::{send::send_post_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
|
||||||
use lemmy_apub::protocol::activities::{
|
|
||||||
create_or_update::page::CreateOrUpdatePage,
|
|
||||||
CreateOrUpdateType,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -13,15 +13,6 @@ use lemmy_api_common::{
|
||||||
EndpointType,
|
EndpointType,
|
||||||
},
|
},
|
||||||
websocket::{send::send_pm_ws_message, UserOperationCrud},
|
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::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
private_message::{DeletePrivateMessage, PrivateMessageResponse},
|
private_message::{DeletePrivateMessage, PrivateMessageResponse},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
websocket::{send::send_pm_ws_message, UserOperationCrud},
|
websocket::{send::send_pm_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::private_message::{PrivateMessage, PrivateMessageUpdateForm},
|
source::private_message::{PrivateMessage, PrivateMessageUpdateForm},
|
||||||
|
|
|
@ -4,7 +4,6 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
private_message::{GetPrivateMessages, PrivateMessagesResponse},
|
private_message::{GetPrivateMessages, PrivateMessagesResponse},
|
||||||
utils::get_local_user_view_from_jwt,
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::traits::DeleteableOrRemoveable;
|
use lemmy_db_schema::traits::DeleteableOrRemoveable;
|
||||||
use lemmy_db_views::private_message_view::PrivateMessageQuery;
|
use lemmy_db_views::private_message_view::PrivateMessageQuery;
|
||||||
|
|
|
@ -5,11 +5,6 @@ use lemmy_api_common::{
|
||||||
private_message::{EditPrivateMessage, PrivateMessageResponse},
|
private_message::{EditPrivateMessage, PrivateMessageResponse},
|
||||||
utils::{get_local_user_view_from_jwt, local_site_to_slur_regex},
|
utils::{get_local_user_view_from_jwt, local_site_to_slur_regex},
|
||||||
websocket::{send::send_pm_ws_message, UserOperationCrud},
|
websocket::{send::send_pm_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
|
||||||
use lemmy_apub::protocol::activities::{
|
|
||||||
create_or_update::chat_message::CreateOrUpdateChatMessage,
|
|
||||||
CreateOrUpdateType,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -12,7 +12,6 @@ use lemmy_api_common::{
|
||||||
local_site_to_slur_regex,
|
local_site_to_slur_regex,
|
||||||
site_description_length_check,
|
site_description_length_check,
|
||||||
},
|
},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::DbUrl,
|
newtypes::DbUrl,
|
||||||
|
|
|
@ -5,7 +5,6 @@ use lemmy_api_common::{
|
||||||
site::{GetSite, GetSiteResponse, MyUserInfo},
|
site::{GetSite, GetSiteResponse, MyUserInfo},
|
||||||
utils::{build_federated_instances, get_local_user_settings_view_from_jwt_opt},
|
utils::{build_federated_instances, get_local_user_settings_view_from_jwt_opt},
|
||||||
websocket::messages::GetUsersOnline,
|
websocket::messages::GetUsersOnline,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::{actor_language::SiteLanguage, language::Language, tagline::Tagline};
|
use lemmy_db_schema::source::{actor_language::SiteLanguage, language::Language, tagline::Tagline};
|
||||||
use lemmy_db_views::structs::{LocalUserDiscussionLanguageView, SiteView};
|
use lemmy_db_views::structs::{LocalUserDiscussionLanguageView, SiteView};
|
||||||
|
|
|
@ -11,7 +11,6 @@ use lemmy_api_common::{
|
||||||
site_description_length_check,
|
site_description_length_check,
|
||||||
},
|
},
|
||||||
websocket::{messages::SendAllMessage, UserOperationCrud},
|
websocket::{messages::SendAllMessage, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -16,7 +16,6 @@ use lemmy_api_common::{
|
||||||
EndpointType,
|
EndpointType,
|
||||||
},
|
},
|
||||||
websocket::messages::CheckCaptcha,
|
websocket::messages::CheckCaptcha,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_apub::{
|
use lemmy_apub::{
|
||||||
generate_inbox_url,
|
generate_inbox_url,
|
||||||
|
|
|
@ -4,8 +4,7 @@ use bcrypt::verify;
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{DeleteAccount, DeleteAccountResponse},
|
person::{DeleteAccount, DeleteAccountResponse},
|
||||||
utils::{delete_user_account, get_local_user_view_from_jwt},
|
utils::get_local_user_view_from_jwt,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{error::LemmyError, ConnectionId};
|
use lemmy_utils::{error::LemmyError, ConnectionId};
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ use activitystreams_kinds::{activity::BlockType, public};
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use chrono::NaiveDateTime;
|
use chrono::NaiveDateTime;
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
|
context::LemmyContext,
|
||||||
utils::{remove_user_data, remove_user_data_in_community},
|
utils::{remove_user_data, remove_user_data_in_community},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -9,9 +9,19 @@ use crate::{
|
||||||
};
|
};
|
||||||
use activitypub_federation::{core::object_id::ObjectId, traits::ApubObject};
|
use activitypub_federation::{core::object_id::ObjectId, traits::ApubObject};
|
||||||
use chrono::NaiveDateTime;
|
use chrono::NaiveDateTime;
|
||||||
use lemmy_api_common::LemmyContext;
|
use lemmy_api_common::{
|
||||||
use lemmy_db_schema::{source::site::Site, utils::DbPool};
|
community::{BanFromCommunity, BanFromCommunityResponse},
|
||||||
use lemmy_utils::error::LemmyError;
|
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 serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ use activitypub_federation::{
|
||||||
utils::verify_domains_match,
|
utils::verify_domains_match,
|
||||||
};
|
};
|
||||||
use activitystreams_kinds::{activity::UndoType, public};
|
use activitystreams_kinds::{activity::UndoType, public};
|
||||||
use lemmy_api_common::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
community::{CommunityPersonBan, CommunityPersonBanForm},
|
community::{CommunityPersonBan, CommunityPersonBanForm},
|
||||||
|
|
|
@ -23,7 +23,11 @@ use activitypub_federation::{
|
||||||
traits::{ActivityHandler, Actor},
|
traits::{ActivityHandler, Actor},
|
||||||
};
|
};
|
||||||
use activitystreams_kinds::{activity::AddType, public};
|
use activitystreams_kinds::{activity::AddType, public};
|
||||||
use lemmy_api_common::LemmyContext;
|
use lemmy_api_common::{
|
||||||
|
community::{AddModToCommunity, AddModToCommunityResponse},
|
||||||
|
context::LemmyContext,
|
||||||
|
utils::{generate_moderators_url, get_local_user_view_from_jwt},
|
||||||
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
community::{Community, CommunityModerator, CommunityModeratorForm},
|
community::{Community, CommunityModerator, CommunityModeratorForm},
|
||||||
|
|
|
@ -18,7 +18,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
use activitypub_federation::{core::object_id::ObjectId, data::Data, traits::ActivityHandler};
|
use activitypub_federation::{core::object_id::ObjectId, data::Data, traits::ActivityHandler};
|
||||||
use activitystreams_kinds::{activity::AnnounceType, public};
|
use activitystreams_kinds::{activity::AnnounceType, public};
|
||||||
use lemmy_api_common::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::{
|
||||||
protocol::activities::community::announce::AnnounceActivity,
|
protocol::activities::community::announce::AnnounceActivity,
|
||||||
};
|
};
|
||||||
use activitypub_federation::{core::object_id::ObjectId, traits::Actor};
|
use activitypub_federation::{core::object_id::ObjectId, traits::Actor};
|
||||||
use lemmy_api_common::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
use lemmy_db_schema::source::person::PersonFollower;
|
use lemmy_db_schema::source::person::PersonFollower;
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
|
@ -19,7 +19,7 @@ use activitypub_federation::{
|
||||||
traits::{ActivityHandler, Actor},
|
traits::{ActivityHandler, Actor},
|
||||||
};
|
};
|
||||||
use activitystreams_kinds::{activity::RemoveType, public};
|
use activitystreams_kinds::{activity::RemoveType, public};
|
||||||
use lemmy_api_common::LemmyContext;
|
use lemmy_api_common::{context::LemmyContext, utils::generate_moderators_url};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
community::{CommunityModerator, CommunityModeratorForm},
|
community::{CommunityModerator, CommunityModeratorForm},
|
||||||
|
|
|
@ -14,10 +14,11 @@ use activitypub_federation::{
|
||||||
};
|
};
|
||||||
use activitystreams_kinds::activity::FlagType;
|
use activitystreams_kinds::activity::FlagType;
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
comment::CommentReportResponse,
|
comment::{CommentReportResponse, CreateCommentReport},
|
||||||
post::PostReportResponse,
|
context::LemmyContext,
|
||||||
|
post::{CreatePostReport, PostReportResponse},
|
||||||
|
utils::get_local_user_view_from_jwt,
|
||||||
websocket::{messages::SendModRoomMessage, UserOperation},
|
websocket::{messages::SendModRoomMessage, UserOperation},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -19,8 +19,10 @@ use activitypub_federation::{
|
||||||
};
|
};
|
||||||
use activitystreams_kinds::{activity::UpdateType, public};
|
use activitystreams_kinds::{activity::UpdateType, public};
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
|
community::{CommunityResponse, EditCommunity, HideCommunity},
|
||||||
|
context::LemmyContext,
|
||||||
|
utils::get_local_user_view_from_jwt,
|
||||||
websocket::{send::send_community_ws_message, UserOperationCrud},
|
websocket::{send::send_community_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{source::community::Community, traits::Crud};
|
use lemmy_db_schema::{source::community::Community, traits::Crud};
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
|
|
|
@ -26,9 +26,10 @@ use activitypub_federation::{
|
||||||
};
|
};
|
||||||
use activitystreams_kinds::public;
|
use activitystreams_kinds::public;
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
|
comment::{CommentResponse, CreateComment, EditComment},
|
||||||
|
context::LemmyContext,
|
||||||
utils::check_post_deleted_or_removed,
|
utils::check_post_deleted_or_removed,
|
||||||
websocket::{send::send_comment_ws_message, UserOperationCrud},
|
websocket::{send::send_comment_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::PersonId,
|
newtypes::PersonId,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::{local_instance, objects::person::ApubPerson};
|
use crate::{local_instance, objects::person::ApubPerson};
|
||||||
use activitypub_federation::core::object_id::ObjectId;
|
use activitypub_federation::core::object_id::ObjectId;
|
||||||
use lemmy_api_common::{websocket::send::send_local_notifs, LemmyContext};
|
use lemmy_api_common::{context::LemmyContext, websocket::send::send_local_notifs};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::LocalUserId,
|
newtypes::LocalUserId,
|
||||||
source::{comment::Comment, post::Post},
|
source::{comment::Comment, post::Post},
|
||||||
|
|
|
@ -24,8 +24,10 @@ use activitypub_federation::{
|
||||||
};
|
};
|
||||||
use activitystreams_kinds::public;
|
use activitystreams_kinds::public;
|
||||||
use lemmy_api_common::{
|
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},
|
websocket::{send::send_post_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::PersonId,
|
newtypes::PersonId,
|
||||||
|
|
|
@ -15,10 +15,15 @@ use activitypub_federation::{
|
||||||
utils::verify_domains_match,
|
utils::verify_domains_match,
|
||||||
};
|
};
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
|
context::LemmyContext,
|
||||||
|
private_message::{CreatePrivateMessage, EditPrivateMessage, PrivateMessageResponse},
|
||||||
websocket::{send::send_pm_ws_message, UserOperationCrud},
|
websocket::{send::send_pm_ws_message, UserOperationCrud},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{source::person::Person, traits::Crud};
|
use lemmy_db_schema::{
|
||||||
|
newtypes::PersonId,
|
||||||
|
source::{person::Person, private_message::PrivateMessage},
|
||||||
|
traits::Crud,
|
||||||
|
};
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,11 @@ use crate::{
|
||||||
use activitypub_federation::{core::object_id::ObjectId, data::Data, traits::ActivityHandler};
|
use activitypub_federation::{core::object_id::ObjectId, data::Data, traits::ActivityHandler};
|
||||||
use activitystreams_kinds::activity::DeleteType;
|
use activitystreams_kinds::activity::DeleteType;
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
|
context::LemmyContext,
|
||||||
websocket::{
|
websocket::{
|
||||||
send::{send_comment_ws_message_simple, send_community_ws_message, send_post_ws_message},
|
send::{send_comment_ws_message_simple, send_community_ws_message, send_post_ws_message},
|
||||||
UserOperationCrud,
|
UserOperationCrud,
|
||||||
},
|
},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
|
@ -12,7 +12,11 @@ use activitypub_federation::{
|
||||||
utils::verify_urls_match,
|
utils::verify_urls_match,
|
||||||
};
|
};
|
||||||
use activitystreams_kinds::{activity::DeleteType, public};
|
use activitystreams_kinds::{activity::DeleteType, public};
|
||||||
use lemmy_api_common::{utils::delete_user_account, LemmyContext};
|
use lemmy_api_common::{
|
||||||
|
context::LemmyContext,
|
||||||
|
person::{DeleteAccount, DeleteAccountResponse},
|
||||||
|
utils::{delete_user_account, get_local_user_view_from_jwt},
|
||||||
|
};
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,12 @@ use activitypub_federation::{
|
||||||
};
|
};
|
||||||
use activitystreams_kinds::public;
|
use activitystreams_kinds::public;
|
||||||
use lemmy_api_common::{
|
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::{
|
websocket::{
|
||||||
send::{
|
send::{
|
||||||
send_comment_ws_message_simple,
|
send_comment_ws_message_simple,
|
||||||
|
@ -39,7 +45,6 @@ use lemmy_api_common::{
|
||||||
},
|
},
|
||||||
UserOperationCrud,
|
UserOperationCrud,
|
||||||
},
|
},
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
source::{
|
source::{
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue