LemmyContext,
};
use actix_web::web::Data;
-use lemmy_structs::{
- blocking,
- comment::*,
- send_local_notifs,
- websocket::{SendComment, UserOperation},
-};
use lemmy_db::{
comment::*,
comment_view::*,
Saveable,
SortType,
};
+use lemmy_structs::{
+ blocking,
+ comment::*,
+ send_local_notifs,
+ websocket::{SendComment, UserOperation},
+};
use lemmy_utils::{
apub::{make_apub_endpoint, EndpointType},
utils::{remove_slurs, scrape_text_for_mentions},
};
use actix_web::web::Data;
use anyhow::Context;
-use lemmy_structs::{
- blocking,
- community::*,
- websocket::{
- GetCommunityUsersOnline,
- JoinCommunityRoom,
- SendCommunityRoomMessage,
- UserOperation,
- },
-};
use lemmy_db::{
comment::Comment,
comment_view::CommentQueryBuilder,
Joinable,
SortType,
};
+use lemmy_structs::{
+ blocking,
+ community::*,
+ websocket::{
+ GetCommunityUsersOnline,
+ JoinCommunityRoom,
+ SendCommunityRoomMessage,
+ UserOperation,
+ },
+};
use lemmy_utils::{
apub::{generate_actor_keypair, make_apub_endpoint, EndpointType},
location_info,
use crate::{api::claims::Claims, DbPool, LemmyContext};
use actix_web::web::Data;
-use lemmy_structs::blocking;
use lemmy_db::{
community::Community,
community_view::CommunityUserBanView,
user::User_,
Crud,
};
+use lemmy_structs::blocking;
use lemmy_utils::{APIError, ConnectionId, LemmyError};
pub mod claims;
LemmyContext,
};
use actix_web::web::Data;
-use lemmy_structs::{
- blocking,
- post::*,
- websocket::{GetPostUsersOnline, JoinPostRoom, SendPost, UserOperation},
-};
use lemmy_db::{
comment_view::*,
community_view::*,
Saveable,
SortType,
};
+use lemmy_structs::{
+ blocking,
+ post::*,
+ websocket::{GetPostUsersOnline, JoinPostRoom, SendPost, UserOperation},
+};
use lemmy_utils::{
apub::{make_apub_endpoint, EndpointType},
utils::{check_slurs, check_slurs_opt, is_valid_post_title},
};
use actix_web::web::Data;
use anyhow::Context;
-use lemmy_structs::{
- blocking,
- site::*,
- user::Register,
- websocket::{GetUsersOnline, SendAllMessage, UserOperation},
-};
use lemmy_db::{
category::*,
comment_view::*,
SearchType,
SortType,
};
+use lemmy_structs::{
+ blocking,
+ site::*,
+ user::Register,
+ websocket::{GetUsersOnline, SendAllMessage, UserOperation},
+};
use lemmy_utils::{
location_info,
settings::Settings,
use bcrypt::verify;
use captcha::{gen, Difficulty};
use chrono::Duration;
-use lemmy_structs::{
- blocking,
- user::*,
- websocket::{
- CaptchaItem,
- CheckCaptcha,
- JoinUserRoom,
- SendAllMessage,
- SendUserRoomMessage,
- UserOperation,
- },
-};
use lemmy_db::{
comment::*,
comment_view::*,
ListingType,
SortType,
};
+use lemmy_structs::{
+ blocking,
+ user::*,
+ websocket::{
+ CaptchaItem,
+ CheckCaptcha,
+ JoinUserRoom,
+ SendAllMessage,
+ SendUserRoomMessage,
+ UserOperation,
+ },
+};
use lemmy_utils::{
apub::{generate_actor_keypair, make_apub_endpoint, EndpointType},
email::send_email,
use actix_web::{body::Body, web, web::Path, HttpResponse};
use anyhow::Context;
use itertools::Itertools;
-use lemmy_structs::blocking;
use lemmy_db::{
comment::{Comment, CommentForm},
community::Community,
user::User_,
Crud,
};
+use lemmy_structs::blocking;
use lemmy_utils::{
location_info,
utils::{convert_datetime, remove_slurs, scrape_text_for_mentions, MentionData},
use actix_web::{body::Body, web, HttpResponse};
use anyhow::Context;
use itertools::Itertools;
-use lemmy_structs::blocking;
use lemmy_db::{
community::{Community, CommunityForm},
community_view::{CommunityFollowerView, CommunityModeratorView},
post::Post,
user::User_,
};
+use lemmy_structs::blocking;
use lemmy_utils::{
apub::get_apub_protocol_string,
location_info,
use anyhow::{anyhow, Context};
use chrono::NaiveDateTime;
use diesel::result::Error::NotFound;
-use lemmy_structs::{blocking, site::SearchResponse};
use lemmy_db::{
comment::{Comment, CommentForm},
comment_view::CommentView,
Joinable,
SearchType,
};
+use lemmy_structs::{blocking, site::SearchResponse};
use lemmy_utils::{apub::get_apub_protocol_string, location_info, LemmyError};
use log::debug;
use reqwest::Client;
use activitystreams::{activity::Create, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::Context;
+use lemmy_db::{
+ comment::{Comment, CommentForm},
+ comment_view::CommentView,
+ post::{Post, PostForm},
+ post_view::PostView,
+};
use lemmy_structs::{
blocking,
comment::CommentResponse,
send_local_notifs,
websocket::{SendComment, SendPost, UserOperation},
};
-use lemmy_db::{
- comment::{Comment, CommentForm},
- comment_view::CommentView,
- post::{Post, PostForm},
- post_view::PostView,
-};
use lemmy_utils::{location_info, utils::scrape_text_for_mentions, LemmyError};
pub async fn receive_create(
use activitystreams::{activity::Delete, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::Context;
-use lemmy_structs::{
- blocking,
- comment::CommentResponse,
- community::CommunityResponse,
- post::PostResponse,
- websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
-};
use lemmy_db::{
comment::{Comment, CommentForm},
comment_view::CommentView,
post_view::PostView,
Crud,
};
+use lemmy_structs::{
+ blocking,
+ comment::CommentResponse,
+ community::CommunityResponse,
+ post::PostResponse,
+ websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
+};
use lemmy_utils::{location_info, LemmyError};
pub async fn receive_delete(
use activitystreams::{activity::Dislike, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::Context;
-use lemmy_structs::{
- blocking,
- comment::CommentResponse,
- post::PostResponse,
- websocket::{SendComment, SendPost, UserOperation},
-};
use lemmy_db::{
comment::{CommentForm, CommentLike, CommentLikeForm},
comment_view::CommentView,
post_view::PostView,
Likeable,
};
+use lemmy_structs::{
+ blocking,
+ comment::CommentResponse,
+ post::PostResponse,
+ websocket::{SendComment, SendPost, UserOperation},
+};
use lemmy_utils::{location_info, LemmyError};
pub async fn receive_dislike(
use activitystreams::{activity::Like, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::Context;
-use lemmy_structs::{
- blocking,
- comment::CommentResponse,
- post::PostResponse,
- websocket::{SendComment, SendPost, UserOperation},
-};
use lemmy_db::{
comment::{CommentForm, CommentLike, CommentLikeForm},
comment_view::CommentView,
post_view::PostView,
Likeable,
};
+use lemmy_structs::{
+ blocking,
+ comment::CommentResponse,
+ post::PostResponse,
+ websocket::{SendComment, SendPost, UserOperation},
+};
use lemmy_utils::{location_info, LemmyError};
pub async fn receive_like(
use activitystreams::{activity::Remove, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::{anyhow, Context};
-use lemmy_structs::{
- blocking,
- comment::CommentResponse,
- community::CommunityResponse,
- post::PostResponse,
- websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
-};
use lemmy_db::{
comment::{Comment, CommentForm},
comment_view::CommentView,
post_view::PostView,
Crud,
};
+use lemmy_structs::{
+ blocking,
+ comment::CommentResponse,
+ community::CommunityResponse,
+ post::PostResponse,
+ websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
+};
use lemmy_utils::{location_info, LemmyError};
pub async fn receive_remove(
};
use actix_web::HttpResponse;
use anyhow::{anyhow, Context};
-use lemmy_structs::{
- blocking,
- comment::CommentResponse,
- community::CommunityResponse,
- post::PostResponse,
- websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
-};
use lemmy_db::{
comment::{Comment, CommentForm, CommentLike},
comment_view::CommentView,
Crud,
Likeable,
};
+use lemmy_structs::{
+ blocking,
+ comment::CommentResponse,
+ community::CommunityResponse,
+ post::PostResponse,
+ websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
+};
use lemmy_utils::{location_info, LemmyError};
pub async fn receive_undo(
use activitystreams::{activity::Update, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::Context;
-use lemmy_structs::{
- blocking,
- comment::CommentResponse,
- post::PostResponse,
- send_local_notifs,
- websocket::{SendComment, SendPost, UserOperation},
-};
use lemmy_db::{
comment::{Comment, CommentForm},
comment_view::CommentView,
post_view::PostView,
Crud,
};
+use lemmy_structs::{
+ blocking,
+ comment::CommentResponse,
+ post::PostResponse,
+ send_local_notifs,
+ websocket::{SendComment, SendPost, UserOperation},
+};
use lemmy_utils::{location_info, utils::scrape_text_for_mentions, LemmyError};
pub async fn receive_update(
};
use actix_web::{web, HttpRequest, HttpResponse};
use anyhow::{anyhow, Context};
-use lemmy_structs::blocking;
use lemmy_db::{
community::{Community, CommunityFollower, CommunityFollowerForm},
user::User_,
Followable,
};
+use lemmy_structs::blocking;
use lemmy_utils::{location_info, LemmyError};
use log::debug;
use serde::{Deserialize, Serialize};
};
use actix_web::{web, HttpRequest, HttpResponse};
use anyhow::Context;
-use lemmy_structs::{
- blocking,
- user::PrivateMessageResponse,
- websocket::{SendUserRoomMessage, UserOperation},
-};
use lemmy_db::{
community::{CommunityFollower, CommunityFollowerForm},
naive_now,
Crud,
Followable,
};
+use lemmy_structs::{
+ blocking,
+ user::PrivateMessageResponse,
+ websocket::{SendUserRoomMessage, UserOperation},
+};
use lemmy_utils::{location_info, LemmyError};
use log::debug;
use serde::{Deserialize, Serialize};
use actix_web::{body::Body, HttpResponse};
use anyhow::{anyhow, Context};
use chrono::NaiveDateTime;
-use lemmy_structs::blocking;
use lemmy_db::{activity::do_insert_activity, user::User_};
+use lemmy_structs::blocking;
use lemmy_utils::{
apub::get_apub_protocol_string,
location_info,
use activitystreams_ext::Ext1;
use actix_web::{body::Body, web, HttpResponse};
use anyhow::Context;
-use lemmy_structs::blocking;
use lemmy_db::{
community::Community,
post::{Post, PostForm},
user::User_,
Crud,
};
+use lemmy_structs::blocking;
use lemmy_utils::{
location_info,
utils::{check_slurs, convert_datetime, remove_slurs},
prelude::*,
};
use anyhow::Context;
-use lemmy_structs::blocking;
use lemmy_db::{
private_message::{PrivateMessage, PrivateMessageForm},
user::User_,
Crud,
};
+use lemmy_structs::blocking;
use lemmy_utils::{location_info, utils::convert_datetime, LemmyError};
use url::Url;
use activitystreams_ext::Ext1;
use actix_web::{body::Body, web, HttpResponse};
use anyhow::Context;
-use lemmy_structs::blocking;
use lemmy_db::{
naive_now,
user::{UserForm, User_},
};
+use lemmy_structs::blocking;
use lemmy_utils::{
location_info,
utils::{check_slurs, check_slurs_opt, convert_datetime},
PgConnection,
};
use lazy_static::lazy_static;
-use lemmy_structs::blocking;
use lemmy_db::get_database_url_from_env;
use lemmy_rate_limit::{rate_limiter::RateLimiter, RateLimit};
use lemmy_server::{
websocket::chat_server::ChatServer,
LemmyContext,
};
+use lemmy_structs::blocking;
use lemmy_utils::{settings::Settings, LemmyError, CACHE_CONTROL_REGEX};
use reqwest::Client;
use std::sync::Arc;
use crate::{api::Perform, LemmyContext};
use actix_web::{error::ErrorBadRequest, *};
-use lemmy_structs::{comment::*, community::*, post::*, site::*, user::*};
use lemmy_rate_limit::RateLimit;
+use lemmy_structs::{comment::*, community::*, post::*, site::*, user::*};
use serde::Deserialize;
pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimit) {
use anyhow::anyhow;
use chrono::{DateTime, NaiveDateTime, Utc};
use diesel::PgConnection;
-use lemmy_structs::blocking;
use lemmy_db::{
comment_view::{ReplyQueryBuilder, ReplyView},
community::Community,
ListingType,
SortType,
};
+use lemmy_structs::blocking;
use lemmy_utils::{settings::Settings, utils::markdown_to_html, LemmyError};
use rss::{CategoryBuilder, ChannelBuilder, GuidBuilder, Item, ItemBuilder};
use serde::Deserialize;
use crate::{version, LemmyContext};
use actix_web::{body::Body, error::ErrorBadRequest, *};
use anyhow::anyhow;
-use lemmy_structs::blocking;
use lemmy_db::site_view::SiteView;
+use lemmy_structs::blocking;
use lemmy_utils::{apub::get_apub_protocol_string, settings::Settings, LemmyError};
use serde::{Deserialize, Serialize};
use url::Url;
use crate::LemmyContext;
use actix_web::{error::ErrorBadRequest, web::Query, *};
use anyhow::anyhow;
-use lemmy_structs::blocking;
use lemmy_db::{community::Community, user::User_};
+use lemmy_structs::blocking;
use lemmy_utils::{
settings::Settings,
LemmyError,
r2d2::{ConnectionManager, Pool},
PgConnection,
};
-use lemmy_structs::{comment::*, community::*, post::*, site::*, user::*, websocket::*};
use lemmy_rate_limit::RateLimit;
+use lemmy_structs::{comment::*, community::*, post::*, site::*, user::*, websocket::*};
use lemmy_utils::{
location_info,
APIError,
};
use actix::{Actor, Context, Handler, ResponseFuture};
use actix_web::web;
-use lemmy_structs::websocket::*;
use lemmy_db::naive_now;
use lemmy_rate_limit::RateLimit;
+use lemmy_structs::websocket::*;
use lemmy_utils::{ConnectionId, IPAddr, LemmyError};
use log::{error, info};
use rand::Rng;