This commit is contained in:
aprilthepink 2024-08-03 15:30:34 +02:00
parent 42abaa0779
commit faa9ca4270
4 changed files with 21 additions and 10 deletions

View file

@ -11,10 +11,15 @@ use serde::{Deserialize, Serialize};
use url::Url;
use crate::{
database::StateHandle, entities::{
database::StateHandle,
entities::{
follow_relation::{self, Entity},
post, prelude, user,
}, error, lysand::funcs::send_follow_accept_to_lysand, utils::{generate_follow_accept_id, generate_random_object_id}, DB
},
error,
lysand::funcs::send_follow_accept_to_lysand,
utils::{generate_follow_accept_id, generate_random_object_id},
DB,
};
#[derive(Deserialize, Serialize, Debug)]

View file

@ -1,9 +1,13 @@
use crate::{
activities::follow::Follow, entities::{
activities::follow::Follow,
entities::{
self, follow_relation,
prelude::{self, FollowRelation},
user,
}, lysand::http::main_lysand_url_to_user_and_model, utils::generate_follow_req_id, API_DOMAIN, DB, FEDERATION_CONFIG
},
lysand::http::main_lysand_url_to_user_and_model,
utils::generate_follow_req_id,
API_DOMAIN, DB, FEDERATION_CONFIG,
};
use activitypub_federation::{
activity_sending::SendActivityTask, fetch::object_id::ObjectId, protocol::context::WithContext,
@ -73,10 +77,7 @@ async fn follow_request(follow: super::objects::Follow) -> Result<()> {
}
let data = FEDERATION_CONFIG.get().unwrap();
let author = main_lysand_url_to_user_and_model(follow.author.into()).await?;
println!(
"Followee URL: {}",
&follow.followee.to_string()
);
println!("Followee URL: {}", &follow.followee.to_string());
let followee = lysand_url_to_user_and_model(follow.followee.into()).await?;
let serial_ap_author = serde_json::from_str::<crate::objects::person::Person>(
&(author.1.ap_json.clone()).unwrap(),

View file

@ -15,7 +15,9 @@ use clap::Parser;
use database::Database;
use entities::post;
use http::{http_get_user, http_post_user_inbox, webfinger};
use lysand::http::{create_activity, fetch_lysand_post, fetch_post, fetch_user, lysand_inbox, query_post};
use lysand::http::{
create_activity, fetch_lysand_post, fetch_post, fetch_user, lysand_inbox, query_post,
};
use objects::person::{DbUser, Person};
use sea_orm::{ActiveModelTrait, DatabaseConnection, Set};
use serde::{Deserialize, Serialize};

View file

@ -167,7 +167,10 @@ impl Object for user::Model {
.filter(entities::user::Column::Url.eq(object_id.to_string()))
.one(data.database_connection.as_ref())
.await?;
println!("!!!!!!!!Reading user from id!!!!!!!!!!!: {}", res.clone().is_some());
println!(
"!!!!!!!!Reading user from id!!!!!!!!!!!: {}",
res.clone().is_some()
);
Ok(res)
}