diff --git a/queries-encrypted.c b/queries-encrypted.c index c2ea148a..088a732a 100644 --- a/queries-encrypted.c +++ b/queries-encrypted.c @@ -213,6 +213,12 @@ void tgl_do_send_encr_msg_action (struct tgl_state *TLS, struct tgl_message *M, out_int (CODE_decrypted_message_action_abort_key); out_long (M->action.exchange_id); break; + case tgl_message_action_delete_messages: + out_int (CODE_decrypted_message_action_delete_messages); + out_int(CODE_vector); + out_int(1); + out_long (M->id); + break; case tgl_message_action_noop: out_int (CODE_decrypted_message_action_noop); break; diff --git a/queries.c b/queries.c index c693a5da..4cf61da5 100644 --- a/queries.c +++ b/queries.c @@ -4178,6 +4178,13 @@ void tgl_do_delete_msg (struct tgl_state *TLS, tgl_message_id_t *_msg_id, void ( } return; } + struct tgl_message *M = tgl_message_get (TLS, id); + if (tgl_get_peer_type (M->to_id) == TGL_PEER_ENCR_CHAT) { + M->action.type=tgl_message_action_delete_messages; + M->flags |=TGLMF_SERVICE; + tgl_do_send_msg (TLS, M, 0, 0); + return; + } clear_packet (); if (msg_id.peer_type == TGL_PEER_CHANNEL) { out_int (CODE_channels_delete_messages);