Skip to content

Commit

Permalink
compose: support adding attachments when groups are present
Browse files Browse the repository at this point in the history
  • Loading branch information
dcpurton authored and flatcap committed Jan 14, 2022
1 parent 149497e commit 5280087
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions compose/functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,16 @@ static int delete_attachment(struct AttachCtx *actx, int aidx)
*/
static void update_idx(struct Menu *menu, struct AttachCtx *actx, struct AttachPtr *ap)
{
ap->level = (actx->idxlen > 0) ? actx->idx[actx->idxlen - 1]->level : 0;
if (actx->idxlen)
actx->idx[actx->idxlen - 1]->body->next = ap->body;
ap->level = 0;
for (int i = actx->idxlen; i > 0; i--)
{
if (ap->level == actx->idx[i - 1]->level)
{
actx->idx[i - 1]->body->next = ap->body;
break;
}
}

ap->body->aptr = ap;
mutt_actx_add_attach(actx, ap);
update_menu(actx, menu, false);
Expand Down

0 comments on commit 5280087

Please sign in to comment.