mirror of https://gitlab.com/litecord/litecord.git
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:
parent
39c4fc991b
commit
73da3e0c8e
|
|
@ -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)
|
await app.dispatcher.sub('channel', peer_id)
|
||||||
|
|
||||||
# TODO: if not user id, userid=peerid
|
|
||||||
if user_id:
|
if user_id:
|
||||||
await send_sys_message(
|
await send_sys_message(
|
||||||
app, channel_id, MessageType.RECIPIENT_ADD,
|
app, channel_id, MessageType.RECIPIENT_ADD,
|
||||||
|
|
@ -128,10 +127,11 @@ async def gdm_remove_recipient(channel_id: int, peer_id: int, *, user_id=None):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if user_id:
|
author_id = peer_id if user_id is None else user_id
|
||||||
|
|
||||||
await send_sys_message(
|
await send_sys_message(
|
||||||
app, channel_id, MessageType.RECIPIENT_REMOVE,
|
app, channel_id, MessageType.RECIPIENT_REMOVE,
|
||||||
user_id, peer_id
|
author_id, peer_id
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue