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.
This commit is contained in:
Luna 2019-02-19 18:58:18 -03:00
parent 39c4fc991b
commit 73da3e0c8e
1 changed files with 6 additions and 6 deletions

View File

@ -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):