Skip to content
Snippets Groups Projects
Commit 14892673 authored by kaiyou's avatar kaiyou
Browse files

Handle Matrix account deletion

parent ddbe34c6
No related branches found
No related tags found
No related merge requests found
Pipeline #2827 passed
from hiboo import models
from hiboo.application import register, base
from wtforms import validators, fields
from flask_babel import lazy_gettext as _
......@@ -114,6 +115,22 @@ class SynapseApplication(base.SAMLApplication):
"application_synapse/user.html", user=user, profile=profile
)
@base.hook(models.Profile.START, "delete", "delete-blocked")
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)
@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)
@register("writefreely")
class WriteFreelyApplication(base.OIDCApplication):
......
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