NeoMutt  2025-12-11-117-gc1a713
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions.c File Reference

Compose functions. More...

#include "config.h"
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "conn/lib.h"
#include "gui/lib.h"
#include "mutt.h"
#include "lib.h"
#include "attach/lib.h"
#include "browser/lib.h"
#include "editor/lib.h"
#include "history/lib.h"
#include "hooks/lib.h"
#include "imap/lib.h"
#include "index/lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "ncrypt/lib.h"
#include "nntp/lib.h"
#include "pop/lib.h"
#include "question/lib.h"
#include "send/lib.h"
#include "attach_data.h"
#include "external.h"
#include "functions.h"
#include "globals.h"
#include "mutt_header.h"
#include "mutt_logging.h"
#include "muttlib.h"
#include "mview.h"
#include "mx.h"
#include "nntp/adata.h"
#include "protos.h"
#include "rfc3676.h"
#include "shared_data.h"
#include <libintl.h>
+ Include dependency graph for functions.c:

Go to the source code of this file.

Functions

void compose_init_keys (struct SubMenu *sm_generic)
 Initialise the Compose Keybindings - Implements ::init_keys_api.
 
static bool check_count (struct AttachCtx *actx)
 Check if there are any attachments.
 
static char * gen_cid (void)
 Generate a random Content ID.
 
static bool check_cid (const char *cid)
 Check if a Content-ID is valid.
 
static int check_attachments (struct AttachCtx *actx, struct ConfigSubset *sub)
 Check if any attachments have changed or been deleted.
 
static int delete_attachment (struct AttachCtx *actx, int aidx)
 Delete an attachment.
 
static void update_idx (struct Menu *menu, struct AttachCtx *actx, struct AttachPtr *ap)
 Add a new attachment to the message.
 
static void compose_attach_swap (struct Email *e, struct AttachCtx *actx, int first, int second)
 Swap two adjacent entries in the attachment list.
 
static int group_attachments (struct ComposeSharedData *shared, char *subtype)
 Group tagged attachments into a multipart group.
 
static int op_attachment_attach_file (struct ComposeSharedData *shared, int op)
 Attach files to this message - Implements compose_function_t -.
 
static int op_attachment_attach_key (struct ComposeSharedData *shared, int op)
 Attach a PGP public key - Implements compose_function_t -.
 
static int op_attachment_attach_message (struct ComposeSharedData *shared, int op)
 Attach messages to this message - Implements compose_function_t -.
 
static int op_attachment_detach (struct ComposeSharedData *shared, int op)
 Delete the current entry - Implements compose_function_t -.
 
static int op_attachment_edit_content_id (struct ComposeSharedData *shared, int op)
 Edit the 'Content-ID' of the attachment - Implements compose_function_t -.
 
static int op_attachment_edit_description (struct ComposeSharedData *shared, int op)
 Edit attachment description - Implements compose_function_t -.
 
static int op_attachment_edit_encoding (struct ComposeSharedData *shared, int op)
 Edit attachment transfer-encoding - Implements compose_function_t -.
 
static int op_attachment_edit_language (struct ComposeSharedData *shared, int op)
 Edit the 'Content-Language' of the attachment - Implements compose_function_t -.
 
static int op_attachment_edit_mime (struct ComposeSharedData *shared, int op)
 Edit attachment using mailcap entry - Implements compose_function_t -.
 
static int op_attachment_edit_type (struct ComposeSharedData *shared, int op)
 Edit attachment content type - Implements compose_function_t -.
 
static int op_attachment_filter (struct ComposeSharedData *shared, int op)
 Filter attachment through a shell command - Implements compose_function_t -.
 
static int op_attachment_get_attachment (struct ComposeSharedData *shared, int op)
 Get a temporary copy of an attachment - Implements compose_function_t -.
 
static int op_attachment_group_alts (struct ComposeSharedData *shared, int op)
 Group tagged attachments as 'multipart/alternative' - Implements compose_function_t -.
 
static int op_attachment_group_lingual (struct ComposeSharedData *shared, int op)
 Group tagged attachments as 'multipart/multilingual' - Implements compose_function_t -.
 
static int op_attachment_group_related (struct ComposeSharedData *shared, int op)
 Group tagged attachments as 'multipart/related' - Implements compose_function_t -.
 
static int op_attachment_move_down (struct ComposeSharedData *shared, int op)
 Move an attachment down in the attachment list - Implements compose_function_t -.
 
static int op_attachment_move_up (struct ComposeSharedData *shared, int op)
 Move an attachment up in the attachment list - Implements compose_function_t -.
 
static int op_attachment_new_mime (struct ComposeSharedData *shared, int op)
 Compose new attachment using mailcap entry - Implements compose_function_t -.
 
static int op_attachment_print (struct ComposeSharedData *shared, int op)
 Print the current entry - Implements compose_function_t -.
 
static int op_attachment_rename_attachment (struct ComposeSharedData *shared, int op)
 Send attachment with a different name - Implements compose_function_t -.
 
static int op_attachment_save (struct ComposeSharedData *shared, int op)
 Save message/attachment to a mailbox/file - Implements compose_function_t -.
 
static int op_attachment_toggle_disposition (struct ComposeSharedData *shared, int op)
 Toggle disposition between inline/attachment - Implements compose_function_t -.
 
static int op_attachment_toggle_recode (struct ComposeSharedData *shared, int op)
 Toggle recoding of this attachment - Implements compose_function_t -.
 
static int op_attachment_toggle_unlink (struct ComposeSharedData *shared, int op)
 Toggle whether to delete file after sending it - Implements compose_function_t -.
 
static int op_attachment_ungroup (struct ComposeSharedData *shared, int op)
 Ungroup a 'multipart' attachment - Implements compose_function_t -.
 
static int op_attachment_update_encoding (struct ComposeSharedData *shared, int op)
 Update an attachment's encoding info - Implements compose_function_t -.
 
static int op_envelope_edit_headers (struct ComposeSharedData *shared, int op)
 Edit the message with headers - Implements compose_function_t -.
 
static int op_compose_edit_file (struct ComposeSharedData *shared, int op)
 Edit the file to be attached - Implements compose_function_t -.
 
static int op_compose_edit_message (struct ComposeSharedData *shared, int op)
 Edit the message - Implements compose_function_t -.
 
static int op_compose_ispell (struct ComposeSharedData *shared, int op)
 Run ispell on the message - Implements compose_function_t -.
 
static int op_compose_postpone_message (struct ComposeSharedData *shared, int op)
 Save this message to send later - Implements compose_function_t -.
 
static int op_compose_rename_file (struct ComposeSharedData *shared, int op)
 Rename/move an attached file - Implements compose_function_t -.
 
static int op_compose_send_message (struct ComposeSharedData *shared, int op)
 Send the message - Implements compose_function_t -.
 
static int op_compose_write_message (struct ComposeSharedData *shared, int op)
 Write the message to a folder - Implements compose_function_t -.
 
static int op_display_headers (struct ComposeSharedData *shared, int op)
 Display message and toggle header weeding - Implements compose_function_t -.
 
static int op_exit (struct ComposeSharedData *shared, int op)
 Exit this menu - Implements compose_function_t -.
 
static int op_forget_passphrase (struct ComposeSharedData *shared, int op)
 Wipe passphrases from memory - Implements compose_function_t -.
 
int compose_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Compose function - Implements function_dispatcher_t -.
 

Variables

static const struct MenuFuncOp OpCompose []
 Functions for the Compose Menu.
 
static const struct MenuOpSeq ComposeDefaultBindings []
 Key bindings for the Compose Menu.
 
static const struct ComposeFunction ComposeFunctions []
 All the NeoMutt functions that the Compose supports.
 

Detailed Description

Compose functions.

Authors
  • Pietro Cerutti
  • Richard Russon
  • David Purton

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file functions.c.

Function Documentation

◆ compose_init_keys()

void compose_init_keys ( struct SubMenu * sm_generic)

Initialise the Compose Keybindings - Implements ::init_keys_api.

Definition at line 218 of file functions.c.

219{
220 struct MenuDefinition *md = NULL;
221 struct SubMenu *sm = NULL;
222
224 md = km_register_menu(MENU_COMPOSE, "compose");
225 km_menu_add_submenu(md, sm);
226 km_menu_add_submenu(md, sm_generic);
228}
static const struct MenuFuncOp OpCompose[]
Functions for the Compose Menu.
Definition functions.c:87
static const struct MenuOpSeq ComposeDefaultBindings[]
Key bindings for the Compose Menu.
Definition functions.c:155
void km_menu_add_submenu(struct MenuDefinition *md, struct SubMenu *sm)
Add a SubMenu to a Menu Definition.
Definition init.c:123
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
Definition init.c:91
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
Definition init.c:107
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
Definition init.c:136
Functions for a Dialog or Window.
Definition menu.h:81
Collection of related functions.
Definition menu.h:69
@ MENU_COMPOSE
Compose an email.
Definition type.h:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_count()

static bool check_count ( struct AttachCtx * actx)
static

Check if there are any attachments.

Parameters
actxAttachment context
Return values
trueThere are attachments

Definition at line 235 of file functions.c.

236{
237 if (actx->idxlen == 0)
238 {
239 mutt_error(_("There are no attachments"));
240 return false;
241 }
242
243 return true;
244}
#define mutt_error(...)
Definition logging2.h:94
#define _(a)
Definition message.h:28
short idxlen
Number of attachmentes.
Definition attach.h:68
+ Here is the caller graph for this function:

◆ gen_cid()

static char * gen_cid ( void )
static

Generate a random Content ID.

Return values
ptrContent ID
Note
The caller should free the string

Definition at line 252 of file functions.c.

253{
254 char rndid[MUTT_RANDTAG_LEN + 1];
255
256 mutt_rand_base32(rndid, sizeof(rndid) - 1);
257 rndid[MUTT_RANDTAG_LEN] = 0;
258
259 return mutt_str_dup(rndid);
260}
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition string.c:257
void mutt_rand_base32(char *buf, size_t buflen)
Fill a buffer with a base32-encoded random string.
Definition random.c:106
#define MUTT_RANDTAG_LEN
Definition sendlib.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_cid()

static bool check_cid ( const char * cid)
static

Check if a Content-ID is valid.

Parameters
cidContent-ID to check
Return values
trueContent-ID is valid
falseContent-ID is not valid

Definition at line 268 of file functions.c.

269{
270 static const char *check = "^[-\\.0-9@A-Z_a-z]+$";
271
272 struct Regex *check_cid_regex = mutt_regex_new(check, 0, NULL);
273
274 const bool valid = mutt_regex_match(check_cid_regex, cid);
275
276 mutt_regex_free(&check_cid_regex);
277
278 return valid;
279}
struct Regex * mutt_regex_new(const char *str, uint32_t flags, struct Buffer *err)
Create an Regex from a string.
Definition regex.c:80
void mutt_regex_free(struct Regex **ptr)
Free a Regex object.
Definition regex.c:118
bool mutt_regex_match(const struct Regex *regex, const char *str)
Shorthand to mutt_regex_capture()
Definition regex.c:614
Cached regular expression.
Definition regex3.h:86
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_attachments()

static int check_attachments ( struct AttachCtx * actx,
struct ConfigSubset * sub )
static

Check if any attachments have changed or been deleted.

Parameters
actxAttachment context
subConfigSubset
Return values
0Success
-1Error

Definition at line 288 of file functions.c.

289{
290 int rc = -1;
291 struct stat st = { 0 };
292 struct Buffer *pretty = NULL, *msg = NULL;
293
294 for (int i = 0; i < actx->idxlen; i++)
295 {
296 if (actx->idx[i]->body->type == TYPE_MULTIPART)
297 continue;
298 if (stat(actx->idx[i]->body->filename, &st) != 0)
299 {
300 if (!pretty)
301 pretty = buf_pool_get();
302 buf_strcpy(pretty, actx->idx[i]->body->filename);
303 buf_pretty_mailbox(pretty);
304 /* L10N: This message is displayed in the compose menu when an attachment
305 doesn't stat. %d is the attachment number and %s is the attachment
306 filename. The filename is located last to avoid a long path hiding
307 the error message. */
308 mutt_error(_("Attachment #%d no longer exists: %s"), i + 1, buf_string(pretty));
309 goto cleanup;
310 }
311
312 if (actx->idx[i]->body->stamp < st.st_mtime)
313 {
314 if (!pretty)
315 pretty = buf_pool_get();
316 buf_strcpy(pretty, actx->idx[i]->body->filename);
317 buf_pretty_mailbox(pretty);
318
319 if (!msg)
320 msg = buf_pool_get();
321 /* L10N: This message is displayed in the compose menu when an attachment
322 is modified behind the scenes. %d is the attachment number and %s is
323 the attachment filename. The filename is located last to avoid a long
324 path hiding the prompt question. */
325 buf_printf(msg, _("Attachment #%d modified. Update encoding for %s?"),
326 i + 1, buf_string(pretty));
327
329 if (ans == MUTT_YES)
330 mutt_update_encoding(actx->idx[i]->body, sub);
331 else if (ans == MUTT_ABORT)
332 goto cleanup;
333 }
334 }
335
336 rc = 0;
337
338cleanup:
339 buf_pool_release(&pretty);
340 buf_pool_release(&msg);
341 return rc;
342}
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition buffer.c:161
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
@ TYPE_MULTIPART
Type: 'multipart/*'.
Definition mime.h:37
void buf_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
Definition muttlib.c:519
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:82
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:96
QuadOption
Possible values for a quad-option.
Definition quad.h:36
@ MUTT_ABORT
User aborted the question (with Ctrl-G)
Definition quad.h:37
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition quad.h:39
enum QuadOption query_yesorno(const char *prompt, enum QuadOption def)
Ask the user a Yes/No question.
Definition question.c:326
void mutt_update_encoding(struct Body *b, struct ConfigSubset *sub)
Update the encoding type.
Definition sendlib.c:423
struct AttachPtr ** idx
Array of attachments.
Definition attach.h:67
struct Body * body
Attachment.
Definition attach.h:36
time_t stamp
Time stamp of last encoding update.
Definition body.h:77
unsigned int type
content-type primary type, ContentType
Definition body.h:40
char * filename
When sending a message, this is the file to which this structure refers.
Definition body.h:59
String manipulation buffer.
Definition buffer.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete_attachment()

static int delete_attachment ( struct AttachCtx * actx,
int aidx )
static

Delete an attachment.

Parameters
actxAttachment context
aidxIndex number of attachment to delete
Return values
0Success
-1Error

Definition at line 351 of file functions.c.

352{
353 if (!actx || (aidx < 0) || (aidx >= actx->idxlen))
354 return -1;
355
356 struct AttachPtr **idx = actx->idx;
357 struct Body *b_previous = NULL;
358 struct Body *b_parent = NULL;
359
360 if (aidx == 0)
361 {
362 struct Body *b = actx->idx[0]->body;
363 if (!b->next) // There's only one attachment left
364 {
365 mutt_error(_("You may not delete the only attachment"));
366 return -1;
367 }
368
369 if (cs_subset_bool(NeoMutt->sub, "compose_confirm_detach_first"))
370 {
371 /* L10N: Prompt when trying to hit <detach-file> on the first entry in
372 the compose menu. This entry is most likely the message they just
373 typed. Hitting yes will remove the entry and unlink the file, so
374 it's worth confirming they really meant to do it. */
375 enum QuadOption ans = query_yesorno_help(_("Really delete the main message?"),
377 "compose_confirm_detach_first");
378 if (ans == MUTT_NO)
379 {
380 idx[aidx]->body->tagged = false;
381 return -1;
382 }
383 }
384 }
385
386 if (idx[aidx]->level > 0)
387 {
388 if (attach_body_parent(idx[0]->body, NULL, idx[aidx]->body, &b_parent))
389 {
390 if (attach_body_count(b_parent->parts, false) < 3)
391 {
392 mutt_error(_("Can't leave group with only one attachment"));
393 return -1;
394 }
395 }
396 }
397
398 // reorder body pointers
399 if (aidx > 0)
400 {
401 if (attach_body_previous(idx[0]->body, idx[aidx]->body, &b_previous))
402 b_previous->next = idx[aidx]->body->next;
403 else if (attach_body_parent(idx[0]->body, NULL, idx[aidx]->body, &b_parent))
404 b_parent->parts = idx[aidx]->body->next;
405 }
406
407 // free memory
408 int part_count = 1;
409 if (aidx < (actx->idxlen - 1))
410 {
411 if ((idx[aidx]->body->type == TYPE_MULTIPART) &&
412 (idx[aidx + 1]->level > idx[aidx]->level))
413 {
414 part_count += attach_body_count(idx[aidx]->body->parts, true);
415 }
416 }
417 idx[aidx]->body->next = NULL;
418 mutt_body_free(&(idx[aidx]->body));
419 for (int i = 0; i < part_count; i++)
420 {
421 FREE(&idx[aidx + i]->tree);
422 FREE(&idx[aidx + i]);
423 }
424
425 // reorder attachment list
426 for (int i = aidx; i < (actx->idxlen - part_count); i++)
427 idx[i] = idx[i + part_count];
428 for (int i = 0; i < part_count; i++)
429 idx[actx->idxlen - i - 1] = NULL;
430 actx->idxlen -= part_count;
431
432 return 0;
433}
bool attach_body_parent(struct Body *start, struct Body *start_parent, struct Body *body, struct Body **body_parent)
Find the parent of a body.
Definition lib.c:71
int attach_body_count(struct Body *body, bool recurse)
Count bodies.
Definition lib.c:42
bool attach_body_previous(struct Body *start, struct Body *body, struct Body **previous)
Find the previous body of a body.
Definition lib.c:142
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
void mutt_body_free(struct Body **ptr)
Free a Body.
Definition body.c:58
#define FREE(x)
Definition memory.h:63
@ MUTT_NO
User answered 'No', or assume 'No'.
Definition quad.h:38
enum QuadOption query_yesorno_help(const char *prompt, enum QuadOption def, struct ConfigSubset *sub, const char *name)
Ask the user a Yes/No question offering help.
Definition question.c:354
An email to which things will be attached.
Definition attach.h:35
The body of an email.
Definition body.h:36
struct Body * parts
parts of a multipart or message/rfc822
Definition body.h:73
bool tagged
This attachment is tagged.
Definition body.h:90
struct Body * next
next attachment in the list
Definition body.h:72
Container for Accounts, Notifications.
Definition neomutt.h:128
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:134
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_idx()

static void update_idx ( struct Menu * menu,
struct AttachCtx * actx,
struct AttachPtr * ap )
static

Add a new attachment to the message.

Parameters
menuCurrent menu
actxAttachment context
apAttachment to add

Definition at line 441 of file functions.c.

442{
443 ap->level = 0;
444 for (int i = actx->idxlen; i > 0; i--)
445 {
446 if (ap->level == actx->idx[i - 1]->level)
447 {
448 actx->idx[i - 1]->body->next = ap->body;
449 break;
450 }
451 }
452
453 ap->body->aptr = ap;
454 mutt_actx_add_attach(actx, ap);
455 update_menu(actx, menu, false);
456 menu_set_index(menu, actx->vcount - 1);
457}
void mutt_actx_add_attach(struct AttachCtx *actx, struct AttachPtr *attach)
Add an Attachment to an Attachment Context.
Definition attach.c:65
void update_menu(struct AttachCtx *actx, struct Menu *menu, bool init)
Redraw the compose window.
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:175
short vcount
The number of virtual attachments.
Definition attach.h:72
int level
Nesting depth of attachment.
Definition attach.h:40
struct AttachPtr * aptr
Menu information, used in recvattach.c.
Definition body.h:75
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compose_attach_swap()

static void compose_attach_swap ( struct Email * e,
struct AttachCtx * actx,
int first,
int second )
static

Swap two adjacent entries in the attachment list.

Parameters
eEmail
actxAttachment information
firstIndex of first attachment to swap
secondIndex of second attachment to swap

Definition at line 466 of file functions.c.

467{
468 struct AttachPtr **idx = actx->idx;
469
470 // check that attachments really are adjacent
471 if (idx[first]->body->next != idx[second]->body)
472 return;
473
474 // reorder Body pointers
475 if (first == 0)
476 {
477 // first attachment is the fundamental part
478 idx[first]->body->next = idx[second]->body->next;
479 idx[second]->body->next = idx[first]->body;
480 e->body = idx[second]->body;
481 }
482 else
483 {
484 // find previous attachment
485 struct Body *b_previous = NULL;
486 struct Body *b_parent = NULL;
487 if (attach_body_previous(e->body, idx[first]->body, &b_previous))
488 {
489 idx[first]->body->next = idx[second]->body->next;
490 idx[second]->body->next = idx[first]->body;
491 b_previous->next = idx[second]->body;
492 }
493 else if (attach_body_parent(e->body, NULL, idx[first]->body, &b_parent))
494 {
495 idx[first]->body->next = idx[second]->body->next;
496 idx[second]->body->next = idx[first]->body;
497 b_parent->parts = idx[second]->body;
498 }
499 }
500
501 // reorder attachment list
502 struct AttachPtr *saved = idx[second];
503 for (int i = second; i > first; i--)
504 idx[i] = idx[i - 1];
505 idx[first] = saved;
506
507 // if moved attachment is a group then move subparts too
508 if ((idx[first]->body->type == TYPE_MULTIPART) && (second < actx->idxlen - 1))
509 {
510 int i = second + 1;
511 while (idx[i]->level > idx[first]->level)
512 {
513 saved = idx[i];
514 int destidx = i - second + first;
515 for (int j = i; j > destidx; j--)
516 idx[j] = idx[j - 1];
517 idx[destidx] = saved;
518 i++;
519 if (i >= actx->idxlen)
520 break;
521 }
522 }
523}
struct Body * body
List of MIME parts.
Definition email.h:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ group_attachments()

static int group_attachments ( struct ComposeSharedData * shared,
char * subtype )
static

Group tagged attachments into a multipart group.

Parameters
sharedShared compose data
subtypeMIME subtype
Return values
FR_SUCCESSSuccess
FR_ERRORFailure

Definition at line 532 of file functions.c.

533{
534 struct AttachCtx *actx = shared->adata->actx;
535 int group_level = -1;
536 struct Body *bptr_parent = NULL;
537
538 // Attachments to be grouped must have the same parent
539 for (int i = 0; i < actx->idxlen; i++)
540 {
541 // check if all tagged attachments are at same level
542 if (actx->idx[i]->body->tagged)
543 {
544 if (group_level == -1)
545 {
546 group_level = actx->idx[i]->level;
547 }
548 else
549 {
550 if (group_level != actx->idx[i]->level)
551 {
552 mutt_error(_("Attachments to be grouped must have the same parent"));
553 return FR_ERROR;
554 }
555 }
556 // if not at top level check if all tagged attachments have same parent
557 if (group_level > 0)
558 {
559 if (bptr_parent)
560 {
561 struct Body *bptr_test = NULL;
562 if (!attach_body_parent(actx->idx[0]->body, NULL, actx->idx[i]->body, &bptr_test))
563 mutt_debug(LL_DEBUG5, "can't find parent\n");
564 if (bptr_test != bptr_parent)
565 {
566 mutt_error(_("Attachments to be grouped must have the same parent"));
567 return FR_ERROR;
568 }
569 }
570 else
571 {
572 if (!attach_body_parent(actx->idx[0]->body, NULL, actx->idx[i]->body, &bptr_parent))
573 mutt_debug(LL_DEBUG5, "can't find parent\n");
574 }
575 }
576 }
577 }
578
579 // Can't group all attachments unless at top level
580 if (bptr_parent)
581 {
582 if (shared->adata->menu->num_tagged == attach_body_count(bptr_parent->parts, false))
583 {
584 mutt_error(_("Can't leave group with only one attachment"));
585 return FR_ERROR;
586 }
587 }
588
589 struct Body *group = mutt_body_new();
590 group->type = TYPE_MULTIPART;
591 group->subtype = mutt_str_dup(subtype);
592 group->encoding = ENC_7BIT;
593
594 struct Body *bptr_first = NULL; // first tagged attachment
595 struct Body *bptr = NULL; // current tagged attachment
596 struct Body *group_parent = NULL; // parent of group
597 struct Body *group_previous = NULL; // previous body to group
598 struct Body *group_part = NULL; // current attachment in group
599 int group_idx = 0; // index in attachment list where group will be inserted
600 int group_last_idx = 0; // index of last part of previous found group
601 int group_parent_type = TYPE_OTHER;
602
603 for (int i = 0; i < actx->idxlen; i++)
604 {
605 bptr = actx->idx[i]->body;
606 if (bptr->tagged)
607 {
608 // set group properties based on first tagged attachment
609 if (!bptr_first)
610 {
611 group->disposition = bptr->disposition;
612 if (bptr->language && !mutt_str_equal(subtype, "multilingual"))
613 group->language = mutt_str_dup(bptr->language);
614 group_parent_type = bptr->aptr->parent_type;
615 bptr_first = bptr;
616 if (i > 0)
617 {
618 if (!attach_body_previous(shared->email->body, bptr, &group_previous))
619 {
620 mutt_debug(LL_DEBUG5, "couldn't find previous\n");
621 }
622 if (!attach_body_parent(shared->email->body, NULL, bptr, &group_parent))
623 {
624 mutt_debug(LL_DEBUG5, "couldn't find parent\n");
625 }
626 }
627 }
628
629 shared->adata->menu->num_tagged--;
630 bptr->tagged = false;
631 bptr->aptr->level++;
633
634 // append bptr to the group parts list and remove from email body list
635 struct Body *bptr_previous = NULL;
636 if (attach_body_previous(shared->email->body, bptr, &bptr_previous))
637 bptr_previous->next = bptr->next;
638 else if (attach_body_parent(shared->email->body, NULL, bptr, &bptr_parent))
639 bptr_parent->parts = bptr->next;
640 else
641 shared->email->body = bptr->next;
642
643 if (group_part)
644 {
645 // add bptr to group parts list
646 group_part->next = bptr;
647 group_part = group_part->next;
648 group_part->next = NULL;
649
650 // reorder attachments and set levels
651 int bptr_attachments = attach_body_count(bptr, true);
652 for (int j = i + 1; j < (i + bptr_attachments); j++)
653 actx->idx[j]->level++;
654 if (i > (group_last_idx + 1))
655 {
656 for (int j = 0; j < bptr_attachments; j++)
657 {
658 struct AttachPtr *saved = actx->idx[i + bptr_attachments - 1];
659 for (int k = i + bptr_attachments - 1; k > (group_last_idx + 1); k--)
660 actx->idx[k] = actx->idx[k - 1];
661 actx->idx[group_last_idx + 1] = saved;
662 }
663 }
664 i += bptr_attachments - 1;
665 group_last_idx += bptr_attachments;
666 }
667 else
668 {
669 group_idx = i;
670 group->parts = bptr;
671 group_part = bptr;
672 group_part->next = NULL;
673 int bptr_attachments = attach_body_count(bptr, true);
674 for (int j = i + 1; j < (i + bptr_attachments); j++)
675 actx->idx[j]->level++;
676 i += bptr_attachments - 1;
677 group_last_idx = i;
678 }
679 }
680 }
681
682 if (!bptr_first)
683 {
684 mutt_body_free(&group);
685 return FR_ERROR;
686 }
687
688 // set group->next
689 int next_aidx = group_idx + attach_body_count(group->parts, true);
690 if (group_parent)
691 {
692 // find next attachment with the same parent as the group
693 struct Body *b = NULL;
694 struct Body *b_parent = NULL;
695 while (next_aidx < actx->idxlen)
696 {
697 b = actx->idx[next_aidx]->body;
698 b_parent = NULL;
699 if (attach_body_parent(shared->email->body, NULL, b, &b_parent))
700 {
701 if (group_parent == b_parent)
702 {
703 group->next = b;
704 break;
705 }
706 }
707 next_aidx++;
708 }
709 }
710 else if (next_aidx < actx->idxlen)
711 {
712 // group is at top level
713 group->next = actx->idx[next_aidx]->body;
714 }
715
716 // set previous or parent for group
717 if (group_previous)
718 group_previous->next = group;
719 else if (group_parent)
720 group_parent->parts = group;
721
723
724 struct AttachPtr *group_ap = mutt_aptr_new();
725 group_ap->body = group;
726 group_ap->body->aptr = group_ap;
727 group_ap->level = group_level;
728 group_ap->parent_type = group_parent_type;
729
730 // insert group into attachment list
731 mutt_actx_ins_attach(actx, group_ap, group_idx);
732
733 // update email body and last attachment pointers
734 shared->email->body = actx->idx[0]->body;
735 actx->idx[actx->idxlen - 1]->body->next = NULL;
736
737 update_menu(actx, shared->adata->menu, false);
738 shared->adata->menu->current = group_idx;
740
741 mutt_message_hook(NULL, shared->email, CMD_SEND2_HOOK);
742 return FR_SUCCESS;
743}
void mutt_actx_ins_attach(struct AttachCtx *actx, struct AttachPtr *attach, int aidx)
Insert an Attachment into an Attachment Context at Specified Index.
Definition attach.c:91
struct AttachPtr * mutt_aptr_new(void)
Create a new Attachment Pointer.
Definition attach.c:40
@ CMD_SEND2_HOOK
:send2-hook
Definition command.h:104
@ FR_SUCCESS
Valid function - successfully performed.
Definition dispatcher.h:39
@ FR_ERROR
Valid function - error occurred.
Definition dispatcher.h:38
struct Body * mutt_body_new(void)
Create a new Body.
Definition body.c:44
#define mutt_debug(LEVEL,...)
Definition logging2.h:91
@ LL_DEBUG5
Log at debug level 5.
Definition logging2.h:49
#define MENU_REDRAW_INDEX
Redraw the index.
Definition lib.h:56
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition menu.c:185
@ ENC_7BIT
7-bit text
Definition mime.h:49
@ TYPE_OTHER
Unknown Content-Type.
Definition mime.h:31
void mutt_generate_boundary(struct ParameterList *pl)
Create a unique boundary id for a MIME part.
Definition multipart.c:86
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:662
void mutt_message_hook(struct Mailbox *m, struct Email *e, enum CommandId id)
Perform a message hook.
Definition run.c:132
A set of attachments.
Definition attach.h:63
int parent_type
Type of parent attachment, e.g. TYPE_MULTIPART.
Definition attach.h:38
char * language
content-language (RFC8255)
Definition body.h:78
struct ParameterList parameter
Parameters of the content-type.
Definition body.h:63
unsigned int disposition
content-disposition, ContentDisposition
Definition body.h:42
char * subtype
content-type subtype
Definition body.h:61
unsigned int encoding
content-transfer-encoding, ContentEncoding
Definition body.h:41
struct Menu * menu
Menu displaying the attachments.
Definition attach_data.h:35
struct AttachCtx * actx
Set of attachments.
Definition attach_data.h:34
struct ComposeAttachData * adata
Attachments.
Definition shared_data.h:40
struct Email * email
Email being composed.
Definition shared_data.h:39
int current
Current entry.
Definition lib.h:80
int num_tagged
Number of tagged entries.
Definition lib.h:94
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ OpCompose

const struct MenuFuncOp OpCompose[]
static

Functions for the Compose Menu.

Definition at line 87 of file functions.c.

87 { /* map: compose */
88 { "attach-file", OP_ATTACHMENT_ATTACH_FILE },
89 { "attach-key", OP_ATTACHMENT_ATTACH_KEY },
90 { "attach-message", OP_ATTACHMENT_ATTACH_MESSAGE },
91 { "attach-news-message", OP_ATTACHMENT_ATTACH_NEWS_MESSAGE },
92#ifdef USE_AUTOCRYPT
93 { "autocrypt-menu", OP_COMPOSE_AUTOCRYPT_MENU },
94#endif
95 { "copy-file", OP_ATTACHMENT_SAVE },
96 { "detach-file", OP_ATTACHMENT_DETACH },
97 { "display-toggle-weed", OP_DISPLAY_HEADERS },
98 { "edit-bcc", OP_ENVELOPE_EDIT_BCC },
99 { "edit-cc", OP_ENVELOPE_EDIT_CC },
100 { "edit-content-id", OP_ATTACHMENT_EDIT_CONTENT_ID },
101 { "edit-description", OP_ATTACHMENT_EDIT_DESCRIPTION },
102 { "edit-encoding", OP_ATTACHMENT_EDIT_ENCODING },
103 { "edit-fcc", OP_ENVELOPE_EDIT_FCC },
104 { "edit-file", OP_COMPOSE_EDIT_FILE },
105 { "edit-followup-to", OP_ENVELOPE_EDIT_FOLLOWUP_TO },
106 { "edit-from", OP_ENVELOPE_EDIT_FROM },
107 { "edit-headers", OP_ENVELOPE_EDIT_HEADERS },
108 { "edit-language", OP_ATTACHMENT_EDIT_LANGUAGE },
109 { "edit-message", OP_COMPOSE_EDIT_MESSAGE },
110 { "edit-mime", OP_ATTACHMENT_EDIT_MIME },
111 { "edit-newsgroups", OP_ENVELOPE_EDIT_NEWSGROUPS },
112 { "edit-reply-to", OP_ENVELOPE_EDIT_REPLY_TO },
113 { "edit-subject", OP_ENVELOPE_EDIT_SUBJECT },
114 { "edit-to", OP_ENVELOPE_EDIT_TO },
115 { "edit-type", OP_ATTACHMENT_EDIT_TYPE },
116 { "edit-x-comment-to", OP_ENVELOPE_EDIT_X_COMMENT_TO },
117 { "exit", OP_EXIT },
118 { "filter-entry", OP_ATTACHMENT_FILTER },
119 { "forget-passphrase", OP_FORGET_PASSPHRASE },
120 { "get-attachment", OP_ATTACHMENT_GET_ATTACHMENT },
121 { "group-alternatives", OP_ATTACHMENT_GROUP_ALTS },
122 { "group-multilingual", OP_ATTACHMENT_GROUP_LINGUAL },
123 { "group-related", OP_ATTACHMENT_GROUP_RELATED },
124 { "ispell", OP_COMPOSE_ISPELL },
125 { "move-down", OP_ATTACHMENT_MOVE_DOWN },
126 { "move-up", OP_ATTACHMENT_MOVE_UP },
127 { "new-mime", OP_ATTACHMENT_NEW_MIME },
128 { "pgp-menu", OP_COMPOSE_PGP_MENU },
129 { "pipe-entry", OP_PIPE },
130 { "pipe-message", OP_PIPE },
131 { "postpone-message", OP_COMPOSE_POSTPONE_MESSAGE },
132 { "preview-page-down", OP_PREVIEW_PAGE_DOWN },
133 { "preview-page-up", OP_PREVIEW_PAGE_UP },
134 { "print-entry", OP_ATTACHMENT_PRINT },
135 { "rename-attachment", OP_ATTACHMENT_RENAME_ATTACHMENT },
136 { "rename-file", OP_COMPOSE_RENAME_FILE },
137 { "send-message", OP_COMPOSE_SEND_MESSAGE },
138 { "smime-menu", OP_COMPOSE_SMIME_MENU },
139 { "toggle-disposition", OP_ATTACHMENT_TOGGLE_DISPOSITION },
140 { "toggle-recode", OP_ATTACHMENT_TOGGLE_RECODE },
141 { "toggle-unlink", OP_ATTACHMENT_TOGGLE_UNLINK },
142 { "ungroup-attachment", OP_ATTACHMENT_UNGROUP },
143 { "update-encoding", OP_ATTACHMENT_UPDATE_ENCODING },
144 { "view-attach", OP_ATTACHMENT_VIEW },
145 { "view-mailcap", OP_ATTACHMENT_VIEW_MAILCAP },
146 { "view-pager", OP_ATTACHMENT_VIEW_PAGER },
147 { "view-text", OP_ATTACHMENT_VIEW_TEXT },
148 { "write-fcc", OP_COMPOSE_WRITE_MESSAGE },
149 { NULL, 0 },
150};

◆ ComposeDefaultBindings

const struct MenuOpSeq ComposeDefaultBindings[]
static

Key bindings for the Compose Menu.

Definition at line 155 of file functions.c.

155 { /* map: compose */
156 { OP_ATTACHMENT_ATTACH_FILE, "a" },
157 { OP_ATTACHMENT_ATTACH_KEY, "\033k" }, // <Alt-k>
158 { OP_ATTACHMENT_ATTACH_MESSAGE, "A" },
159 { OP_ATTACHMENT_DETACH, "D" },
160 { OP_ATTACHMENT_EDIT_CONTENT_ID, "\033i" }, // <Alt-i>
161 { OP_ATTACHMENT_EDIT_DESCRIPTION, "d" },
162 { OP_ATTACHMENT_EDIT_ENCODING, "\005" }, // <Ctrl-E>
163 { OP_ATTACHMENT_EDIT_LANGUAGE, "\014" }, // <Ctrl-L>
164 { OP_ATTACHMENT_EDIT_MIME, "m" },
165 { OP_ATTACHMENT_EDIT_TYPE, "\024" }, // <Ctrl-T>
166 { OP_ATTACHMENT_FILTER, "F" },
167 { OP_ATTACHMENT_GET_ATTACHMENT, "G" },
168 { OP_ATTACHMENT_GROUP_ALTS, "&" },
169 { OP_ATTACHMENT_GROUP_LINGUAL, "^" },
170 { OP_ATTACHMENT_GROUP_RELATED, "%" },
171 { OP_ATTACHMENT_MOVE_DOWN, "+" },
172 { OP_ATTACHMENT_MOVE_UP, "-" },
173 { OP_ATTACHMENT_NEW_MIME, "n" },
174 { OP_EXIT, "q" },
175 { OP_PIPE, "|" },
176 { OP_ATTACHMENT_PRINT, "l" },
177 { OP_ATTACHMENT_RENAME_ATTACHMENT, "\017" }, // <Ctrl-O>
178 { OP_ATTACHMENT_SAVE, "C" },
179 { OP_ATTACHMENT_TOGGLE_DISPOSITION, "\004" }, // <Ctrl-D>
180 { OP_ATTACHMENT_TOGGLE_UNLINK, "u" },
181 { OP_ATTACHMENT_UNGROUP, "#" },
182 { OP_ATTACHMENT_UPDATE_ENCODING, "U" },
183 { OP_ATTACHMENT_VIEW, "<keypadenter>" },
184 { OP_ATTACHMENT_VIEW, "\n" }, // <Enter>
185 { OP_ATTACHMENT_VIEW, "\r" }, // <Return>
186#ifdef USE_AUTOCRYPT
187 { OP_COMPOSE_AUTOCRYPT_MENU, "o" },
188#endif
189 { OP_COMPOSE_EDIT_FILE, "\033e" }, // <Alt-e>
190 { OP_COMPOSE_EDIT_MESSAGE, "e" },
191 { OP_COMPOSE_ISPELL, "i" },
192 { OP_COMPOSE_PGP_MENU, "p" },
193 { OP_COMPOSE_POSTPONE_MESSAGE, "P" },
194 { OP_COMPOSE_RENAME_FILE, "R" },
195 { OP_COMPOSE_SEND_MESSAGE, "y" },
196 { OP_COMPOSE_SMIME_MENU, "S" },
197 { OP_COMPOSE_WRITE_MESSAGE, "w" },
198 { OP_DISPLAY_HEADERS, "h" },
199 { OP_ENVELOPE_EDIT_BCC, "b" },
200 { OP_ENVELOPE_EDIT_CC, "c" },
201 { OP_ENVELOPE_EDIT_FCC, "f" },
202 { OP_ENVELOPE_EDIT_FROM, "\033f" }, // <Alt-f>
203 { OP_ENVELOPE_EDIT_HEADERS, "E" },
204 { OP_ENVELOPE_EDIT_REPLY_TO, "r" },
205 { OP_ENVELOPE_EDIT_SUBJECT, "s" },
206 { OP_ENVELOPE_EDIT_TO, "t" },
207 { OP_PREVIEW_PAGE_DOWN, "<pagedown>" },
208 { OP_PREVIEW_PAGE_UP, "<pageup>" },
209 { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F>
210 { OP_TAG, "T" },
211 { 0, NULL },
212};

◆ ComposeFunctions

const struct ComposeFunction ComposeFunctions[]
static

All the NeoMutt functions that the Compose supports.

Definition at line 2104 of file functions.c.

2104 {
2105 // clang-format off
2106 { OP_ATTACHMENT_ATTACH_FILE, op_attachment_attach_file },
2107 { OP_ATTACHMENT_ATTACH_KEY, op_attachment_attach_key },
2108 { OP_ATTACHMENT_ATTACH_MESSAGE, op_attachment_attach_message },
2109 { OP_ATTACHMENT_ATTACH_NEWS_MESSAGE, op_attachment_attach_message },
2110 { OP_ATTACHMENT_DETACH, op_attachment_detach },
2111 { OP_ATTACHMENT_EDIT_CONTENT_ID, op_attachment_edit_content_id },
2112 { OP_ATTACHMENT_EDIT_DESCRIPTION, op_attachment_edit_description },
2113 { OP_ATTACHMENT_EDIT_ENCODING, op_attachment_edit_encoding },
2114 { OP_ATTACHMENT_EDIT_LANGUAGE, op_attachment_edit_language },
2115 { OP_ATTACHMENT_EDIT_MIME, op_attachment_edit_mime },
2116 { OP_ATTACHMENT_EDIT_TYPE, op_attachment_edit_type },
2117 { OP_ATTACHMENT_FILTER, op_attachment_filter },
2118 { OP_ATTACHMENT_GET_ATTACHMENT, op_attachment_get_attachment },
2119 { OP_ATTACHMENT_GROUP_ALTS, op_attachment_group_alts },
2120 { OP_ATTACHMENT_GROUP_LINGUAL, op_attachment_group_lingual },
2121 { OP_ATTACHMENT_GROUP_RELATED, op_attachment_group_related },
2122 { OP_ATTACHMENT_MOVE_DOWN, op_attachment_move_down },
2123 { OP_ATTACHMENT_MOVE_UP, op_attachment_move_up },
2124 { OP_ATTACHMENT_NEW_MIME, op_attachment_new_mime },
2125 { OP_PIPE, op_attachment_filter },
2126 { OP_ATTACHMENT_PRINT, op_attachment_print },
2127 { OP_ATTACHMENT_RENAME_ATTACHMENT, op_attachment_rename_attachment },
2128 { OP_ATTACHMENT_SAVE, op_attachment_save },
2129 { OP_ATTACHMENT_TOGGLE_DISPOSITION, op_attachment_toggle_disposition },
2130 { OP_ATTACHMENT_TOGGLE_RECODE, op_attachment_toggle_recode },
2131 { OP_ATTACHMENT_TOGGLE_UNLINK, op_attachment_toggle_unlink },
2132 { OP_ATTACHMENT_UNGROUP, op_attachment_ungroup },
2133 { OP_ATTACHMENT_UPDATE_ENCODING, op_attachment_update_encoding },
2134 { OP_ATTACHMENT_VIEW, op_display_headers },
2135 { OP_ATTACHMENT_VIEW_MAILCAP, op_display_headers },
2136 { OP_ATTACHMENT_VIEW_PAGER, op_display_headers },
2137 { OP_ATTACHMENT_VIEW_TEXT, op_display_headers },
2138 { OP_COMPOSE_EDIT_FILE, op_compose_edit_file },
2139 { OP_COMPOSE_EDIT_MESSAGE, op_compose_edit_message },
2140 { OP_COMPOSE_ISPELL, op_compose_ispell },
2141 { OP_COMPOSE_POSTPONE_MESSAGE, op_compose_postpone_message },
2142 { OP_COMPOSE_RENAME_FILE, op_compose_rename_file },
2143 { OP_COMPOSE_SEND_MESSAGE, op_compose_send_message },
2144 { OP_COMPOSE_WRITE_MESSAGE, op_compose_write_message },
2145 { OP_DISPLAY_HEADERS, op_display_headers },
2146 { OP_ENVELOPE_EDIT_HEADERS, op_envelope_edit_headers },
2147 { OP_EXIT, op_exit },
2148 { OP_FORGET_PASSPHRASE, op_forget_passphrase },
2149 { 0, NULL },
2150 // clang-format on
2151};
static int op_exit(struct AliasMenuData *mdata, int op)
exit this menu - Implements alias_function_t -
Definition functions.c:221
static int op_attachment_print(struct AttachPrivateData *priv, int op)
print the current entry - Implements attach_function_t -
Definition functions.c:379
static int op_attachment_edit_type(struct AttachPrivateData *priv, int op)
edit attachment content type - Implements attach_function_t -
Definition functions.c:358
static int op_forget_passphrase(struct AttachPrivateData *priv, int op)
wipe passphrases from memory - Implements attach_function_t -
Definition functions.c:568
static int op_attachment_save(struct AttachPrivateData *priv, int op)
save message/attachment to a mailbox/file - Implements attach_function_t -
Definition functions.c:390
static int op_attachment_group_lingual(struct ComposeSharedData *shared, int op)
Group tagged attachments as 'multipart/multilingual' - Implements compose_function_t -.
Definition functions.c:1309
static int op_attachment_group_alts(struct ComposeSharedData *shared, int op)
Group tagged attachments as 'multipart/alternative' - Implements compose_function_t -.
Definition functions.c:1295
static int op_attachment_filter(struct ComposeSharedData *shared, int op)
Filter attachment through a shell command - Implements compose_function_t -.
Definition functions.c:1232
static int op_compose_rename_file(struct ComposeSharedData *shared, int op)
Rename/move an attached file - Implements compose_function_t -.
Definition functions.c:1893
static int op_compose_ispell(struct ComposeSharedData *shared, int op)
Run ispell on the message - Implements compose_function_t -.
Definition functions.c:1858
static int op_attachment_edit_description(struct ComposeSharedData *shared, int op)
Edit attachment description - Implements compose_function_t -.
Definition functions.c:1080
static int op_attachment_group_related(struct ComposeSharedData *shared, int op)
Group tagged attachments as 'multipart/related' - Implements compose_function_t -.
Definition functions.c:1339
static int op_display_headers(struct ComposeSharedData *shared, int op)
Display message and toggle header weeding - Implements compose_function_t -.
Definition functions.c:2011
static int op_attachment_attach_key(struct ComposeSharedData *shared, int op)
Attach a PGP public key - Implements compose_function_t -.
Definition functions.c:815
static int op_compose_edit_file(struct ComposeSharedData *shared, int op)
Edit the file to be attached - Implements compose_function_t -.
Definition functions.c:1812
static int op_attachment_rename_attachment(struct ComposeSharedData *shared, int op)
Send attachment with a different name - Implements compose_function_t -.
Definition functions.c:1560
static int op_attachment_move_down(struct ComposeSharedData *shared, int op)
Move an attachment down in the attachment list - Implements compose_function_t -.
Definition functions.c:1365
static int op_compose_send_message(struct ComposeSharedData *shared, int op)
Send the message - Implements compose_function_t -.
Definition functions.c:1942
static int op_attachment_attach_file(struct ComposeSharedData *shared, int op)
Attach files to this message - Implements compose_function_t -.
Definition functions.c:750
static int op_attachment_toggle_unlink(struct ComposeSharedData *shared, int op)
Toggle whether to delete file after sending it - Implements compose_function_t -.
Definition functions.c:1651
static int op_attachment_toggle_recode(struct ComposeSharedData *shared, int op)
Toggle recoding of this attachment - Implements compose_function_t -.
Definition functions.c:1627
static int op_attachment_move_up(struct ComposeSharedData *shared, int op)
Move an attachment up in the attachment list - Implements compose_function_t -.
Definition functions.c:1421
static int op_attachment_edit_language(struct ComposeSharedData *shared, int op)
Edit the 'Content-Language' of the attachment - Implements compose_function_t -.
Definition functions.c:1154
static int op_envelope_edit_headers(struct ComposeSharedData *shared, int op)
Edit the message with headers - Implements compose_function_t -.
Definition functions.c:1765
static int op_attachment_toggle_disposition(struct ComposeSharedData *shared, int op)
Toggle disposition between inline/attachment - Implements compose_function_t -.
Definition functions.c:1611
static int op_attachment_edit_encoding(struct ComposeSharedData *shared, int op)
Edit attachment transfer-encoding - Implements compose_function_t -.
Definition functions.c:1111
static int op_attachment_update_encoding(struct ComposeSharedData *shared, int op)
Update an attachment's encoding info - Implements compose_function_t -.
Definition functions.c:1731
static int op_attachment_attach_message(struct ComposeSharedData *shared, int op)
Attach messages to this message - Implements compose_function_t -.
Definition functions.c:843
static int op_attachment_ungroup(struct ComposeSharedData *shared, int op)
Ungroup a 'multipart' attachment - Implements compose_function_t -.
Definition functions.c:1667
static int op_attachment_edit_content_id(struct ComposeSharedData *shared, int op)
Edit the 'Content-ID' of the attachment - Implements compose_function_t -.
Definition functions.c:1027
static int op_attachment_get_attachment(struct ComposeSharedData *shared, int op)
Get a temporary copy of an attachment - Implements compose_function_t -.
Definition functions.c:1259
static int op_compose_write_message(struct ComposeSharedData *shared, int op)
Write the message to a folder - Implements compose_function_t -.
Definition functions.c:1969
static int op_attachment_edit_mime(struct ComposeSharedData *shared, int op)
Edit attachment using mailcap entry - Implements compose_function_t -.
Definition functions.c:1190
static int op_compose_edit_message(struct ComposeSharedData *shared, int op)
Edit the message - Implements compose_function_t -.
Definition functions.c:1836
static int op_attachment_detach(struct ComposeSharedData *shared, int op)
Delete the current entry - Implements compose_function_t -.
Definition functions.c:991
static int op_compose_postpone_message(struct ComposeSharedData *shared, int op)
Save this message to send later - Implements compose_function_t -.
Definition functions.c:1878
static int op_attachment_new_mime(struct ComposeSharedData *shared, int op)
Compose new attachment using mailcap entry - Implements compose_function_t -.
Definition functions.c:1456