From 3e15f9a5183ec2f13b17368aa81e16c1f5c873d3 Mon Sep 17 00:00:00 2001 From: Luna Date: Mon, 30 Sep 2019 10:43:30 -0300 Subject: [PATCH] users: send user and presence updates for deleted user --- litecord/blueprints/users.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/litecord/blueprints/users.py b/litecord/blueprints/users.py index 4127a4a..854f2a6 100644 --- a/litecord/blueprints/users.py +++ b/litecord/blueprints/users.py @@ -571,4 +571,14 @@ async def delete_account(): await delete_user(user_id) await user_disconnect(user_id) + # we dispatch both a USER_UPDATE and a PRESENCE_UPDATE + # just to keep proper state for all the users. + await mass_user_update(user_id) + await app.presence.dispatch_pres(user_id, { + 'afk': False, + 'status': 'offline', + 'game': None, + 'since': 0, + }) + return '', 204