NeoMutt  2025-12-11-980-ge38c27
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Attach Function API

Prototype for a Attach Function. More...

+ Collaboration diagram for Attach Function API:

Functions

static int op_attach_collapse (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 toggle display of subparts - Implements attach_function_t -
 
static int op_attach_delete (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 delete the current entry - Implements attach_function_t -
 
static int op_attach_edit_type (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 edit attachment content type - Implements attach_function_t -
 
static int op_attach_pipe (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 pipe message/attachment to a shell command - Implements attach_function_t -
 
static int op_attach_print (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 print the current entry - Implements attach_function_t -
 
static int op_attach_save (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 save message/attachment to a mailbox/file - Implements attach_function_t -
 
static int op_attach_undelete (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 undelete the current entry - Implements attach_function_t -
 
static int op_attach_view (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 view attachment using mailcap entry if necessary - Implements attach_function_t -
 
static int op_attach_view_mailcap (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 force viewing of attachment using mailcap - Implements attach_function_t -
 
static int op_attach_view_pager (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 view attachment in pager using copiousoutput mailcap - Implements attach_function_t -
 
static int op_attach_view_text (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 view attachment as text - Implements attach_function_t -
 
static int op_bounce_message (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 remail a message to another user - Implements attach_function_t -
 
static int op_check_traditional (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 check for classic PGP - Implements attach_function_t -
 
static int op_compose_to_sender (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 compose new message to the current message sender - Implements attach_function_t -
 
static int op_quit (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 Save changes and exit this dialog - Implements attach_function_t -.
 
static int op_extract_keys (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 extract supported public keys - Implements attach_function_t -
 
static int op_forward_message (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 forward a message with comments - Implements attach_function_t -
 
static int op_list_subscribe (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 subscribe to a mailing list - Implements attach_function_t -
 
static int op_list_unsubscribe (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 unsubscribe from a mailing list - Implements attach_function_t -
 
static int op_reply (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 reply to a message - Implements attach_function_t -
 
static int op_resend (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 use the current message as a template for a new one - Implements attach_function_t -
 
static int op_followup (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 followup to newsgroup - Implements attach_function_t -
 
static int op_forward_to_group (struct AttachFunctionData *fdata, const struct KeyEvent *event)
 forward to newsgroup - Implements attach_function_t -
 

Detailed Description

Prototype for a Attach Function.

Parameters
fdataAttach Function context data
eventEvent to process
Return values
enumFunctionRetval
Precondition
fdata is not NULL
event is not NULL

Function Documentation

◆ op_attach_collapse()

static int op_attach_collapse ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

toggle display of subparts - Implements attach_function_t -

Definition at line 247 of file functions.c.

248{
249 struct AttachPrivateData *priv = fdata->priv;
250 struct AttachPtr *cur_att = current_attachment(priv->actx, priv->menu);
251 if (!cur_att->body->parts)
252 {
253 mutt_error(_("There are no subparts to show"));
254 return FR_ERROR;
255 }
256 attach_collapse(priv->actx, priv->menu, fdata->n->sub);
257 mutt_update_recvattach_menu(priv->actx, priv->menu, false);
258 return FR_SUCCESS;
259}
static void attach_collapse(struct AttachCtx *actx, struct Menu *menu, struct ConfigSubset *sub)
Close the tree of the current attachment.
Definition functions.c:146
@ FR_SUCCESS
Valid function - successfully performed.
Definition dispatcher.h:40
@ FR_ERROR
Valid function - error occurred.
Definition dispatcher.h:39
#define mutt_error(...)
Definition logging2.h:94
#define _(a)
Definition message.h:28
void mutt_update_recvattach_menu(struct AttachCtx *actx, struct Menu *menu, bool init)
Update the Attachment Menu.
struct AttachPtr * current_attachment(struct AttachCtx *actx, struct Menu *menu)
Get the current attachment.
Definition recvattach.c:71
struct AttachPrivateData * priv
Attach private data.
Definition functions.h:35
struct NeoMutt * n
NeoMutt application data.
Definition functions.h:34
Private state data for Attachments.
struct Menu * menu
Current Menu.
struct AttachCtx * actx
List of all Attachments.
An email to which things will be attached.
Definition attach.h:36
struct Body * body
Attachment.
Definition attach.h:37
struct Body * parts
parts of a multipart or message/rfc822
Definition body.h:73
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
+ Here is the call graph for this function:

◆ op_attach_delete()

static int op_attach_delete ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

delete the current entry - Implements attach_function_t -

Supports repeat-count: 5<delete-entry> deletes the current entry and the next 4 (only multipart attachments can be deleted; non-multipart entries in the working set are silently skipped). Overruns are silently capped at the end of the list.

Definition at line 311 of file functions.c.

312{
313 struct AttachPrivateData *priv = fdata->priv;
314 if (check_readonly(priv->mailbox))
315 return FR_ERROR;
316
317 if (priv->mailbox->type == MUTT_POP)
318 {
320 mutt_error(_("Can't delete attachment from POP server"));
321 return FR_ERROR;
322 }
323
324 if (priv->mailbox->type == MUTT_NNTP)
325 {
327 mutt_error(_("Can't delete attachment from news server"));
328 return FR_ERROR;
329 }
330
331 if ((WithCrypto != 0) && (priv->actx->email->security & SEC_ENCRYPT))
332 {
333 mutt_message(_("Deletion of attachments from encrypted messages is unsupported"));
334 return FR_ERROR;
335 }
336 if ((WithCrypto != 0) && (priv->actx->email->security & (SEC_SIGN | SEC_PARTSIGN)))
337 {
338 mutt_message(_("Deletion of attachments from signed messages may invalidate the signature"));
339 }
340
341 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
342 if (aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix,
343 event->count) < 0)
344 {
345 ARRAY_FREE(&aa);
346 return FR_ERROR;
347 }
348
349 if (ARRAY_EMPTY(&aa))
350 {
351 ARRAY_FREE(&aa);
352 return FR_NO_ACTION;
353 }
354
355 int changed = 0;
356 int blocked = 0;
357 attach_apply_set_deleted(&aa, true, &changed, &blocked);
358 const int num = ARRAY_SIZE(&aa);
359 ARRAY_FREE(&aa);
360
361 if (blocked > 0)
362 mutt_message(_("Only deletion of multipart attachments is supported"));
363
364 if (changed == 0)
365 return blocked ? FR_ERROR : FR_NO_ACTION;
366
367 if (priv->menu->tag_prefix)
368 {
370 }
371 else
372 {
373 const bool c_resolve = cs_subset_bool(fdata->n->sub, "resolve");
374 const int next = menu_get_index(priv->menu) + num;
375 if (c_resolve && (next < priv->menu->max))
376 {
377 menu_set_index(priv->menu, next);
378 }
379 else
380 {
382 }
383 }
384
385 return FR_SUCCESS;
386}
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition array.h:74
#define ARRAY_SIZE(head)
The number of elements stored.
Definition array.h:87
#define ARRAY_FREE(head)
Release all memory.
Definition array.h:209
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
Definition array.h:58
static void attach_apply_set_deleted(struct AttachPtrArray *apa, bool deleted, int *num_changed, int *num_blocked)
Apply the deleted flag to a working set of attachments.
Definition functions.c:271
static bool check_readonly(struct Mailbox *m)
Check if the Mailbox is readonly.
Definition functions.c:199
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
@ MUTT_POP
'POP3' Mailbox type
Definition mailbox.h:51
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
Definition mailbox.h:48
@ FR_NO_ACTION
Valid function - no action performed.
Definition dispatcher.h:38
void mutt_flushinp(void)
MacroEvents moved to KeyModuleData UngetKeyEvents moved to KeyModuleData.
Definition get.c:81
#define mutt_message(...)
Definition logging2.h:93
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition menu.c:177
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:153
@ MENU_REDRAW_INDEX
Redraw the index.
Definition lib.h:61
@ MENU_REDRAW_CURRENT
Redraw the current line of the menu.
Definition lib.h:63
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:167
@ SEC_PARTSIGN
Not all parts of the email is signed.
Definition lib.h:96
@ SEC_SIGN
Email is signed.
Definition lib.h:93
@ SEC_ENCRYPT
Email is encrypted.
Definition lib.h:92
#define WithCrypto
Definition lib.h:132
int aa_add_selection(struct AttachPtrArray *aa, struct AttachCtx *actx, struct Menu *menu, bool use_tagged, int count)
Build a working set of Attachments for an action.
Definition selection.c:125
struct Email * email
Used by recvattach for updating.
Definition attach.h:66
struct Mailbox * mailbox
Current Mailbox.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Definition email.h:43
int count
Optional count prefix, e.g. 3 for 3j
Definition get.h:78
enum MailboxType type
Mailbox type.
Definition mailbox.h:104
bool tag_prefix
User has pressed <tag-prefix>
Definition lib.h:92
+ Here is the call graph for this function:

◆ op_attach_edit_type()

static int op_attach_edit_type ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

edit attachment content type - Implements attach_function_t -

Definition at line 391 of file functions.c.

392{
393 struct AttachPrivateData *priv = fdata->priv;
394 recvattach_edit_content_type(priv->actx, priv->menu, priv->actx->email);
396 return FR_SUCCESS;
397}
void recvattach_edit_content_type(struct AttachCtx *actx, struct Menu *menu, struct Email *e)
Edit the content type of an attachment.
Definition recvattach.c:889
+ Here is the call graph for this function:

◆ op_attach_pipe()

static int op_attach_pipe ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

pipe message/attachment to a shell command - Implements attach_function_t -

Definition at line 402 of file functions.c.

403{
404 struct AttachPrivateData *priv = fdata->priv;
405 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
406 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
407 mutt_pipe_attachment_list(&aa, false);
408 ARRAY_FREE(&aa);
409 return FR_SUCCESS;
410}
void mutt_pipe_attachment_list(struct AttachPtrArray *aa, bool filter)
Pipe selected attachments to a command.
Definition recvattach.c:699
+ Here is the call graph for this function:

◆ op_attach_print()

static int op_attach_print ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

print the current entry - Implements attach_function_t -

Definition at line 415 of file functions.c.

416{
417 struct AttachPrivateData *priv = fdata->priv;
418 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
419 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
421 ARRAY_FREE(&aa);
422 return FR_SUCCESS;
423}
void mutt_print_attachment_list(struct AttachPtrArray *aa)
Print selected attachments.
Definition recvattach.c:848
+ Here is the call graph for this function:

◆ op_attach_save()

static int op_attach_save ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

save message/attachment to a mailbox/file - Implements attach_function_t -

Definition at line 428 of file functions.c.

429{
430 struct AttachPrivateData *priv = fdata->priv;
431 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
432 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
433 mutt_save_attachment_list(&aa, priv->actx->email, priv->menu);
434
435 const bool c_resolve = cs_subset_bool(fdata->n->sub, "resolve");
436 const int index = menu_get_index(priv->menu) + 1;
437 if ((ARRAY_SIZE(&aa) == 1) && c_resolve && (index < priv->menu->max))
438 menu_set_index(priv->menu, index);
439 ARRAY_FREE(&aa);
440 return FR_SUCCESS;
441}
void mutt_save_attachment_list(struct AttachPtrArray *aa, struct Email *e, struct Menu *menu)
Save a list of selected attachments.
Definition recvattach.c:425
+ Here is the call graph for this function:

◆ op_attach_undelete()

static int op_attach_undelete ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

undelete the current entry - Implements attach_function_t -

Supports repeat-count: 5<undelete-entry> undeletes the current entry and the next 4. Overruns are silently capped at the end of the list.

Definition at line 449 of file functions.c.

450{
451 struct AttachPrivateData *priv = fdata->priv;
452 if (check_readonly(priv->mailbox))
453 return FR_ERROR;
454
455 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
456 if (aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix,
457 event->count) < 0)
458 {
459 ARRAY_FREE(&aa);
460 return FR_ERROR;
461 }
462
463 if (ARRAY_EMPTY(&aa))
464 {
465 ARRAY_FREE(&aa);
466 return FR_NO_ACTION;
467 }
468
469 attach_apply_set_deleted(&aa, false, NULL, NULL);
470 const int num = ARRAY_SIZE(&aa);
471 ARRAY_FREE(&aa);
472
473 if (priv->menu->tag_prefix)
474 {
476 }
477 else
478 {
479 const bool c_resolve = cs_subset_bool(fdata->n->sub, "resolve");
480 const int next = menu_get_index(priv->menu) + num;
481 if (c_resolve && (next < priv->menu->max))
482 {
483 menu_set_index(priv->menu, next);
484 }
485 else
486 {
488 }
489 }
490
491 return FR_SUCCESS;
492}
+ Here is the call graph for this function:

◆ op_attach_view()

static int op_attach_view ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

view attachment using mailcap entry if necessary - Implements attach_function_t -

This function handles:

  • OP_ATTACH_VIEW
  • OP_DISPLAY_HEADERS

Definition at line 501 of file functions.c.

502{
503 struct AttachPrivateData *priv = fdata->priv;
504 priv->op = mutt_attach_display_loop(priv->sub, priv->menu, event->op,
505 priv->actx->email, priv->actx, true);
507
508 return FR_CONTINUE;
509}
@ FR_CONTINUE
Remain in the Dialog.
Definition dispatcher.h:35
@ MENU_REDRAW_FULL
Redraw everything.
Definition lib.h:64
int mutt_attach_display_loop(struct ConfigSubset *sub, struct Menu *menu, int op, struct Email *e, struct AttachCtx *actx, bool recv)
Event loop for the Attachment menu.
Definition recvattach.c:919
int op
Op returned from the Pager, e.g. OP_NEXT_ENTRY.
struct ConfigSubset * sub
Config subset.
int op
Function opcode, e.g. OP_HELP.
Definition get.h:77
+ Here is the call graph for this function:

◆ op_attach_view_mailcap()

static int op_attach_view_mailcap ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

force viewing of attachment using mailcap - Implements attach_function_t -

Definition at line 514 of file functions.c.

515{
516 struct AttachPrivateData *priv = fdata->priv;
517 struct AttachPtr *cur_att = current_attachment(priv->actx, priv->menu);
518 mutt_view_attachment(cur_att->fp, cur_att->body, MUTT_VA_MAILCAP,
519 priv->actx->email, priv->actx, priv->menu->win);
521 return FR_SUCCESS;
522}
int mutt_view_attachment(FILE *fp, struct Body *b, enum ViewAttachMode mode, struct Email *e, struct AttachCtx *actx, struct MuttWindow *win)
View an attachment.
@ MUTT_VA_MAILCAP
Force viewing using mailcap entry.
Definition mutt_attach.h:46
FILE * fp
Used in the recvattach menu.
Definition attach.h:38
struct MuttWindow * win
Window holding the Menu.
Definition lib.h:94
+ Here is the call graph for this function:

◆ op_attach_view_pager()

static int op_attach_view_pager ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

view attachment in pager using copiousoutput mailcap - Implements attach_function_t -

Definition at line 527 of file functions.c.

528{
529 struct AttachPrivateData *priv = fdata->priv;
530 struct AttachPtr *cur_att = current_attachment(priv->actx, priv->menu);
531 mutt_view_attachment(cur_att->fp, cur_att->body, MUTT_VA_PAGER,
532 priv->actx->email, priv->actx, priv->menu->win);
534 return FR_SUCCESS;
535}
@ MUTT_VA_PAGER
View attachment in pager using copiousoutput mailcap.
Definition mutt_attach.h:48
+ Here is the call graph for this function:

◆ op_attach_view_text()

static int op_attach_view_text ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

view attachment as text - Implements attach_function_t -

Definition at line 540 of file functions.c.

541{
542 struct AttachPrivateData *priv = fdata->priv;
543 struct AttachPtr *cur_att = current_attachment(priv->actx, priv->menu);
544 mutt_view_attachment(cur_att->fp, cur_att->body, MUTT_VA_AS_TEXT,
545 priv->actx->email, priv->actx, priv->menu->win);
547 return FR_SUCCESS;
548}
@ MUTT_VA_AS_TEXT
Force viewing as text.
Definition mutt_attach.h:47
+ Here is the call graph for this function:

◆ op_bounce_message()

static int op_bounce_message ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

remail a message to another user - Implements attach_function_t -

Definition at line 553 of file functions.c.

554{
555 struct AttachPrivateData *priv = fdata->priv;
556 if (check_attach(priv))
557 return FR_ERROR;
558 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
559 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
560 attach_bounce_message(&aa, priv->mailbox);
561 ARRAY_FREE(&aa);
563 return FR_SUCCESS;
564}
static bool check_attach(struct AttachPrivateData *priv)
Check if in attach-message mode.
Definition functions.c:182
void attach_bounce_message(struct AttachPtrArray *aa, struct Mailbox *m)
Bounce function, from the attachment menu.
Definition recvcmd.c:158
+ Here is the call graph for this function:

◆ op_check_traditional()

static int op_check_traditional ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

check for classic PGP - Implements attach_function_t -

Definition at line 569 of file functions.c.

570{
571 struct AttachPrivateData *priv = fdata->priv;
572 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
573 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
575 {
576 priv->actx->email->security = crypt_query(NULL);
578 }
579 ARRAY_FREE(&aa);
580 return FR_SUCCESS;
581}
static int recvattach_pgp_check_traditional(struct AttachPtrArray *aa)
Is the Attachment inline PGP?
Definition functions.c:229
SecurityFlags crypt_query(struct Body *b)
Check out the type of encryption used.
Definition crypt.c:693
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition lib.h:106
+ Here is the call graph for this function:

◆ op_compose_to_sender()

static int op_compose_to_sender ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

compose new message to the current message sender - Implements attach_function_t -

Definition at line 586 of file functions.c.

587{
588 struct AttachPrivateData *priv = fdata->priv;
589 if (check_attach(priv))
590 return FR_ERROR;
591 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
592 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
594 ARRAY_FREE(&aa);
596 return FR_SUCCESS;
597}
void mutt_attach_mail_sender(struct AttachPtrArray *aa)
Compose an email to the sender in the email attachment.
Definition recvcmd.c:1074
+ Here is the call graph for this function:

◆ op_quit()

static int op_quit ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

Save changes and exit this dialog - Implements attach_function_t -.

Definition at line 602 of file functions.c.

603{
604 struct AttachPrivateData *priv = fdata->priv;
605 priv->actx->email->attach_del = false;
606 for (int i = 0; i < priv->actx->idxlen; i++)
607 {
608 if (priv->actx->idx[i]->body && priv->actx->idx[i]->body->deleted)
609 {
610 priv->actx->email->attach_del = true;
611 break;
612 }
613 }
614 if (priv->actx->email->attach_del)
615 priv->actx->email->changed = true;
616
617 mutt_actx_free(&priv->actx);
618 return FR_DONE;
619}
void mutt_actx_free(struct AttachCtx **ptr)
Free an Attachment Context.
Definition attach.c:198
@ FR_DONE
Exit the Dialog.
Definition dispatcher.h:36
struct AttachPtr ** idx
Array of attachments.
Definition attach.h:69
short idxlen
Number of attachmentes.
Definition attach.h:70
bool deleted
Attachment marked for deletion.
Definition body.h:88
bool changed
Email has been edited.
Definition email.h:77
bool attach_del
Has an attachment marked for deletion.
Definition email.h:99
+ Here is the call graph for this function:

◆ op_extract_keys()

static int op_extract_keys ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

extract supported public keys - Implements attach_function_t -

Definition at line 624 of file functions.c.

625{
626 struct AttachPrivateData *priv = fdata->priv;
628 return FR_NO_ACTION;
629
630 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
631 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
633 ARRAY_FREE(&aa);
635
636 return FR_SUCCESS;
637}
static void recvattach_extract_pgp_keys(struct AttachPtrArray *aa)
Extract PGP keys from attachments.
Definition functions.c:215
+ Here is the call graph for this function:

◆ op_forward_message()

static int op_forward_message ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

forward a message with comments - Implements attach_function_t -

Definition at line 642 of file functions.c.

643{
644 struct AttachPrivateData *priv = fdata->priv;
645 if (check_attach(priv))
646 return FR_ERROR;
647 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
648 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
649 mutt_attach_forward(&aa, priv->actx->email, priv->actx, SEND_NONE);
650 ARRAY_FREE(&aa);
652 return FR_SUCCESS;
653}
void mutt_attach_forward(struct AttachPtrArray *aa, struct Email *e, struct AttachCtx *actx, SendFlags flags)
Forward selected attachments.
Definition recvcmd.c:737
@ SEND_NONE
No flags are set.
Definition send.h:45
+ Here is the call graph for this function:

◆ op_list_subscribe()

static int op_list_subscribe ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

subscribe to a mailing list - Implements attach_function_t -

Definition at line 658 of file functions.c.

659{
660 struct AttachPrivateData *priv = fdata->priv;
661 if (check_attach(priv))
662 return FR_ERROR;
663
665}
bool mutt_send_list_subscribe(struct Mailbox *m, struct Email *e)
Send a mailing-list subscription email.
Definition send.c:2957
+ Here is the call graph for this function:

◆ op_list_unsubscribe()

static int op_list_unsubscribe ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

unsubscribe from a mailing list - Implements attach_function_t -

Definition at line 670 of file functions.c.

671{
672 struct AttachPrivateData *priv = fdata->priv;
673 if (check_attach(priv))
674 return FR_ERROR;
675
677}
bool mutt_send_list_unsubscribe(struct Mailbox *m, struct Email *e)
Send a mailing-list unsubscription email.
Definition send.c:2986
+ Here is the call graph for this function:

◆ op_reply()

static int op_reply ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

reply to a message - Implements attach_function_t -

This function handles:

  • OP_GROUP_CHAT_REPLY
  • OP_GROUP_REPLY
  • OP_LIST_REPLY
  • OP_REPLY

Definition at line 688 of file functions.c.

689{
690 struct AttachPrivateData *priv = fdata->priv;
691 if (check_attach(priv))
692 return FR_ERROR;
693
694 const int op = event->op;
695 SendFlags flags = SEND_REPLY;
696 if (op == OP_GROUP_REPLY)
697 flags |= SEND_GROUP_REPLY;
698 else if (op == OP_GROUP_CHAT_REPLY)
699 flags |= SEND_GROUP_CHAT_REPLY;
700 else if (op == OP_LIST_REPLY)
701 flags |= SEND_LIST_REPLY;
702
703 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
704 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
705 mutt_attach_reply(&aa, priv->mailbox, priv->actx->email, priv->actx, flags);
706 ARRAY_FREE(&aa);
708 return FR_SUCCESS;
709}
void mutt_attach_reply(struct AttachPtrArray *aa, struct Mailbox *m, struct Email *e, struct AttachCtx *actx, SendFlags flags)
Attach a reply.
Definition recvcmd.c:885
uint32_t SendFlags
Definition send.h:64
@ SEND_GROUP_CHAT_REPLY
Reply to all recipients preserving To/Cc.
Definition send.h:58
@ SEND_REPLY
Reply to sender.
Definition send.h:46
@ SEND_GROUP_REPLY
Reply to all.
Definition send.h:47
@ SEND_LIST_REPLY
Reply to mailing list.
Definition send.h:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ op_resend()

static int op_resend ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

use the current message as a template for a new one - Implements attach_function_t -

Definition at line 714 of file functions.c.

715{
716 struct AttachPrivateData *priv = fdata->priv;
717 if (check_attach(priv))
718 return FR_ERROR;
719 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
720 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
721 mutt_attach_resend(&aa, priv->mailbox);
722 ARRAY_FREE(&aa);
724 return FR_SUCCESS;
725}
void mutt_attach_resend(struct AttachPtrArray *aa, struct Mailbox *m)
Resend-message, from the attachment menu.
Definition recvcmd.c:255
+ Here is the call graph for this function:

◆ op_followup()

static int op_followup ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

followup to newsgroup - Implements attach_function_t -

Definition at line 732 of file functions.c.

733{
734 struct AttachPrivateData *priv = fdata->priv;
735 if (check_attach(priv))
736 return FR_ERROR;
737
738 struct AttachPtr *cur_att = current_attachment(priv->actx, priv->menu);
739 if (!cur_att->body->email || !cur_att->body->email->env)
740 {
741 mutt_error(_("You may only followup to message/rfc822 parts"));
742 return FR_ERROR;
743 }
744 if (!cur_att->body->email->env->followup_to ||
745 !mutt_istr_equal(cur_att->body->email->env->followup_to, "poster") ||
746 (query_quadoption(_("Reply by mail as poster prefers?"), fdata->n->sub,
747 "followup_to_poster") != MUTT_YES))
748 {
749 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
750 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
751 mutt_attach_reply(&aa, priv->mailbox, priv->actx->email, priv->actx, SEND_NEWS | SEND_REPLY);
752 ARRAY_FREE(&aa);
754 return FR_SUCCESS;
755 }
756
757 return op_reply(fdata, event);
758}
static int op_reply(struct AttachFunctionData *fdata, const struct KeyEvent *event)
reply to a message - Implements attach_function_t -
Definition functions.c:688
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition string.c:678
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition quad.h:39
enum QuadOption query_quadoption(const char *prompt, struct ConfigSubset *sub, const char *name)
Ask the user a quad-question.
Definition question.c:384
@ SEND_NEWS
Reply to a news article.
Definition send.h:59
struct Email * email
header information for message/rfc822
Definition body.h:74
struct Envelope * env
Envelope information.
Definition email.h:68
char * followup_to
List of 'followup-to' fields.
Definition envelope.h:80
+ Here is the call graph for this function:

◆ op_forward_to_group()

static int op_forward_to_group ( struct AttachFunctionData * fdata,
const struct KeyEvent * event )
static

forward to newsgroup - Implements attach_function_t -

Definition at line 763 of file functions.c.

764{
765 struct AttachPrivateData *priv = fdata->priv;
766 if (check_attach(priv))
767 return FR_ERROR;
768 struct AttachPtrArray aa = ARRAY_HEAD_INITIALIZER;
769 aa_add_selection(&aa, priv->actx, priv->menu, priv->menu->tag_prefix, event->count);
770 mutt_attach_forward(&aa, priv->actx->email, priv->actx, SEND_NEWS);
771 ARRAY_FREE(&aa);
773 return FR_SUCCESS;
774}
+ Here is the call graph for this function: