compose: Delete drafts with attachments.

Draft messages containing attachments, polls, or other items that cannot be locally 
echoed would not be deleted after sending the message. 

The explanation is simple: We only cleared the draft associated with a message in the 
`reify_message_id` local echo code path.

Fixes #24063.
This commit is contained in:
Sahil Singh
2023-01-26 03:47:51 +05:30
committed by GitHub
parent dedea23745
commit d05f672132

View File

@@ -203,6 +203,9 @@ export function clear_compose_box() {
export function send_message_success(local_id, message_id, locally_echoed) {
if (!locally_echoed) {
if ($("#compose-textarea").data("draft-id")) {
drafts.draft_model.deleteDraft($("#compose-textarea").data("draft-id"));
}
clear_compose_box();
}