Define User::remote_user_found() and publish_remote_user_found()
This commit is contained in:
parent
9d37408535
commit
6401cb6fb7
@ -1,8 +1,8 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
ap_url, blocklisted_emails::BlocklistedEmail, blogs::Blog, db_conn::DbConn, follows::Follow,
|
ap_url, blocklisted_emails::BlocklistedEmail, blogs::Blog, db_conn::DbConn, follows::Follow,
|
||||||
instance::*, medias::Media, notifications::Notification, post_authors::PostAuthor, posts::Post,
|
instance::*, medias::Media, notifications::Notification, post_authors::PostAuthor, posts::Post,
|
||||||
safe_string::SafeString, schema::users, timeline::Timeline, Connection, Error, Result, CONFIG,
|
safe_string::SafeString, schema::users, timeline::Timeline, Connection, Error, Result,
|
||||||
ITEMS_PER_PAGE,
|
UserEvent::*, CONFIG, ITEMS_PER_PAGE, USER_CHAN,
|
||||||
};
|
};
|
||||||
use activitypub::{
|
use activitypub::{
|
||||||
activity::Delete,
|
activity::Delete,
|
||||||
@ -33,6 +33,7 @@ use reqwest::{
|
|||||||
header::{HeaderValue, ACCEPT},
|
header::{HeaderValue, ACCEPT},
|
||||||
ClientBuilder,
|
ClientBuilder,
|
||||||
};
|
};
|
||||||
|
use riker::actors::{Publish, Tell};
|
||||||
use rocket::{
|
use rocket::{
|
||||||
outcome::IntoOutcome,
|
outcome::IntoOutcome,
|
||||||
request::{self, FromRequest, Request},
|
request::{self, FromRequest, Request},
|
||||||
@ -892,6 +893,21 @@ impl User {
|
|||||||
self.fqn.clone()
|
self.fqn.clone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn remote_user_found(&self) {
|
||||||
|
tracing::trace!("{:?}", self);
|
||||||
|
self.publish_remote_user_found();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn publish_remote_user_found(&self) {
|
||||||
|
USER_CHAN.tell(
|
||||||
|
Publish {
|
||||||
|
msg: RemoteUserFound(Arc::new(self.clone())),
|
||||||
|
topic: "user.remote_user_found".into(),
|
||||||
|
},
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'r> FromRequest<'a, 'r> for User {
|
impl<'a, 'r> FromRequest<'a, 'r> for User {
|
||||||
|
Loading…
Reference in New Issue
Block a user