fix(cli): logging

This commit is contained in:
əlemi 2024-12-27 02:36:15 +01:00
parent a7cbbddc61
commit 86557a8fcc
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -31,6 +31,7 @@ pub async fn fix_activities(ctx: upub::Context, likes: bool, announces: bool) ->
.one(ctx.db())
.await?
{
tracing::info!("joining like {} to activity {}", like.internal, activity.id);
let mut active = like.into_active_model();
active.activity = sea_orm::Set(Some(activity.internal));
active.update(ctx.db()).await?;
@ -51,15 +52,15 @@ pub async fn fix_activities(ctx: upub::Context, likes: bool, announces: bool) ->
let internal_oid = ok_or_continue!(upub::model::object::Entity::ap_to_internal(&oid, ctx.db()).await?);
let uid = activity.actor;
let internal_uid = ok_or_continue!(upub::model::actor::Entity::ap_to_internal(&uid, ctx.db()).await?);
if let Some(like) = upub::model::announce::Entity::find()
if let Some(announce) = upub::model::announce::Entity::find()
.filter(upub::model::announce::Column::Object.eq(internal_oid))
.filter(upub::model::announce::Column::Actor.eq(internal_uid))
.filter(upub::model::announce::Column::Published.eq(activity.published))
.one(ctx.db())
.await?
{
tracing::info!("joining like {} to activity {}", like.internal, activity.id);
let mut active = like.into_active_model();
tracing::info!("joining announce {} to activity {}", announce.internal, activity.id);
let mut active = announce.into_active_model();
active.activity = sea_orm::Set(Some(activity.internal));
active.update(ctx.db()).await?;
}