mirror of https://github.com/LemmyNet/lemmy
Move websocket structs into lemmy_structs (ref #1115)
parent
5c6258390c
commit
98c086abb9
@ -1,13 +1,18 @@
|
||||
extern crate actix;
|
||||
extern crate actix_web;
|
||||
extern crate diesel;
|
||||
extern crate log;
|
||||
extern crate serde;
|
||||
#[macro_use]
|
||||
extern crate strum_macros;
|
||||
extern crate chrono;
|
||||
|
||||
pub mod comment;
|
||||
pub mod community;
|
||||
pub mod post;
|
||||
pub mod site;
|
||||
pub mod user;
|
||||
pub mod websocket;
|
||||
|
||||
use diesel::PgConnection;
|
||||
use lemmy_db::{
|
@ -1,9 +1,72 @@
|
||||
use crate::websocket::UserOperation;
|
||||
use crate::{comment::CommentResponse, post::PostResponse};
|
||||
use actix::{prelude::*, Recipient};
|
||||
use lemmy_api_structs::{comment::CommentResponse, post::PostResponse};
|
||||
use lemmy_utils::{CommunityId, ConnectionId, IPAddr, PostId, UserId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(EnumString, ToString, Debug, Clone)]
|
||||
pub enum UserOperation {
|
||||
Login,
|
||||
Register,
|
||||
GetCaptcha,
|
||||
CreateCommunity,
|
||||
CreatePost,
|
||||
ListCommunities,
|
||||
ListCategories,
|
||||
GetPost,
|
||||
GetCommunity,
|
||||
CreateComment,
|
||||
EditComment,
|
||||
DeleteComment,
|
||||
RemoveComment,
|
||||
MarkCommentAsRead,
|
||||
SaveComment,
|
||||
CreateCommentLike,
|
||||
GetPosts,
|
||||
CreatePostLike,
|
||||
EditPost,
|
||||
DeletePost,
|
||||
RemovePost,
|
||||
LockPost,
|
||||
StickyPost,
|
||||
SavePost,
|
||||
EditCommunity,
|
||||
DeleteCommunity,
|
||||
RemoveCommunity,
|
||||
FollowCommunity,
|
||||
GetFollowedCommunities,
|
||||
GetUserDetails,
|
||||
GetReplies,
|
||||
GetUserMentions,
|
||||
MarkUserMentionAsRead,
|
||||
GetModlog,
|
||||
BanFromCommunity,
|
||||
AddModToCommunity,
|
||||
CreateSite,
|
||||
EditSite,
|
||||
GetSite,
|
||||
AddAdmin,
|
||||
BanUser,
|
||||
Search,
|
||||
MarkAllAsRead,
|
||||
SaveUserSettings,
|
||||
TransferCommunity,
|
||||
TransferSite,
|
||||
DeleteAccount,
|
||||
PasswordReset,
|
||||
PasswordChange,
|
||||
CreatePrivateMessage,
|
||||
EditPrivateMessage,
|
||||
DeletePrivateMessage,
|
||||
MarkPrivateMessageAsRead,
|
||||
GetPrivateMessages,
|
||||
UserJoin,
|
||||
GetComments,
|
||||
GetSiteConfig,
|
||||
SaveSiteConfig,
|
||||
PostJoin,
|
||||
CommunityJoin,
|
||||
}
|
||||
|
||||
/// Chat server sends this messages to session
|
||||
#[derive(Message)]
|
||||
#[rtype(result = "()")]
|
Loading…
Reference in New Issue