From 54a1d283950ad593530d2205905009e1615e1b6e Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sat, 4 Jun 2022 20:47:02 +0530 Subject: [PATCH] feat: impl archive user if not exists --- src/spider.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/spider.rs b/src/spider.rs index b2536ce..fd28b8e 100644 --- a/src/spider.rs +++ b/src/spider.rs @@ -73,6 +73,15 @@ impl Ctx { let msg = u.as_ref().into(); db.add_user(&msg).await.unwrap(); federate.create_user(&msg).await.unwrap(); + } else { + if !federate + .user_exists(username, gitea.get_hostname()) + .await + .unwrap() + { + let msg = u.as_ref().into(); + federate.create_user(&msg).await.unwrap(); + } } }