mirror of
https://github.com/versia-pub/activitypub.git
synced 2025-12-06 14:48:19 +01:00
feat: sync follow to lysand
This commit is contained in:
parent
86c6df24a7
commit
42abaa0779
|
|
@ -11,14 +11,10 @@ use serde::{Deserialize, Serialize};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
database::StateHandle,
|
database::StateHandle, entities::{
|
||||||
entities::{
|
|
||||||
follow_relation::{self, Entity},
|
follow_relation::{self, Entity},
|
||||||
post, prelude, user,
|
post, prelude, user,
|
||||||
},
|
}, error, lysand::funcs::send_follow_accept_to_lysand, utils::{generate_follow_accept_id, generate_random_object_id}, DB
|
||||||
error,
|
|
||||||
utils::{generate_follow_accept_id, generate_random_object_id},
|
|
||||||
DB,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize, Debug)]
|
#[derive(Deserialize, Serialize, Debug)]
|
||||||
|
|
@ -196,5 +192,7 @@ async fn save_accept_follow(
|
||||||
let res = prelude::FollowRelation::update(active_query);
|
let res = prelude::FollowRelation::update(active_query);
|
||||||
let model = res.exec(db).await?;
|
let model = res.exec(db).await?;
|
||||||
|
|
||||||
|
let _ = send_follow_accept_to_lysand(model.clone()).await?;
|
||||||
|
|
||||||
Ok(model)
|
Ok(model)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ use super::{
|
||||||
superx::request_client,
|
superx::request_client,
|
||||||
};
|
};
|
||||||
|
|
||||||
async fn send_follow_accept_to_lysand(model: follow_relation::Model) -> anyhow::Result<()> {
|
pub async fn send_follow_accept_to_lysand(model: follow_relation::Model) -> anyhow::Result<()> {
|
||||||
let request_client = request_client();
|
let request_client = request_client();
|
||||||
let db = DB.get().unwrap();
|
let db = DB.get().unwrap();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue