From bba07709b71e4c3dc2bbdecaf2ecffed850aebcd Mon Sep 17 00:00:00 2001
From: f00wl <f00wl@felinn.org>
Date: Fri, 29 Jul 2022 13:23:39 +0200
Subject: [PATCH] Fix profile deletion/purge * Use synpase api inplace of calls
 to undefined axon lib

---
 hiboo/application/social.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/hiboo/application/social.py b/hiboo/application/social.py
index 6f9fded..6405624 100644
--- a/hiboo/application/social.py
+++ b/hiboo/application/social.py
@@ -144,17 +144,15 @@ class SynapseApplication(base.SAMLApplication):
     def delete_without_purging(self, profile):
         """ Delete a user account from Matrix
         """
-        client = self.get_axon(profile.service)
         mxid = "@" + profile.username + ":" + profile.service.config.get("domain")
-        client.delete_user(mxid, erase=False)
+        self.api(profile.service, "post", "v1/dasactivate/" + mxid, data=dict(erase=False))
 
     @base.hook(models.Profile.START, "purge", "purge-blocked", "purge-deleted")
     def delete_with_purging(self, profile):
         """ Purge a user account from Matrix
         """
-        client = self.get_axon(profile.service)
         mxid = "@" + profile.username + ":" + profile.service.config.get("domain")
-        client.delete_user(mxid, erase=True)
+        self.api(profile.service, "post", "v1/dasactivate/" + mxid, data=dict(erase=True))
 
 
 @register("writefreely")
-- 
GitLab