Skip to content
Snippets Groups Projects
Unverified Commit bba07709 authored by f00wl's avatar f00wl
Browse files

Fix profile deletion/purge

* Use synpase api inplace of calls to undefined axon lib
parent c75b0309
No related branches found
No related tags found
No related merge requests found
...@@ -144,17 +144,15 @@ class SynapseApplication(base.SAMLApplication): ...@@ -144,17 +144,15 @@ class SynapseApplication(base.SAMLApplication):
def delete_without_purging(self, profile): def delete_without_purging(self, profile):
""" Delete a user account from Matrix """ Delete a user account from Matrix
""" """
client = self.get_axon(profile.service)
mxid = "@" + profile.username + ":" + profile.service.config.get("domain") 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") @base.hook(models.Profile.START, "purge", "purge-blocked", "purge-deleted")
def delete_with_purging(self, profile): def delete_with_purging(self, profile):
""" Purge a user account from Matrix """ Purge a user account from Matrix
""" """
client = self.get_axon(profile.service)
mxid = "@" + profile.username + ":" + profile.service.config.get("domain") 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") @register("writefreely")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment