From 73da3e0c8e3914fe25192f69bc2a4c551622faa9 Mon Sep 17 00:00:00 2001 From: Luna Date: Tue, 19 Feb 2019 18:58:18 -0300 Subject: [PATCH] dm_channels: use peer=author on gdm_remove_recipient ...at least thats how i recall it: RECIPIENT_REMOVE messages show the user leaving (not being kicked by someone) if they are the author of the message. --- litecord/blueprints/dm_channels.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/litecord/blueprints/dm_channels.py b/litecord/blueprints/dm_channels.py index 192c12a..f4e4327 100644 --- a/litecord/blueprints/dm_channels.py +++ b/litecord/blueprints/dm_channels.py @@ -96,7 +96,6 @@ async def gdm_add_recipient(channel_id: int, peer_id: int, *, user_id=None): await app.dispatcher.sub('channel', peer_id) - # TODO: if not user id, userid=peerid if user_id: await send_sys_message( app, channel_id, MessageType.RECIPIENT_ADD, @@ -128,11 +127,12 @@ async def gdm_remove_recipient(channel_id: int, peer_id: int, *, user_id=None): } ) - if user_id: - await send_sys_message( - app, channel_id, MessageType.RECIPIENT_REMOVE, - user_id, peer_id - ) + author_id = peer_id if user_id is None else user_id + + await send_sys_message( + app, channel_id, MessageType.RECIPIENT_REMOVE, + author_id, peer_id + ) async def gdm_destroy(channel_id):