mirror of https://github.com/LemmyNet/lemmy.git
Running cargo fmt using old way.
parent
413de6286c
commit
3136df3334
|
@ -1,5 +1,5 @@
|
||||||
tab_spaces = 2
|
tab_spaces = 2
|
||||||
edition="2018"
|
edition="2018"
|
||||||
imports_layout="HorizontalVertical"
|
# imports_layout="HorizontalVertical"
|
||||||
merge_imports=true
|
# merge_imports=true
|
||||||
reorder_imports=true
|
reorder_imports=true
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
category::*,
|
category::*, comment_view::*, community_view::*, moderator_views::*, post_view::*, site_view::*,
|
||||||
comment_view::*,
|
user::*, user_view::*,
|
||||||
community_view::*,
|
|
||||||
moderator_views::*,
|
|
||||||
post_view::*,
|
|
||||||
site_view::*,
|
|
||||||
user::*,
|
|
||||||
user_view::*,
|
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::{schema::activity, Crud};
|
use crate::{schema::activity, Crud};
|
||||||
use diesel::{dsl::*, result::Error, *};
|
use diesel::{dsl::*, result::Error, *};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use serde::{Serialize};
|
use serde::Serialize;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use std::{
|
use std::{
|
||||||
fmt::Debug,
|
fmt::Debug,
|
||||||
|
@ -85,9 +85,7 @@ mod tests {
|
||||||
activity::{Activity, ActivityForm},
|
activity::{Activity, ActivityForm},
|
||||||
tests::establish_unpooled_connection,
|
tests::establish_unpooled_connection,
|
||||||
user::{UserForm, User_},
|
user::{UserForm, User_},
|
||||||
Crud,
|
Crud, ListingType, SortType,
|
||||||
ListingType,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ use crate::{
|
||||||
Crud,
|
Crud,
|
||||||
};
|
};
|
||||||
use diesel::{dsl::*, result::Error, *};
|
use diesel::{dsl::*, result::Error, *};
|
||||||
use serde::{Serialize};
|
use serde::Serialize;
|
||||||
|
|
||||||
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
||||||
#[table_name = "category"]
|
#[table_name = "category"]
|
||||||
|
|
|
@ -2,9 +2,7 @@ use super::post::Post;
|
||||||
use crate::{
|
use crate::{
|
||||||
naive_now,
|
naive_now,
|
||||||
schema::{comment, comment_like, comment_saved},
|
schema::{comment, comment_like, comment_saved},
|
||||||
Crud,
|
Crud, Likeable, Saveable,
|
||||||
Likeable,
|
|
||||||
Saveable,
|
|
||||||
};
|
};
|
||||||
use diesel::{dsl::*, result::Error, *};
|
use diesel::{dsl::*, result::Error, *};
|
||||||
use url::{ParseError, Url};
|
use url::{ParseError, Url};
|
||||||
|
@ -257,14 +255,8 @@ impl Saveable<CommentSavedForm> for CommentSaved {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
comment::*,
|
comment::*, community::*, post::*, tests::establish_unpooled_connection, user::*, Crud,
|
||||||
community::*,
|
ListingType, SortType,
|
||||||
post::*,
|
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::*,
|
|
||||||
Crud,
|
|
||||||
ListingType,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -84,9 +84,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "comment_fast_view"]
|
#[table_name = "comment_fast_view"]
|
||||||
pub struct CommentView {
|
pub struct CommentView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -497,15 +495,8 @@ impl<'a> ReplyQueryBuilder<'a> {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
comment::*,
|
comment::*, comment_view::*, community::*, post::*, tests::establish_unpooled_connection,
|
||||||
comment_view::*,
|
user::*, Crud, Likeable, *,
|
||||||
community::*,
|
|
||||||
post::*,
|
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::*,
|
|
||||||
Crud,
|
|
||||||
Likeable,
|
|
||||||
*,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
naive_now,
|
naive_now,
|
||||||
schema::{community, community_follower, community_moderator, community_user_ban},
|
schema::{community, community_follower, community_moderator, community_user_ban},
|
||||||
Bannable,
|
Bannable, Crud, Followable, Joinable,
|
||||||
Crud,
|
|
||||||
Followable,
|
|
||||||
Joinable,
|
|
||||||
};
|
};
|
||||||
use diesel::{dsl::*, result::Error, *};
|
use diesel::{dsl::*, result::Error, *};
|
||||||
|
|
||||||
|
|
|
@ -123,9 +123,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "community_fast_view"]
|
#[table_name = "community_fast_view"]
|
||||||
pub struct CommunityView {
|
pub struct CommunityView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
schema::{
|
schema::{
|
||||||
mod_add,
|
mod_add, mod_add_community, mod_ban, mod_ban_from_community, mod_lock_post, mod_remove_comment,
|
||||||
mod_add_community,
|
mod_remove_community, mod_remove_post, mod_sticky_post,
|
||||||
mod_ban,
|
|
||||||
mod_ban_from_community,
|
|
||||||
mod_lock_post,
|
|
||||||
mod_remove_comment,
|
|
||||||
mod_remove_community,
|
|
||||||
mod_remove_post,
|
|
||||||
mod_sticky_post,
|
|
||||||
},
|
},
|
||||||
Crud,
|
Crud,
|
||||||
};
|
};
|
||||||
|
@ -392,14 +385,8 @@ impl Crud<ModAddForm> for ModAdd {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
comment::*,
|
comment::*, community::*, moderator::*, post::*, tests::establish_unpooled_connection, user::*,
|
||||||
community::*,
|
ListingType, SortType,
|
||||||
moderator::*,
|
|
||||||
post::*,
|
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::*,
|
|
||||||
ListingType,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// use Crud;
|
// use Crud;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::limit_and_offset;
|
use crate::limit_and_offset;
|
||||||
use diesel::{result::Error, *};
|
use diesel::{result::Error, *};
|
||||||
use serde::{Serialize};
|
use serde::Serialize;
|
||||||
|
|
||||||
table! {
|
table! {
|
||||||
mod_remove_post_view (id) {
|
mod_remove_post_view (id) {
|
||||||
|
@ -17,9 +17,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "mod_remove_post_view"]
|
#[table_name = "mod_remove_post_view"]
|
||||||
pub struct ModRemovePostView {
|
pub struct ModRemovePostView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -77,9 +75,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "mod_lock_post_view"]
|
#[table_name = "mod_lock_post_view"]
|
||||||
pub struct ModLockPostView {
|
pub struct ModLockPostView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -136,9 +132,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "mod_sticky_post_view"]
|
#[table_name = "mod_sticky_post_view"]
|
||||||
pub struct ModStickyPostView {
|
pub struct ModStickyPostView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -200,9 +194,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "mod_remove_comment_view"]
|
#[table_name = "mod_remove_comment_view"]
|
||||||
pub struct ModRemoveCommentView {
|
pub struct ModRemoveCommentView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -264,9 +256,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "mod_remove_community_view"]
|
#[table_name = "mod_remove_community_view"]
|
||||||
pub struct ModRemoveCommunityView {
|
pub struct ModRemoveCommunityView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -320,9 +310,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "mod_ban_from_community_view"]
|
#[table_name = "mod_ban_from_community_view"]
|
||||||
pub struct ModBanFromCommunityView {
|
pub struct ModBanFromCommunityView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -381,9 +369,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "mod_ban_view"]
|
#[table_name = "mod_ban_view"]
|
||||||
pub struct ModBanView {
|
pub struct ModBanView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -435,9 +421,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "mod_add_community_view"]
|
#[table_name = "mod_add_community_view"]
|
||||||
pub struct ModAddCommunityView {
|
pub struct ModAddCommunityView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -492,9 +476,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "mod_add_view"]
|
#[table_name = "mod_add_view"]
|
||||||
pub struct ModAddView {
|
pub struct ModAddView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -80,11 +80,8 @@ impl PasswordResetRequest {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::super::user::*;
|
use super::super::user::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
password_reset_request::PasswordResetRequest,
|
password_reset_request::PasswordResetRequest, tests::establish_unpooled_connection, Crud,
|
||||||
tests::establish_unpooled_connection,
|
ListingType, SortType,
|
||||||
Crud,
|
|
||||||
ListingType,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
naive_now,
|
naive_now,
|
||||||
schema::{post, post_like, post_read, post_saved},
|
schema::{post, post_like, post_read, post_saved},
|
||||||
Crud,
|
Crud, Likeable, Readable, Saveable,
|
||||||
Likeable,
|
|
||||||
Readable,
|
|
||||||
Saveable,
|
|
||||||
};
|
};
|
||||||
use diesel::{dsl::*, result::Error, *};
|
use diesel::{dsl::*, result::Error, *};
|
||||||
use url::{ParseError, Url};
|
use url::{ParseError, Url};
|
||||||
|
@ -328,12 +325,7 @@ impl Readable<PostReadForm> for PostRead {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
community::*,
|
community::*, post::*, tests::establish_unpooled_connection, user::*, ListingType, SortType,
|
||||||
post::*,
|
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::*,
|
|
||||||
ListingType,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -106,9 +106,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "post_fast_view"]
|
#[table_name = "post_fast_view"]
|
||||||
pub struct PostView {
|
pub struct PostView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
@ -389,14 +387,8 @@ impl PostView {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
community::*,
|
community::*, post::*, post_view::*, tests::establish_unpooled_connection, user::*, Crud,
|
||||||
post::*,
|
Likeable, *,
|
||||||
post_view::*,
|
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::*,
|
|
||||||
Crud,
|
|
||||||
Likeable,
|
|
||||||
*,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -137,11 +137,7 @@ impl PrivateMessage {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
private_message::*,
|
private_message::*, tests::establish_unpooled_connection, user::*, ListingType, SortType,
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::*,
|
|
||||||
ListingType,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::{limit_and_offset, MaybeOptional};
|
use crate::{limit_and_offset, MaybeOptional};
|
||||||
use diesel::{pg::Pg, result::Error, *};
|
use diesel::{pg::Pg, result::Error, *};
|
||||||
use serde::{Serialize};
|
use serde::Serialize;
|
||||||
|
|
||||||
// The faked schema since diesel doesn't do views
|
// The faked schema since diesel doesn't do views
|
||||||
table! {
|
table! {
|
||||||
|
@ -28,9 +28,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "private_message_view"]
|
#[table_name = "private_message_view"]
|
||||||
pub struct PrivateMessageView {
|
pub struct PrivateMessageView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use diesel::{result::Error, *};
|
use diesel::{result::Error, *};
|
||||||
use serde::{Serialize};
|
use serde::Serialize;
|
||||||
|
|
||||||
table! {
|
table! {
|
||||||
site_view (id) {
|
site_view (id) {
|
||||||
|
@ -24,9 +24,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "site_view"]
|
#[table_name = "site_view"]
|
||||||
pub struct SiteView {
|
pub struct SiteView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
is_email_regex,
|
is_email_regex, naive_now,
|
||||||
naive_now,
|
|
||||||
schema::{user_, user_::dsl::*},
|
schema::{user_, user_::dsl::*},
|
||||||
Crud,
|
Crud,
|
||||||
};
|
};
|
||||||
use bcrypt::{hash, DEFAULT_COST};
|
use bcrypt::{hash, DEFAULT_COST};
|
||||||
use diesel::{dsl::*, result::Error, *};
|
use diesel::{dsl::*, result::Error, *};
|
||||||
use serde::{Serialize};
|
use serde::Serialize;
|
||||||
|
|
||||||
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
|
||||||
#[table_name = "user_"]
|
#[table_name = "user_"]
|
||||||
|
|
|
@ -73,14 +73,8 @@ impl UserMention {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
comment::*,
|
comment::*, community::*, post::*, tests::establish_unpooled_connection, user::*,
|
||||||
community::*,
|
user_mention::*, ListingType, SortType,
|
||||||
post::*,
|
|
||||||
tests::establish_unpooled_connection,
|
|
||||||
user::*,
|
|
||||||
user_mention::*,
|
|
||||||
ListingType,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::{limit_and_offset, MaybeOptional, SortType};
|
use crate::{limit_and_offset, MaybeOptional, SortType};
|
||||||
use diesel::{dsl::*, pg::Pg, result::Error, *};
|
use diesel::{dsl::*, pg::Pg, result::Error, *};
|
||||||
use serde::{Serialize};
|
use serde::Serialize;
|
||||||
|
|
||||||
// The faked schema since diesel doesn't do views
|
// The faked schema since diesel doesn't do views
|
||||||
table! {
|
table! {
|
||||||
|
@ -83,9 +83,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "user_mention_fast_view"]
|
#[table_name = "user_mention_fast_view"]
|
||||||
pub struct UserMentionView {
|
pub struct UserMentionView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use super::user_view::user_fast::BoxedQuery;
|
use super::user_view::user_fast::BoxedQuery;
|
||||||
use crate::{fuzzy_search, limit_and_offset, MaybeOptional, SortType};
|
use crate::{fuzzy_search, limit_and_offset, MaybeOptional, SortType};
|
||||||
use diesel::{dsl::*, pg::Pg, result::Error, *};
|
use diesel::{dsl::*, pg::Pg, result::Error, *};
|
||||||
use serde::{Serialize};
|
use serde::Serialize;
|
||||||
|
|
||||||
table! {
|
table! {
|
||||||
user_view (id) {
|
user_view (id) {
|
||||||
|
@ -51,9 +51,7 @@ table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone)]
|
||||||
Queryable, Identifiable, PartialEq, Debug, Serialize, QueryableByName, Clone,
|
|
||||||
)]
|
|
||||||
#[table_name = "user_fast"]
|
#[table_name = "user_fast"]
|
||||||
pub struct UserView {
|
pub struct UserView {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|
|
@ -24,9 +24,7 @@ use lettre::{
|
||||||
extension::ClientId,
|
extension::ClientId,
|
||||||
ConnectionReuseParameters,
|
ConnectionReuseParameters,
|
||||||
},
|
},
|
||||||
ClientSecurity,
|
ClientSecurity, SmtpClient, Transport,
|
||||||
SmtpClient,
|
|
||||||
Transport,
|
|
||||||
};
|
};
|
||||||
use lettre_email::Email;
|
use lettre_email::Email;
|
||||||
use openssl::{pkey::PKey, rsa::Rsa};
|
use openssl::{pkey::PKey, rsa::Rsa};
|
||||||
|
@ -223,14 +221,8 @@ pub fn is_valid_post_title(title: &str) -> bool {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
is_valid_community_name,
|
is_valid_community_name, is_valid_post_title, is_valid_preferred_username, is_valid_username,
|
||||||
is_valid_post_title,
|
remove_slurs, scrape_text_for_mentions, slur_check, slurs_vec_to_str,
|
||||||
is_valid_preferred_username,
|
|
||||||
is_valid_username,
|
|
||||||
remove_slurs,
|
|
||||||
scrape_text_for_mentions,
|
|
||||||
slur_check,
|
|
||||||
slurs_vec_to_str,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
api::{
|
api::{
|
||||||
check_community_ban,
|
check_community_ban, get_post, get_user_from_jwt, get_user_from_jwt_opt, is_mod_or_admin,
|
||||||
get_post,
|
|
||||||
get_user_from_jwt,
|
|
||||||
get_user_from_jwt_opt,
|
|
||||||
is_mod_or_admin,
|
|
||||||
Perform,
|
Perform,
|
||||||
},
|
},
|
||||||
apub::{ApubLikeableType, ApubObjectType},
|
apub::{ApubLikeableType, ApubObjectType},
|
||||||
|
@ -13,36 +9,17 @@ use crate::{
|
||||||
messages::{JoinCommunityRoom, SendComment},
|
messages::{JoinCommunityRoom, SendComment},
|
||||||
UserOperation,
|
UserOperation,
|
||||||
},
|
},
|
||||||
DbPool,
|
DbPool, LemmyContext,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use actix_web::web::Data;
|
use actix_web::web::Data;
|
||||||
use lemmy_api_structs::comment::*;
|
use lemmy_api_structs::comment::*;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::*,
|
comment::*, comment_view::*, moderator::*, post::*, site_view::*, user::*, user_mention::*, Crud,
|
||||||
comment_view::*,
|
Likeable, ListingType, Saveable, SortType,
|
||||||
moderator::*,
|
|
||||||
post::*,
|
|
||||||
site_view::*,
|
|
||||||
user::*,
|
|
||||||
user_mention::*,
|
|
||||||
Crud,
|
|
||||||
Likeable,
|
|
||||||
ListingType,
|
|
||||||
Saveable,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
make_apub_endpoint,
|
make_apub_endpoint, remove_slurs, scrape_text_for_mentions, send_email, settings::Settings,
|
||||||
remove_slurs,
|
APIError, ConnectionId, EndpointType, LemmyError, MentionData,
|
||||||
scrape_text_for_mentions,
|
|
||||||
send_email,
|
|
||||||
settings::Settings,
|
|
||||||
APIError,
|
|
||||||
ConnectionId,
|
|
||||||
EndpointType,
|
|
||||||
LemmyError,
|
|
||||||
MentionData,
|
|
||||||
};
|
};
|
||||||
use log::error;
|
use log::error;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
api::{
|
api::{
|
||||||
check_slurs,
|
check_slurs, check_slurs_opt, get_user_from_jwt, get_user_from_jwt_opt, is_admin,
|
||||||
check_slurs_opt,
|
is_mod_or_admin, Perform,
|
||||||
get_user_from_jwt,
|
|
||||||
get_user_from_jwt_opt,
|
|
||||||
is_admin,
|
|
||||||
is_mod_or_admin,
|
|
||||||
Perform,
|
|
||||||
},
|
},
|
||||||
apub::ActorType,
|
apub::ActorType,
|
||||||
blocking,
|
blocking,
|
||||||
|
@ -20,32 +15,13 @@ use actix_web::web::Data;
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use lemmy_api_structs::community::*;
|
use lemmy_api_structs::community::*;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::Comment,
|
comment::Comment, comment_view::CommentQueryBuilder, community::*, community_view::*,
|
||||||
comment_view::CommentQueryBuilder,
|
diesel_option_overwrite, moderator::*, naive_now, post::Post, site::*, user_view::*, Bannable,
|
||||||
community::*,
|
Crud, Followable, Joinable, SortType,
|
||||||
community_view::*,
|
|
||||||
diesel_option_overwrite,
|
|
||||||
moderator::*,
|
|
||||||
naive_now,
|
|
||||||
post::Post,
|
|
||||||
site::*,
|
|
||||||
user_view::*,
|
|
||||||
Bannable,
|
|
||||||
Crud,
|
|
||||||
Followable,
|
|
||||||
Joinable,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
generate_actor_keypair,
|
generate_actor_keypair, is_valid_community_name, location_info, make_apub_endpoint,
|
||||||
is_valid_community_name,
|
naive_from_unix, APIError, ConnectionId, EndpointType, LemmyError,
|
||||||
location_info,
|
|
||||||
make_apub_endpoint,
|
|
||||||
naive_from_unix,
|
|
||||||
APIError,
|
|
||||||
ConnectionId,
|
|
||||||
EndpointType,
|
|
||||||
LemmyError,
|
|
||||||
};
|
};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
use crate::{api::claims::Claims, blocking, DbPool, LemmyContext};
|
use crate::{api::claims::Claims, blocking, DbPool, LemmyContext};
|
||||||
use actix_web::web::Data;
|
use actix_web::web::Data;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
community::Community,
|
community::Community, community_view::CommunityUserBanView, post::Post, user::User_, Crud,
|
||||||
community_view::CommunityUserBanView,
|
|
||||||
post::Post,
|
|
||||||
user::User_,
|
|
||||||
Crud,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{slur_check, slurs_vec_to_str, APIError, ConnectionId, LemmyError};
|
use lemmy_utils::{slur_check, slurs_vec_to_str, APIError, ConnectionId, LemmyError};
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,10 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
api::{
|
api::{
|
||||||
check_community_ban,
|
check_community_ban, check_slurs, check_slurs_opt, get_user_from_jwt, get_user_from_jwt_opt,
|
||||||
check_slurs,
|
is_mod_or_admin, Perform,
|
||||||
check_slurs_opt,
|
|
||||||
get_user_from_jwt,
|
|
||||||
get_user_from_jwt_opt,
|
|
||||||
is_mod_or_admin,
|
|
||||||
Perform,
|
|
||||||
},
|
},
|
||||||
apub::{ApubLikeableType, ApubObjectType},
|
apub::{ApubLikeableType, ApubObjectType},
|
||||||
blocking,
|
blocking, fetch_iframely_and_pictrs_data,
|
||||||
fetch_iframely_and_pictrs_data,
|
|
||||||
websocket::{
|
websocket::{
|
||||||
messages::{GetPostUsersOnline, JoinCommunityRoom, JoinPostRoom, SendPost},
|
messages::{GetPostUsersOnline, JoinCommunityRoom, JoinPostRoom, SendPost},
|
||||||
UserOperation,
|
UserOperation,
|
||||||
|
@ -20,26 +14,11 @@ use crate::{
|
||||||
use actix_web::web::Data;
|
use actix_web::web::Data;
|
||||||
use lemmy_api_structs::post::*;
|
use lemmy_api_structs::post::*;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment_view::*,
|
comment_view::*, community_view::*, moderator::*, naive_now, post::*, post_view::*, site_view::*,
|
||||||
community_view::*,
|
Crud, Likeable, ListingType, Saveable, SortType,
|
||||||
moderator::*,
|
|
||||||
naive_now,
|
|
||||||
post::*,
|
|
||||||
post_view::*,
|
|
||||||
site_view::*,
|
|
||||||
Crud,
|
|
||||||
Likeable,
|
|
||||||
ListingType,
|
|
||||||
Saveable,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
is_valid_post_title,
|
is_valid_post_title, make_apub_endpoint, APIError, ConnectionId, EndpointType, LemmyError,
|
||||||
make_apub_endpoint,
|
|
||||||
APIError,
|
|
||||||
ConnectionId,
|
|
||||||
EndpointType,
|
|
||||||
LemmyError,
|
|
||||||
};
|
};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
api::{
|
api::{
|
||||||
check_slurs,
|
check_slurs, check_slurs_opt, get_user_from_jwt, get_user_from_jwt_opt, is_admin, Perform,
|
||||||
check_slurs_opt,
|
|
||||||
get_user_from_jwt,
|
|
||||||
get_user_from_jwt_opt,
|
|
||||||
is_admin,
|
|
||||||
Perform,
|
|
||||||
},
|
},
|
||||||
apub::fetcher::search_by_apub_id,
|
apub::fetcher::search_by_apub_id,
|
||||||
blocking,
|
blocking, version,
|
||||||
version,
|
|
||||||
websocket::{
|
websocket::{
|
||||||
messages::{GetUsersOnline, SendAllMessage},
|
messages::{GetUsersOnline, SendAllMessage},
|
||||||
UserOperation,
|
UserOperation,
|
||||||
|
@ -20,20 +14,9 @@ use actix_web::web::Data;
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use lemmy_api_structs::{site::*, user::Register};
|
use lemmy_api_structs::{site::*, user::Register};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
category::*,
|
category::*, comment_view::*, community_view::*, diesel_option_overwrite, moderator::*,
|
||||||
comment_view::*,
|
moderator_views::*, naive_now, post_view::*, site::*, site_view::*, user_view::*, Crud,
|
||||||
community_view::*,
|
SearchType, SortType,
|
||||||
diesel_option_overwrite,
|
|
||||||
moderator::*,
|
|
||||||
moderator_views::*,
|
|
||||||
naive_now,
|
|
||||||
post_view::*,
|
|
||||||
site::*,
|
|
||||||
site_view::*,
|
|
||||||
user_view::*,
|
|
||||||
Crud,
|
|
||||||
SearchType,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{location_info, settings::Settings, APIError, ConnectionId, LemmyError};
|
use lemmy_utils::{location_info, settings::Settings, APIError, ConnectionId, LemmyError};
|
||||||
use log::{debug, info};
|
use log::{debug, info};
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
api::{check_slurs, claims::Claims, get_user_from_jwt, get_user_from_jwt_opt, is_admin, Perform},
|
api::{check_slurs, claims::Claims, get_user_from_jwt, get_user_from_jwt_opt, is_admin, Perform},
|
||||||
apub::ApubObjectType,
|
apub::ApubObjectType,
|
||||||
blocking,
|
blocking, captcha_espeak_wav_base64,
|
||||||
captcha_espeak_wav_base64,
|
|
||||||
websocket::{
|
websocket::{
|
||||||
messages::{CaptchaItem, CheckCaptcha, JoinUserRoom, SendAllMessage, SendUserRoomMessage},
|
messages::{CaptchaItem, CheckCaptcha, JoinUserRoom, SendAllMessage, SendUserRoomMessage},
|
||||||
UserOperation,
|
UserOperation,
|
||||||
|
@ -16,45 +15,15 @@ use captcha::{gen, Difficulty};
|
||||||
use chrono::Duration;
|
use chrono::Duration;
|
||||||
use lemmy_api_structs::user::*;
|
use lemmy_api_structs::user::*;
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::*,
|
comment::*, comment_view::*, community::*, community_view::*, diesel_option_overwrite,
|
||||||
comment_view::*,
|
moderator::*, naive_now, password_reset_request::*, post::*, post_view::*, private_message::*,
|
||||||
community::*,
|
private_message_view::*, site::*, site_view::*, user::*, user_mention::*, user_mention_view::*,
|
||||||
community_view::*,
|
user_view::*, Crud, Followable, Joinable, ListingType, SortType,
|
||||||
diesel_option_overwrite,
|
|
||||||
moderator::*,
|
|
||||||
naive_now,
|
|
||||||
password_reset_request::*,
|
|
||||||
post::*,
|
|
||||||
post_view::*,
|
|
||||||
private_message::*,
|
|
||||||
private_message_view::*,
|
|
||||||
site::*,
|
|
||||||
site_view::*,
|
|
||||||
user::*,
|
|
||||||
user_mention::*,
|
|
||||||
user_mention_view::*,
|
|
||||||
user_view::*,
|
|
||||||
Crud,
|
|
||||||
Followable,
|
|
||||||
Joinable,
|
|
||||||
ListingType,
|
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
generate_actor_keypair,
|
generate_actor_keypair, generate_random_string, is_valid_preferred_username, is_valid_username,
|
||||||
generate_random_string,
|
location_info, make_apub_endpoint, naive_from_unix, remove_slurs, send_email, settings::Settings,
|
||||||
is_valid_preferred_username,
|
APIError, ConnectionId, EndpointType, LemmyError,
|
||||||
is_valid_username,
|
|
||||||
location_info,
|
|
||||||
make_apub_endpoint,
|
|
||||||
naive_from_unix,
|
|
||||||
remove_slurs,
|
|
||||||
send_email,
|
|
||||||
settings::Settings,
|
|
||||||
APIError,
|
|
||||||
ConnectionId,
|
|
||||||
EndpointType,
|
|
||||||
LemmyError,
|
|
||||||
};
|
};
|
||||||
use log::error;
|
use log::error;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
|
@ -6,13 +6,7 @@ use activitystreams::{
|
||||||
use anyhow::{anyhow, Context, Error};
|
use anyhow::{anyhow, Context, Error};
|
||||||
use awc::Client;
|
use awc::Client;
|
||||||
use background_jobs::{
|
use background_jobs::{
|
||||||
create_server,
|
create_server, memory_storage::Storage, ActixJob, Backoff, MaxRetries, QueueHandle, WorkerConfig,
|
||||||
memory_storage::Storage,
|
|
||||||
ActixJob,
|
|
||||||
Backoff,
|
|
||||||
MaxRetries,
|
|
||||||
QueueHandle,
|
|
||||||
WorkerConfig,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{location_info, settings::Settings, LemmyError};
|
use lemmy_utils::{location_info, settings::Settings, LemmyError};
|
||||||
use log::warn;
|
use log::warn;
|
||||||
|
|
|
@ -1,36 +1,19 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
apub::{
|
apub::{
|
||||||
activities::{generate_activity_id, send_activity_to_community},
|
activities::{generate_activity_id, send_activity_to_community},
|
||||||
check_actor_domain,
|
check_actor_domain, create_apub_response, create_apub_tombstone_response, create_tombstone,
|
||||||
create_apub_response,
|
|
||||||
create_apub_tombstone_response,
|
|
||||||
create_tombstone,
|
|
||||||
fetch_webfinger_url,
|
fetch_webfinger_url,
|
||||||
fetcher::{
|
fetcher::{
|
||||||
get_or_fetch_and_insert_comment,
|
get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post, get_or_fetch_and_upsert_user,
|
||||||
get_or_fetch_and_insert_post,
|
|
||||||
get_or_fetch_and_upsert_user,
|
|
||||||
},
|
},
|
||||||
ActorType,
|
ActorType, ApubLikeableType, ApubObjectType, FromApub, ToApub,
|
||||||
ApubLikeableType,
|
|
||||||
ApubObjectType,
|
|
||||||
FromApub,
|
|
||||||
ToApub,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking, DbPool, LemmyContext,
|
||||||
DbPool,
|
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use activitystreams::{
|
use activitystreams::{
|
||||||
activity::{
|
activity::{
|
||||||
kind::{CreateType, DeleteType, DislikeType, LikeType, RemoveType, UndoType, UpdateType},
|
kind::{CreateType, DeleteType, DislikeType, LikeType, RemoveType, UndoType, UpdateType},
|
||||||
Create,
|
Create, Delete, Dislike, Like, Remove, Undo, Update,
|
||||||
Delete,
|
|
||||||
Dislike,
|
|
||||||
Like,
|
|
||||||
Remove,
|
|
||||||
Undo,
|
|
||||||
Update,
|
|
||||||
},
|
},
|
||||||
base::AnyBase,
|
base::AnyBase,
|
||||||
link::Mention,
|
link::Mention,
|
||||||
|
@ -49,12 +32,7 @@ use lemmy_db::{
|
||||||
Crud,
|
Crud,
|
||||||
};
|
};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
convert_datetime,
|
convert_datetime, location_info, remove_slurs, scrape_text_for_mentions, LemmyError, MentionData,
|
||||||
location_info,
|
|
||||||
remove_slurs,
|
|
||||||
scrape_text_for_mentions,
|
|
||||||
LemmyError,
|
|
||||||
MentionData,
|
|
||||||
};
|
};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
|
@ -3,31 +3,17 @@ use crate::{
|
||||||
apub::{
|
apub::{
|
||||||
activities::generate_activity_id,
|
activities::generate_activity_id,
|
||||||
activity_queue::send_activity,
|
activity_queue::send_activity,
|
||||||
check_actor_domain,
|
check_actor_domain, create_apub_response, create_apub_tombstone_response, create_tombstone,
|
||||||
create_apub_response,
|
|
||||||
create_apub_tombstone_response,
|
|
||||||
create_tombstone,
|
|
||||||
extensions::group_extensions::GroupExtension,
|
extensions::group_extensions::GroupExtension,
|
||||||
fetcher::{get_or_fetch_and_upsert_actor, get_or_fetch_and_upsert_user},
|
fetcher::{get_or_fetch_and_upsert_actor, get_or_fetch_and_upsert_user},
|
||||||
insert_activity,
|
insert_activity, ActorType, FromApub, GroupExt, ToApub,
|
||||||
ActorType,
|
|
||||||
FromApub,
|
|
||||||
GroupExt,
|
|
||||||
ToApub,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking, DbPool, LemmyContext,
|
||||||
DbPool,
|
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use activitystreams::{
|
use activitystreams::{
|
||||||
activity::{
|
activity::{
|
||||||
kind::{AcceptType, AnnounceType, DeleteType, LikeType, RemoveType, UndoType},
|
kind::{AcceptType, AnnounceType, DeleteType, LikeType, RemoveType, UndoType},
|
||||||
Accept,
|
Accept, Announce, Delete, Follow, Remove, Undo,
|
||||||
Announce,
|
|
||||||
Delete,
|
|
||||||
Follow,
|
|
||||||
Remove,
|
|
||||||
Undo,
|
|
||||||
},
|
},
|
||||||
actor::{kind::GroupType, ApActor, Endpoints, Group},
|
actor::{kind::GroupType, ApActor, Endpoints, Group},
|
||||||
base::{AnyBase, BaseExt},
|
base::{AnyBase, BaseExt},
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
apub::{
|
apub::{
|
||||||
check_is_apub_id_valid,
|
check_is_apub_id_valid, ActorType, FromApub, GroupExt, PageExt, PersonExt,
|
||||||
ActorType,
|
|
||||||
FromApub,
|
|
||||||
GroupExt,
|
|
||||||
PageExt,
|
|
||||||
PersonExt,
|
|
||||||
APUB_JSON_CONTENT_TYPE,
|
APUB_JSON_CONTENT_TYPE,
|
||||||
},
|
},
|
||||||
blocking,
|
blocking,
|
||||||
|
@ -27,9 +22,7 @@ use lemmy_db::{
|
||||||
post_view::PostView,
|
post_view::PostView,
|
||||||
user::{UserForm, User_},
|
user::{UserForm, User_},
|
||||||
user_view::UserView,
|
user_view::UserView,
|
||||||
Crud,
|
Crud, Joinable, SearchType,
|
||||||
Joinable,
|
|
||||||
SearchType,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{get_apub_protocol_string, location_info, LemmyError};
|
use lemmy_utils::{get_apub_protocol_string, location_info, LemmyError};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
apub::inbox::{
|
apub::inbox::{
|
||||||
activities::{
|
activities::{
|
||||||
create::receive_create,
|
create::receive_create, delete::receive_delete, dislike::receive_dislike, like::receive_like,
|
||||||
delete::receive_delete,
|
remove::receive_remove, undo::receive_undo, update::receive_update,
|
||||||
dislike::receive_dislike,
|
|
||||||
like::receive_like,
|
|
||||||
remove::receive_remove,
|
|
||||||
undo::receive_undo,
|
|
||||||
update::receive_update,
|
|
||||||
},
|
},
|
||||||
shared_inbox::{get_community_id_from_activity, receive_unhandled_activity},
|
shared_inbox::{get_community_id_from_activity, receive_unhandled_activity},
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,13 +2,9 @@ use crate::{
|
||||||
api::comment::send_local_notifs,
|
api::comment::send_local_notifs,
|
||||||
apub::{
|
apub::{
|
||||||
inbox::shared_inbox::{
|
inbox::shared_inbox::{
|
||||||
announce_if_community_is_local,
|
announce_if_community_is_local, get_user_from_activity, receive_unhandled_activity,
|
||||||
get_user_from_activity,
|
|
||||||
receive_unhandled_activity,
|
|
||||||
},
|
},
|
||||||
ActorType,
|
ActorType, FromApub, PageExt,
|
||||||
FromApub,
|
|
||||||
PageExt,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking,
|
||||||
websocket::{
|
websocket::{
|
||||||
|
|
|
@ -2,14 +2,9 @@ use crate::{
|
||||||
apub::{
|
apub::{
|
||||||
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
||||||
inbox::shared_inbox::{
|
inbox::shared_inbox::{
|
||||||
announce_if_community_is_local,
|
announce_if_community_is_local, get_user_from_activity, receive_unhandled_activity,
|
||||||
get_user_from_activity,
|
|
||||||
receive_unhandled_activity,
|
|
||||||
},
|
},
|
||||||
ActorType,
|
ActorType, FromApub, GroupExt, PageExt,
|
||||||
FromApub,
|
|
||||||
GroupExt,
|
|
||||||
PageExt,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking,
|
||||||
websocket::{
|
websocket::{
|
||||||
|
@ -22,9 +17,7 @@ use activitystreams::{activity::Delete, base::AnyBase, object::Note, prelude::*}
|
||||||
use actix_web::HttpResponse;
|
use actix_web::HttpResponse;
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use lemmy_api_structs::{
|
use lemmy_api_structs::{
|
||||||
comment::CommentResponse,
|
comment::CommentResponse, community::CommunityResponse, post::PostResponse,
|
||||||
community::CommunityResponse,
|
|
||||||
post::PostResponse,
|
|
||||||
};
|
};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::{Comment, CommentForm},
|
comment::{Comment, CommentForm},
|
||||||
|
|
|
@ -2,12 +2,9 @@ use crate::{
|
||||||
apub::{
|
apub::{
|
||||||
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
||||||
inbox::shared_inbox::{
|
inbox::shared_inbox::{
|
||||||
announce_if_community_is_local,
|
announce_if_community_is_local, get_user_from_activity, receive_unhandled_activity,
|
||||||
get_user_from_activity,
|
|
||||||
receive_unhandled_activity,
|
|
||||||
},
|
},
|
||||||
FromApub,
|
FromApub, PageExt,
|
||||||
PageExt,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking,
|
||||||
websocket::{
|
websocket::{
|
||||||
|
|
|
@ -2,12 +2,9 @@ use crate::{
|
||||||
apub::{
|
apub::{
|
||||||
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
||||||
inbox::shared_inbox::{
|
inbox::shared_inbox::{
|
||||||
announce_if_community_is_local,
|
announce_if_community_is_local, get_user_from_activity, receive_unhandled_activity,
|
||||||
get_user_from_activity,
|
|
||||||
receive_unhandled_activity,
|
|
||||||
},
|
},
|
||||||
FromApub,
|
FromApub, PageExt,
|
||||||
PageExt,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking,
|
||||||
websocket::{
|
websocket::{
|
||||||
|
|
|
@ -2,15 +2,10 @@ use crate::{
|
||||||
apub::{
|
apub::{
|
||||||
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
||||||
inbox::shared_inbox::{
|
inbox::shared_inbox::{
|
||||||
announce_if_community_is_local,
|
announce_if_community_is_local, get_community_id_from_activity, get_user_from_activity,
|
||||||
get_community_id_from_activity,
|
|
||||||
get_user_from_activity,
|
|
||||||
receive_unhandled_activity,
|
receive_unhandled_activity,
|
||||||
},
|
},
|
||||||
ActorType,
|
ActorType, FromApub, GroupExt, PageExt,
|
||||||
FromApub,
|
|
||||||
GroupExt,
|
|
||||||
PageExt,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking,
|
||||||
websocket::{
|
websocket::{
|
||||||
|
@ -23,9 +18,7 @@ use activitystreams::{activity::Remove, base::AnyBase, object::Note, prelude::*}
|
||||||
use actix_web::HttpResponse;
|
use actix_web::HttpResponse;
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{anyhow, Context};
|
||||||
use lemmy_api_structs::{
|
use lemmy_api_structs::{
|
||||||
comment::CommentResponse,
|
comment::CommentResponse, community::CommunityResponse, post::PostResponse,
|
||||||
community::CommunityResponse,
|
|
||||||
post::PostResponse,
|
|
||||||
};
|
};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::{Comment, CommentForm},
|
comment::{Comment, CommentForm},
|
||||||
|
|
|
@ -2,14 +2,9 @@ use crate::{
|
||||||
apub::{
|
apub::{
|
||||||
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
||||||
inbox::shared_inbox::{
|
inbox::shared_inbox::{
|
||||||
announce_if_community_is_local,
|
announce_if_community_is_local, get_user_from_activity, receive_unhandled_activity,
|
||||||
get_user_from_activity,
|
|
||||||
receive_unhandled_activity,
|
|
||||||
},
|
},
|
||||||
ActorType,
|
ActorType, FromApub, GroupExt, PageExt,
|
||||||
FromApub,
|
|
||||||
GroupExt,
|
|
||||||
PageExt,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking,
|
||||||
websocket::{
|
websocket::{
|
||||||
|
@ -27,9 +22,7 @@ use activitystreams::{
|
||||||
use actix_web::HttpResponse;
|
use actix_web::HttpResponse;
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{anyhow, Context};
|
||||||
use lemmy_api_structs::{
|
use lemmy_api_structs::{
|
||||||
comment::CommentResponse,
|
comment::CommentResponse, community::CommunityResponse, post::PostResponse,
|
||||||
community::CommunityResponse,
|
|
||||||
post::PostResponse,
|
|
||||||
};
|
};
|
||||||
use lemmy_db::{
|
use lemmy_db::{
|
||||||
comment::{Comment, CommentForm, CommentLike},
|
comment::{Comment, CommentForm, CommentLike},
|
||||||
|
@ -39,8 +32,7 @@ use lemmy_db::{
|
||||||
naive_now,
|
naive_now,
|
||||||
post::{Post, PostForm, PostLike},
|
post::{Post, PostForm, PostLike},
|
||||||
post_view::PostView,
|
post_view::PostView,
|
||||||
Crud,
|
Crud, Likeable,
|
||||||
Likeable,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{location_info, LemmyError};
|
use lemmy_utils::{location_info, LemmyError};
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,9 @@ use crate::{
|
||||||
apub::{
|
apub::{
|
||||||
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
fetcher::{get_or_fetch_and_insert_comment, get_or_fetch_and_insert_post},
|
||||||
inbox::shared_inbox::{
|
inbox::shared_inbox::{
|
||||||
announce_if_community_is_local,
|
announce_if_community_is_local, get_user_from_activity, receive_unhandled_activity,
|
||||||
get_user_from_activity,
|
|
||||||
receive_unhandled_activity,
|
|
||||||
},
|
},
|
||||||
ActorType,
|
ActorType, FromApub, PageExt,
|
||||||
FromApub,
|
|
||||||
PageExt,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking,
|
||||||
websocket::{
|
websocket::{
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
apub::{
|
apub::{
|
||||||
check_is_apub_id_valid,
|
check_is_apub_id_valid, extensions::signatures::verify, fetcher::get_or_fetch_and_upsert_user,
|
||||||
extensions::signatures::verify,
|
insert_activity, ActorType,
|
||||||
fetcher::get_or_fetch_and_upsert_user,
|
|
||||||
insert_activity,
|
|
||||||
ActorType,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking, LemmyContext,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use activitystreams::{
|
use activitystreams::{
|
||||||
activity::{ActorAndObject, Follow, Undo},
|
activity::{ActorAndObject, Follow, Undo},
|
||||||
|
|
|
@ -4,18 +4,12 @@ use crate::{
|
||||||
community::do_announce,
|
community::do_announce,
|
||||||
extensions::signatures::verify,
|
extensions::signatures::verify,
|
||||||
fetcher::{
|
fetcher::{
|
||||||
get_or_fetch_and_upsert_actor,
|
get_or_fetch_and_upsert_actor, get_or_fetch_and_upsert_community,
|
||||||
get_or_fetch_and_upsert_community,
|
|
||||||
get_or_fetch_and_upsert_user,
|
get_or_fetch_and_upsert_user,
|
||||||
},
|
},
|
||||||
inbox::activities::{
|
inbox::activities::{
|
||||||
announce::receive_announce,
|
announce::receive_announce, create::receive_create, delete::receive_delete,
|
||||||
create::receive_create,
|
dislike::receive_dislike, like::receive_like, remove::receive_remove, undo::receive_undo,
|
||||||
delete::receive_delete,
|
|
||||||
dislike::receive_dislike,
|
|
||||||
like::receive_like,
|
|
||||||
remove::receive_remove,
|
|
||||||
undo::receive_undo,
|
|
||||||
update::receive_update,
|
update::receive_update,
|
||||||
},
|
},
|
||||||
insert_activity,
|
insert_activity,
|
||||||
|
|
|
@ -3,8 +3,7 @@ use crate::{
|
||||||
check_is_apub_id_valid,
|
check_is_apub_id_valid,
|
||||||
extensions::signatures::verify,
|
extensions::signatures::verify,
|
||||||
fetcher::{get_or_fetch_and_upsert_actor, get_or_fetch_and_upsert_community},
|
fetcher::{get_or_fetch_and_upsert_actor, get_or_fetch_and_upsert_community},
|
||||||
insert_activity,
|
insert_activity, FromApub,
|
||||||
FromApub,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking,
|
||||||
websocket::{messages::SendUserRoomMessage, UserOperation},
|
websocket::{messages::SendUserRoomMessage, UserOperation},
|
||||||
|
@ -25,8 +24,7 @@ use lemmy_db::{
|
||||||
private_message::{PrivateMessage, PrivateMessageForm},
|
private_message::{PrivateMessage, PrivateMessageForm},
|
||||||
private_message_view::PrivateMessageView,
|
private_message_view::PrivateMessageView,
|
||||||
user::User_,
|
user::User_,
|
||||||
Crud,
|
Crud, Followable,
|
||||||
Followable,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{location_info, LemmyError};
|
use lemmy_utils::{location_info, LemmyError};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
|
|
|
@ -18,8 +18,7 @@ use crate::{
|
||||||
blocking,
|
blocking,
|
||||||
request::{retry, RecvError},
|
request::{retry, RecvError},
|
||||||
routes::webfinger::WebFingerResponse,
|
routes::webfinger::WebFingerResponse,
|
||||||
DbPool,
|
DbPool, LemmyContext,
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use activitystreams::{
|
use activitystreams::{
|
||||||
activity::Follow,
|
activity::Follow,
|
||||||
|
@ -35,11 +34,7 @@ use anyhow::{anyhow, Context};
|
||||||
use chrono::NaiveDateTime;
|
use chrono::NaiveDateTime;
|
||||||
use lemmy_db::{activity::do_insert_activity, user::User_};
|
use lemmy_db::{activity::do_insert_activity, user::User_};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
convert_datetime,
|
convert_datetime, get_apub_protocol_string, location_info, settings::Settings, LemmyError,
|
||||||
get_apub_protocol_string,
|
|
||||||
location_info,
|
|
||||||
settings::Settings,
|
|
||||||
LemmyError,
|
|
||||||
MentionData,
|
MentionData,
|
||||||
};
|
};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
|
|
|
@ -2,33 +2,17 @@ use crate::{
|
||||||
api::check_slurs,
|
api::check_slurs,
|
||||||
apub::{
|
apub::{
|
||||||
activities::{generate_activity_id, send_activity_to_community},
|
activities::{generate_activity_id, send_activity_to_community},
|
||||||
check_actor_domain,
|
check_actor_domain, create_apub_response, create_apub_tombstone_response, create_tombstone,
|
||||||
create_apub_response,
|
|
||||||
create_apub_tombstone_response,
|
|
||||||
create_tombstone,
|
|
||||||
extensions::page_extension::PageExtension,
|
extensions::page_extension::PageExtension,
|
||||||
fetcher::{get_or_fetch_and_upsert_community, get_or_fetch_and_upsert_user},
|
fetcher::{get_or_fetch_and_upsert_community, get_or_fetch_and_upsert_user},
|
||||||
ActorType,
|
ActorType, ApubLikeableType, ApubObjectType, FromApub, PageExt, ToApub,
|
||||||
ApubLikeableType,
|
|
||||||
ApubObjectType,
|
|
||||||
FromApub,
|
|
||||||
PageExt,
|
|
||||||
ToApub,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking, DbPool, LemmyContext,
|
||||||
DbPool,
|
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use activitystreams::{
|
use activitystreams::{
|
||||||
activity::{
|
activity::{
|
||||||
kind::{CreateType, DeleteType, DislikeType, LikeType, RemoveType, UndoType, UpdateType},
|
kind::{CreateType, DeleteType, DislikeType, LikeType, RemoveType, UndoType, UpdateType},
|
||||||
Create,
|
Create, Delete, Dislike, Like, Remove, Undo, Update,
|
||||||
Delete,
|
|
||||||
Dislike,
|
|
||||||
Like,
|
|
||||||
Remove,
|
|
||||||
Undo,
|
|
||||||
Update,
|
|
||||||
},
|
},
|
||||||
object::{kind::PageType, Image, Object, Page, Tombstone},
|
object::{kind::PageType, Image, Object, Page, Tombstone},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
|
|
@ -1,28 +1,15 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
apub::{
|
apub::{
|
||||||
activities::generate_activity_id,
|
activities::generate_activity_id, activity_queue::send_activity, check_actor_domain,
|
||||||
activity_queue::send_activity,
|
check_is_apub_id_valid, create_tombstone, fetcher::get_or_fetch_and_upsert_user,
|
||||||
check_actor_domain,
|
insert_activity, ActorType, ApubObjectType, FromApub, ToApub,
|
||||||
check_is_apub_id_valid,
|
|
||||||
create_tombstone,
|
|
||||||
fetcher::get_or_fetch_and_upsert_user,
|
|
||||||
insert_activity,
|
|
||||||
ActorType,
|
|
||||||
ApubObjectType,
|
|
||||||
FromApub,
|
|
||||||
ToApub,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking, DbPool, LemmyContext,
|
||||||
DbPool,
|
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use activitystreams::{
|
use activitystreams::{
|
||||||
activity::{
|
activity::{
|
||||||
kind::{CreateType, DeleteType, UndoType, UpdateType},
|
kind::{CreateType, DeleteType, UndoType, UpdateType},
|
||||||
Create,
|
Create, Delete, Undo, Update,
|
||||||
Delete,
|
|
||||||
Undo,
|
|
||||||
Update,
|
|
||||||
},
|
},
|
||||||
object::{kind::NoteType, Note, Tombstone},
|
object::{kind::NoteType, Note, Tombstone},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
|
|
@ -1,26 +1,16 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
api::{check_slurs, check_slurs_opt},
|
api::{check_slurs, check_slurs_opt},
|
||||||
apub::{
|
apub::{
|
||||||
activities::generate_activity_id,
|
activities::generate_activity_id, activity_queue::send_activity, check_actor_domain,
|
||||||
activity_queue::send_activity,
|
create_apub_response, fetcher::get_or_fetch_and_upsert_actor, insert_activity, ActorType,
|
||||||
check_actor_domain,
|
FromApub, PersonExt, ToApub,
|
||||||
create_apub_response,
|
|
||||||
fetcher::get_or_fetch_and_upsert_actor,
|
|
||||||
insert_activity,
|
|
||||||
ActorType,
|
|
||||||
FromApub,
|
|
||||||
PersonExt,
|
|
||||||
ToApub,
|
|
||||||
},
|
},
|
||||||
blocking,
|
blocking, DbPool, LemmyContext,
|
||||||
DbPool,
|
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use activitystreams::{
|
use activitystreams::{
|
||||||
activity::{
|
activity::{
|
||||||
kind::{FollowType, UndoType},
|
kind::{FollowType, UndoType},
|
||||||
Follow,
|
Follow, Undo,
|
||||||
Undo,
|
|
||||||
},
|
},
|
||||||
actor::{ApActor, Endpoints, Person},
|
actor::{ApActor, Endpoints, Person},
|
||||||
object::{Image, Tombstone},
|
object::{Image, Tombstone},
|
||||||
|
|
|
@ -13,12 +13,8 @@ use lemmy_db::{
|
||||||
Crud,
|
Crud,
|
||||||
};
|
};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
generate_actor_keypair,
|
generate_actor_keypair, get_apub_protocol_string, make_apub_endpoint, settings::Settings,
|
||||||
get_apub_protocol_string,
|
EndpointType, LemmyError,
|
||||||
make_apub_endpoint,
|
|
||||||
settings::Settings,
|
|
||||||
EndpointType,
|
|
||||||
LemmyError,
|
|
||||||
};
|
};
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
|
|
13
src/main.rs
13
src/main.rs
|
@ -19,12 +19,8 @@ use lazy_static::lazy_static;
|
||||||
use lemmy_db::get_database_url_from_env;
|
use lemmy_db::get_database_url_from_env;
|
||||||
use lemmy_rate_limit::{rate_limiter::RateLimiter, RateLimit};
|
use lemmy_rate_limit::{rate_limiter::RateLimiter, RateLimit};
|
||||||
use lemmy_server::{
|
use lemmy_server::{
|
||||||
apub::activity_queue::create_activity_queue,
|
apub::activity_queue::create_activity_queue, blocking, code_migrations::run_advanced_migrations,
|
||||||
blocking,
|
routes::*, websocket::chat_server::ChatServer, LemmyContext,
|
||||||
code_migrations::run_advanced_migrations,
|
|
||||||
routes::*,
|
|
||||||
websocket::chat_server::ChatServer,
|
|
||||||
LemmyContext,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{settings::Settings, LemmyError, CACHE_CONTROL_REGEX};
|
use lemmy_utils::{settings::Settings, LemmyError, CACHE_CONTROL_REGEX};
|
||||||
use reqwest::Client;
|
use reqwest::Client;
|
||||||
|
@ -102,10 +98,7 @@ async fn main() -> Result<(), LemmyError> {
|
||||||
.configure(|cfg| images::config(cfg, &rate_limiter))
|
.configure(|cfg| images::config(cfg, &rate_limiter))
|
||||||
.configure(nodeinfo::config)
|
.configure(nodeinfo::config)
|
||||||
.configure(webfinger::config)
|
.configure(webfinger::config)
|
||||||
.service(actix_files::Files::new(
|
.service(actix_files::Files::new("/docs", "/documentation"))
|
||||||
"/docs",
|
|
||||||
"/documentation",
|
|
||||||
))
|
|
||||||
})
|
})
|
||||||
.bind((settings.bind, settings.port))?
|
.bind((settings.bind, settings.port))?
|
||||||
.run()
|
.run()
|
||||||
|
|
|
@ -10,8 +10,7 @@ use lemmy_db::{
|
||||||
site_view::SiteView,
|
site_view::SiteView,
|
||||||
user::User_,
|
user::User_,
|
||||||
user_mention_view::{UserMentionQueryBuilder, UserMentionView},
|
user_mention_view::{UserMentionQueryBuilder, UserMentionView},
|
||||||
ListingType,
|
ListingType, SortType,
|
||||||
SortType,
|
|
||||||
};
|
};
|
||||||
use lemmy_utils::{markdown_to_html, settings::Settings, LemmyError};
|
use lemmy_utils::{markdown_to_html, settings::Settings, LemmyError};
|
||||||
use rss::{CategoryBuilder, ChannelBuilder, GuidBuilder, Item, ItemBuilder};
|
use rss::{CategoryBuilder, ChannelBuilder, GuidBuilder, Item, ItemBuilder};
|
||||||
|
|
|
@ -3,10 +3,7 @@ use actix_web::{error::ErrorBadRequest, web::Query, *};
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use lemmy_db::{community::Community, user::User_};
|
use lemmy_db::{community::Community, user::User_};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
settings::Settings,
|
settings::Settings, LemmyError, WEBFINGER_COMMUNITY_REGEX, WEBFINGER_USER_REGEX,
|
||||||
LemmyError,
|
|
||||||
WEBFINGER_COMMUNITY_REGEX,
|
|
||||||
WEBFINGER_USER_REGEX,
|
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,7 @@ use diesel::{
|
||||||
use lemmy_api_structs::{comment::*, community::*, post::*, site::*, user::*};
|
use lemmy_api_structs::{comment::*, community::*, post::*, site::*, user::*};
|
||||||
use lemmy_rate_limit::RateLimit;
|
use lemmy_rate_limit::RateLimit;
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
location_info,
|
location_info, APIError, CommunityId, ConnectionId, IPAddr, LemmyError, PostId, UserId,
|
||||||
APIError,
|
|
||||||
CommunityId,
|
|
||||||
ConnectionId,
|
|
||||||
IPAddr,
|
|
||||||
LemmyError,
|
|
||||||
PostId,
|
|
||||||
UserId,
|
|
||||||
};
|
};
|
||||||
use rand::rngs::ThreadRng;
|
use rand::rngs::ThreadRng;
|
||||||
use reqwest::Client;
|
use reqwest::Client;
|
||||||
|
|
Loading…
Reference in New Issue