summaryrefslogtreecommitdiffstats
path: root/server/src/apub/mod.rs
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-05-06 13:51:39 -0400
committerDessalines <tyhou13@gmx.com>2020-05-06 13:51:39 -0400
commit66142c546b4a7120b94bacc18cf478ae1905fd46 (patch)
tree043a5196f9aba407de1ebd0806865039b4f35402 /server/src/apub/mod.rs
parentdfd6629a6fc1fa43abf2815e9b219c3c0e832072 (diff)
parent15f1920b2515f1f7046d4e6cbb57487d41817163 (diff)
Merge branch 'federated_private_messages' into federation
Diffstat (limited to 'server/src/apub/mod.rs')
-rw-r--r--server/src/apub/mod.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/src/apub/mod.rs b/server/src/apub/mod.rs
index 8b4ceb79..77950d41 100644
--- a/server/src/apub/mod.rs
+++ b/server/src/apub/mod.rs
@@ -5,6 +5,7 @@ pub mod community_inbox;
pub mod extensions;
pub mod fetcher;
pub mod post;
+pub mod private_message;
pub mod shared_inbox;
pub mod user;
pub mod user_inbox;
@@ -39,6 +40,7 @@ use url::Url;
use crate::api::comment::CommentResponse;
use crate::api::post::PostResponse;
use crate::api::site::SearchResponse;
+use crate::api::user::PrivateMessageResponse;
use crate::db::comment::{Comment, CommentForm, CommentLike, CommentLikeForm};
use crate::db::comment_view::CommentView;
use crate::db::community::{
@@ -48,13 +50,15 @@ use crate::db::community::{
use crate::db::community_view::{CommunityFollowerView, CommunityModeratorView, CommunityView};
use crate::db::post::{Post, PostForm, PostLike, PostLikeForm};
use crate::db::post_view::PostView;
+use crate::db::private_message::{PrivateMessage, PrivateMessageForm};
+use crate::db::private_message_view::PrivateMessageView;
use crate::db::user::{UserForm, User_};
use crate::db::user_view::UserView;
use crate::db::{activity, Crud, Followable, Joinable, Likeable, SearchType};
use crate::routes::nodeinfo::{NodeInfo, NodeInfoWellKnown};
use crate::routes::{ChatServerParam, DbPoolParam};
use crate::websocket::{
- server::{SendComment, SendPost},
+ server::{SendComment, SendPost, SendUserRoomMessage},
UserOperation,
};
use crate::{convert_datetime, naive_now, Settings};
@@ -78,6 +82,7 @@ pub enum EndpointType {
User,
Post,
Comment,
+ PrivateMessage,
}
/// Convert the data to json and turn it into an HTTP Response with the correct ActivityPub
@@ -113,6 +118,7 @@ pub fn make_apub_endpoint(endpoint_type: EndpointType, name: &str) -> Url {
// TODO I have to change this else my update advanced_migrations crashes the
// server if a comment exists.
EndpointType::Comment => "comment",
+ EndpointType::PrivateMessage => "private_message",
};
Url::parse(&format!(