Browse Source

Running cargo fmt.

tags/v0.7.59
Dessalines 1 month ago
parent
commit
96535366c3
29 changed files with 106 additions and 106 deletions
  1. +6
    -6
      src/api/comment.rs
  2. +10
    -10
      src/api/community.rs
  3. +1
    -1
      src/api/mod.rs
  4. +5
    -5
      src/api/post.rs
  5. +6
    -6
      src/api/site.rs
  6. +12
    -12
      src/api/user.rs
  7. +1
    -1
      src/apub/comment.rs
  8. +1
    -1
      src/apub/community.rs
  9. +1
    -1
      src/apub/fetcher.rs
  10. +6
    -6
      src/apub/inbox/activities/create.rs
  11. +7
    -7
      src/apub/inbox/activities/delete.rs
  12. +6
    -6
      src/apub/inbox/activities/dislike.rs
  13. +6
    -6
      src/apub/inbox/activities/like.rs
  14. +7
    -7
      src/apub/inbox/activities/remove.rs
  15. +7
    -7
      src/apub/inbox/activities/undo.rs
  16. +7
    -7
      src/apub/inbox/activities/update.rs
  17. +1
    -1
      src/apub/inbox/community_inbox.rs
  18. +5
    -5
      src/apub/inbox/user_inbox.rs
  19. +1
    -1
      src/apub/mod.rs
  20. +1
    -1
      src/apub/post.rs
  21. +1
    -1
      src/apub/private_message.rs
  22. +1
    -1
      src/apub/user.rs
  23. +1
    -1
      src/main.rs
  24. +1
    -1
      src/routes/api.rs
  25. +1
    -1
      src/routes/feeds.rs
  26. +1
    -1
      src/routes/nodeinfo.rs
  27. +1
    -1
      src/routes/webfinger.rs
  28. +1
    -1
      src/websocket/chat_server.rs
  29. +1
    -1
      src/websocket/handlers.rs

+ 6
- 6
src/api/comment.rs View File

@@ -11,12 +11,6 @@ use crate::{
LemmyContext,
};
use actix_web::web::Data;
use lemmy_structs::{
blocking,
comment::*,
send_local_notifs,
websocket::{SendComment, UserOperation},
};
use lemmy_db::{
comment::*,
comment_view::*,
@@ -30,6 +24,12 @@ use lemmy_db::{
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},


+ 10
- 10
src/api/community.rs View File

@@ -5,16 +5,6 @@ use crate::{
};
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,
@@ -32,6 +22,16 @@ use lemmy_db::{
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,


+ 1
- 1
src/api/mod.rs View File

@@ -1,6 +1,5 @@
use crate::{api::claims::Claims, DbPool, LemmyContext};
use actix_web::web::Data;
use lemmy_structs::blocking;
use lemmy_db::{
community::Community,
community_view::CommunityUserBanView,
@@ -8,6 +7,7 @@ use lemmy_db::{
user::User_,
Crud,
};
use lemmy_structs::blocking;
use lemmy_utils::{APIError, ConnectionId, LemmyError};

pub mod claims;


+ 5
- 5
src/api/post.rs View File

@@ -5,11 +5,6 @@ use crate::{
LemmyContext,
};
use actix_web::web::Data;
use lemmy_structs::{
blocking,
post::*,
websocket::{GetPostUsersOnline, JoinPostRoom, SendPost, UserOperation},
};
use lemmy_db::{
comment_view::*,
community_view::*,
@@ -24,6 +19,11 @@ use lemmy_db::{
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},


+ 6
- 6
src/api/site.rs View File

@@ -6,12 +6,6 @@ use crate::{
};
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::*,
@@ -28,6 +22,12 @@ use lemmy_db::{
SearchType,
SortType,
};
use lemmy_structs::{
blocking,
site::*,
user::Register,
websocket::{GetUsersOnline, SendAllMessage, UserOperation},
};
use lemmy_utils::{
location_info,
settings::Settings,


+ 12
- 12
src/api/user.rs View File

@@ -9,18 +9,6 @@ use anyhow::Context;
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::*,
@@ -46,6 +34,18 @@ use lemmy_db::{
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,


+ 1
- 1
src/apub/comment.rs View File

@@ -40,7 +40,6 @@ use activitystreams::{
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,
@@ -48,6 +47,7 @@ use lemmy_db::{
user::User_,
Crud,
};
use lemmy_structs::blocking;
use lemmy_utils::{
location_info,
utils::{convert_datetime, remove_slurs, scrape_text_for_mentions, MentionData},


+ 1
- 1
src/apub/community.rs View File

@@ -38,7 +38,6 @@ use activitystreams_ext::Ext2;
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},
@@ -46,6 +45,7 @@ use lemmy_db::{
post::Post,
user::User_,
};
use lemmy_structs::blocking;
use lemmy_utils::{
apub::get_apub_protocol_string,
location_info,


+ 1
- 1
src/apub/fetcher.rs View File

@@ -15,7 +15,6 @@ use activitystreams::{base::BaseExt, collection::OrderedCollection, object::Note
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,
@@ -30,6 +29,7 @@ use lemmy_db::{
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;


+ 6
- 6
src/apub/inbox/activities/create.rs View File

@@ -14,6 +14,12 @@ use crate::{
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,
@@ -21,12 +27,6 @@ use lemmy_structs::{
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(


+ 7
- 7
src/apub/inbox/activities/delete.rs View File

@@ -16,13 +16,6 @@ use crate::{
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,
@@ -33,6 +26,13 @@ use lemmy_db::{
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(


+ 6
- 6
src/apub/inbox/activities/dislike.rs View File

@@ -14,12 +14,6 @@ use crate::{
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,
@@ -27,6 +21,12 @@ use lemmy_db::{
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(


+ 6
- 6
src/apub/inbox/activities/like.rs View File

@@ -14,12 +14,6 @@ use crate::{
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,
@@ -27,6 +21,12 @@ use lemmy_db::{
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(


+ 7
- 7
src/apub/inbox/activities/remove.rs View File

@@ -17,13 +17,6 @@ use crate::{
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,
@@ -34,6 +27,13 @@ use lemmy_db::{
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(


+ 7
- 7
src/apub/inbox/activities/undo.rs View File

@@ -21,13 +21,6 @@ use activitystreams::{
};
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,
@@ -39,6 +32,13 @@ use lemmy_db::{
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(


+ 7
- 7
src/apub/inbox/activities/update.rs View File

@@ -15,13 +15,6 @@ use crate::{
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,
@@ -29,6 +22,13 @@ use lemmy_db::{
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(


+ 1
- 1
src/apub/inbox/community_inbox.rs View File

@@ -15,12 +15,12 @@ use activitystreams::{
};
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};


+ 5
- 5
src/apub/inbox/user_inbox.rs View File

@@ -16,11 +16,6 @@ use activitystreams::{
};
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,
@@ -30,6 +25,11 @@ use lemmy_db::{
Crud,
Followable,
};
use lemmy_structs::{
blocking,
user::PrivateMessageResponse,
websocket::{SendUserRoomMessage, UserOperation},
};
use lemmy_utils::{location_info, LemmyError};
use log::debug;
use serde::{Deserialize, Serialize};


+ 1
- 1
src/apub/mod.rs View File

@@ -32,8 +32,8 @@ use activitystreams_ext::{Ext1, Ext2};
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,


+ 1
- 1
src/apub/post.rs View File

@@ -35,13 +35,13 @@ use activitystreams::{
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},


+ 1
- 1
src/apub/private_message.rs View File

@@ -27,12 +27,12 @@ use activitystreams::{
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;



+ 1
- 1
src/apub/user.rs View File

@@ -27,11 +27,11 @@ use activitystreams::{
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},


+ 1
- 1
src/main.rs View File

@@ -16,7 +16,6 @@ use diesel::{
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::{
@@ -26,6 +25,7 @@ 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;


+ 1
- 1
src/routes/api.rs View File

@@ -1,7 +1,7 @@
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) {


+ 1
- 1
src/routes/feeds.rs View File

@@ -3,7 +3,6 @@ use actix_web::{error::ErrorBadRequest, *};
use anyhow::anyhow;
use chrono::{DateTime, NaiveDateTime, Utc};
use diesel::PgConnection;
use lemmy_structs::blocking;
use lemmy_db::{
comment_view::{ReplyQueryBuilder, ReplyView},
community::Community,
@@ -14,6 +13,7 @@ use lemmy_db::{
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;


+ 1
- 1
src/routes/nodeinfo.rs View File

@@ -1,8 +1,8 @@
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;


+ 1
- 1
src/routes/webfinger.rs View File

@@ -1,8 +1,8 @@
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,


+ 1
- 1
src/websocket/chat_server.rs View File

@@ -9,8 +9,8 @@ use diesel::{
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,


+ 1
- 1
src/websocket/handlers.rs View File

@@ -5,9 +5,9 @@ use crate::{
};
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;


Loading…
Cancel
Save