NeoMutt  2023-03-22-27-g3cb248
Teaching an old dog new tricks
DOXYGEN
dlg_query.c File Reference

Routines for querying an external address book. More...

#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "mutt.h"
#include "lib.h"
#include "enter/lib.h"
#include "menu/lib.h"
#include "send/lib.h"
#include "alias.h"
#include "format_flags.h"
#include "functions.h"
#include "gui.h"
#include "keymap.h"
#include "mutt_logging.h"
#include "muttlib.h"
#include "opcodes.h"
+ Include dependency graph for dlg_query.c:

Go to the source code of this file.

Functions

bool alias_to_addrlist (struct AddressList *al, struct Alias *alias)
 Turn an Alias into an AddressList. More...
 
static const char * query_format_str (char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
 Format a string for the query menu - Implements format_t -. More...
 
static void query_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the query list - Implements Menu::make_entry() -. More...
 
static int query_tag (struct Menu *menu, int sel, int act)
 Tag an entry in the Query Menu - Implements Menu::tag() -. More...
 
int query_run (const char *s, bool verbose, struct AliasList *al, const struct ConfigSubset *sub)
 Run an external program to find Addresses. More...
 
static int query_window_observer (struct NotifyCallback *nc)
 Notification that a Window has changed - Implements observer_t -. More...
 
static struct MuttWindowquery_dialog_new (struct AliasMenuData *mdata, const char *query)
 Create an Query Selection Dialog. More...
 
static bool dlg_select_query (struct Buffer *buf, struct AliasMenuData *mdata)
 Get the user to enter an Address Query. More...
 
int query_complete (struct Buffer *buf, struct ConfigSubset *sub)
 Perform auto-complete using an Address Query. More...
 
void query_index (struct Mailbox *m, struct ConfigSubset *sub)
 Perform an Alias Query and display the results. More...
 

Variables

static const struct Mapping QueryHelp []
 Help Bar for the Address Query dialog. More...
 

Detailed Description

Routines for querying an external address book.

Authors
  • Michael R. Elkins
  • Pietro Cerutti
  • Richard Russon

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 dlg_query.c.

Function Documentation

◆ alias_to_addrlist()

bool alias_to_addrlist ( struct AddressList *  al,
struct Alias alias 
)

Turn an Alias into an AddressList.

Parameters
alAddressList to fill (must be empty)
aliasAlias to use
Return values
trueSuccess

Definition at line 118 of file dlg_query.c.

119{
120 if (!al || !TAILQ_EMPTY(al) || !alias)
121 return false;
122
123 mutt_addrlist_copy(al, &alias->addr, false);
124 if (!TAILQ_EMPTY(al))
125 {
126 struct Address *first = TAILQ_FIRST(al);
127 struct Address *second = TAILQ_NEXT(first, entries);
128 if (!second && !first->personal)
129 first->personal = mutt_str_dup(alias->name);
130
131 mutt_addrlist_to_intl(al, NULL);
132 }
133
134 return true;
135}
void mutt_addrlist_copy(struct AddressList *dst, const struct AddressList *src, bool prune)
Copy a list of addresses into another list.
Definition: address.c:745
int mutt_addrlist_to_intl(struct AddressList *al, char **err)
Convert an Address list to Punycode.
Definition: address.c:1278
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:250
#define TAILQ_FIRST(head)
Definition: queue.h:723
#define TAILQ_NEXT(elm, field)
Definition: queue.h:832
#define TAILQ_EMPTY(head)
Definition: queue.h:721
An email address.
Definition: address.h:36
char * personal
Real name of address.
Definition: address.h:37
char * name
Short name.
Definition: alias.h:35
struct AddressList addr
List of Addresses the Alias expands to.
Definition: alias.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ query_run()

int query_run ( const char *  s,
bool  verbose,
struct AliasList *  al,
const struct ConfigSubset sub 
)

Run an external program to find Addresses.

Parameters
sString to match
verboseIf true, print progress messages
alAlias list to fill
subConfig items
Return values
0Success
-1Error

Definition at line 256 of file dlg_query.c.

257{
258 FILE *fp = NULL;
259 char *buf = NULL;
260 size_t buflen;
261 char *msg = NULL;
262 size_t msglen = 0;
263 char *p = NULL;
264 struct Buffer *cmd = mutt_buffer_pool_get();
265
266 const char *const c_query_command = cs_subset_string(sub, "query_command");
267 mutt_buffer_file_expand_fmt_quote(cmd, c_query_command, s);
268
269 pid_t pid = filter_create(mutt_buffer_string(cmd), NULL, &fp, NULL);
270 if (pid < 0)
271 {
272 mutt_debug(LL_DEBUG1, "unable to fork command: %s\n", mutt_buffer_string(cmd));
274 return -1;
275 }
277
278 if (verbose)
279 mutt_message(_("Waiting for response..."));
280
281 /* The query protocol first reads one NL-terminated line. If an error
282 * occurs, this is assumed to be an error message. Otherwise it's ignored. */
283 msg = mutt_file_read_line(msg, &msglen, fp, NULL, MUTT_RL_NO_FLAGS);
284 while ((buf = mutt_file_read_line(buf, &buflen, fp, NULL, MUTT_RL_NO_FLAGS)))
285 {
286 p = strtok(buf, "\t\n");
287 if (p)
288 {
289 struct Alias *alias = alias_new();
290
291 mutt_addrlist_parse(&alias->addr, p);
292 p = strtok(NULL, "\t\n");
293 if (p)
294 {
295 alias->name = mutt_str_dup(p);
296 p = strtok(NULL, "\t\n");
297 alias->comment = mutt_str_dup(p);
298 }
299 TAILQ_INSERT_TAIL(al, alias, entries);
300 }
301 }
302 FREE(&buf);
303 mutt_file_fclose(&fp);
304 if (filter_wait(pid))
305 {
306 mutt_debug(LL_DEBUG1, "Error: %s\n", msg);
307 if (verbose)
308 mutt_error("%s", msg);
309 }
310 else
311 {
312 if (verbose)
313 mutt_message("%s", msg);
314 }
315 FREE(&msg);
316
317 return 0;
318}
int mutt_addrlist_parse(struct AddressList *al, const char *s)
Parse a list of email addresses.
Definition: address.c:462
struct Alias * alias_new(void)
Create a new Alias.
Definition: alias.c:630
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:78
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
char * mutt_file_read_line(char *line, size_t *size, FILE *fp, int *line_num, ReadLineFlags flags)
Read a line from a file.
Definition: file.c:738
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
Definition: file.c:149
void mutt_buffer_file_expand_fmt_quote(struct Buffer *dest, const char *fmt, const char *src)
Replace s in a string with a filename.
Definition: file.c:1475
#define MUTT_RL_NO_FLAGS
No flags are set.
Definition: file.h:39
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
Definition: filter.c:217
pid_t filter_create(const char *cmd, FILE **fp_in, FILE **fp_out, FILE **fp_err)
Set up filter program.
Definition: filter.c:206
#define mutt_error(...)
Definition: logging.h:87
#define mutt_message(...)
Definition: logging.h:86
#define mutt_debug(LEVEL,...)
Definition: logging.h:84
@ LL_DEBUG1
Log at debug level 1.
Definition: logging.h:40
#define FREE(x)
Definition: memory.h:43
#define _(a)
Definition: message.h:28
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
Definition: pool.c:112
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:101
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition: queue.h:809
A shortcut for an email address or addresses.
Definition: alias.h:34
char * comment
Free-form comment string.
Definition: alias.h:37
String manipulation buffer.
Definition: buffer.h:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ query_dialog_new()

static struct MuttWindow * query_dialog_new ( struct AliasMenuData mdata,
const char *  query 
)
static

Create an Query Selection Dialog.

Parameters
mdataMenu data holding Aliases
queryInitial query string
Return values
ptrNew Dialog

Definition at line 352 of file dlg_query.c.

353{
355
356 struct Menu *menu = dlg->wdata;
357
359 menu->custom_search = true;
360 menu->tag = query_tag;
361 menu->max = ARRAY_SIZE(&mdata->ava);
362 mdata->title = mutt_str_dup(_("Query"));
363 menu->mdata = mdata;
364 menu->mdata_free = NULL; // Menu doesn't own the data
365
366 struct MuttWindow *win_menu = menu->win;
367
368 // Override the Simple Dialog's recalc()
369 win_menu->recalc = alias_recalc;
370
371 char title[256] = { 0 };
372 snprintf(title, sizeof(title), "%s: %s", mdata->title, query);
373 struct MuttWindow *sbar = window_find_child(dlg, WT_STATUS_BAR);
374 sbar_set_title(sbar, title);
375
376 // NT_COLOR is handled by the SimpleDialog
379
380 return dlg;
381}
#define ARRAY_SIZE(head)
The number of elements stored.
Definition: array.h:86
static const struct Mapping QueryHelp[]
Help Bar for the Address Query dialog.
Definition: dlg_query.c:98
static void query_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
Format a menu item for the query list - Implements Menu::make_entry() -.
Definition: dlg_query.c:220
static int query_tag(struct Menu *menu, int sel, int act)
Tag an entry in the Query Menu - Implements Menu::tag() -.
Definition: dlg_query.c:235
static int query_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: dlg_query.c:323
int alias_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: gui.c:43
int alias_recalc(struct MuttWindow *win)
Recalculate the display of the Alias Window - Implements MuttWindow::recalc() -.
Definition: gui.c:89
struct MuttWindow * simple_dialog_new(enum MenuType mtype, enum WindowType wtype, const struct Mapping *help_data)
Create a simple index Dialog.
Definition: simple.c:129
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:189
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
Definition: mutt_window.c:523
@ WT_DLG_QUERY
Query Dialog, dlg_select_query()
Definition: mutt_window.h:90
@ WT_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
Definition: mutt_window.h:102
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:55
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
void sbar_set_title(struct MuttWindow *win, const char *title)
Set the title for the Simple Bar.
Definition: sbar.c:224
char * title
Title for the status bar.
Definition: gui.h:60
Definition: lib.h:70
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:77
void(* make_entry)(struct Menu *menu, char *buf, size_t buflen, int line)
Definition: lib.h:97
void(* mdata_free)(struct Menu *menu, void **ptr)
Definition: lib.h:152
int(* tag)(struct Menu *menu, int sel, int act)
Definition: lib.h:122
void * mdata
Private data.
Definition: lib.h:138
int max
Number of entries in the menu.
Definition: lib.h:72
bool custom_search
The menu implements its own non-Menusearch()-compatible search, trickle OP_SEARCH*.
Definition: lib.h:85
void * wdata
Private data.
Definition: mutt_window.h:145
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
int(* recalc)(struct MuttWindow *win)
Definition: mutt_window.h:170
Container for Accounts, Notifications.
Definition: neomutt.h:37
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
@ MENU_QUERY
Select from results of external query.
Definition: type.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dlg_select_query()

static bool dlg_select_query ( struct Buffer buf,
struct AliasMenuData mdata 
)
static

Get the user to enter an Address Query.

Parameters
bufBuffer for the query
mdataMenu data holding Aliases
Return values
trueSelection was made

Definition at line 389 of file dlg_query.c.

390{
391 struct MuttWindow *dlg = query_dialog_new(mdata, mutt_buffer_string(buf));
392 struct Menu *menu = dlg->wdata;
393 struct MuttWindow *win_sbar = window_find_child(dlg, WT_STATUS_BAR);
394 struct MuttWindow *win_menu = window_find_child(dlg, WT_MENU);
395 mdata->menu = menu;
396 mdata->sbar = win_sbar;
397 mdata->query = buf;
398
399 alias_array_sort(&mdata->ava, mdata->sub);
400
401 struct AliasView *avp = NULL;
402 ARRAY_FOREACH(avp, &mdata->ava)
403 {
404 avp->num = ARRAY_FOREACH_IDX;
405 }
406
407 // ---------------------------------------------------------------------------
408 // Event Loop
409 int rc = 0;
410 int op = OP_NULL;
411 do
412 {
413 menu_tagging_dispatcher(menu->win, op);
414 window_redraw(NULL);
415
416 op = km_dokey(MENU_QUERY);
417 mutt_debug(LL_DEBUG1, "Got op %s (%d)\n", opcodes_get_name(op), op);
418 if (op < 0)
419 continue;
420 if (op == OP_NULL)
421 {
423 continue;
424 }
426
427 rc = alias_function_dispatcher(dlg, op);
428 if (rc == FR_UNKNOWN)
429 rc = menu_function_dispatcher(win_menu, op);
430 if (rc == FR_UNKNOWN)
431 rc = global_function_dispatcher(NULL, op);
432 } while ((rc != FR_DONE) && (rc != FR_CONTINUE));
433 // ---------------------------------------------------------------------------
434
435 simple_dialog_free(&dlg);
436 window_redraw(NULL);
437 return (rc == FR_CONTINUE); // Was a selection made?
438}
void alias_array_sort(struct AliasViewArray *ava, const struct ConfigSubset *sub)
Sort and reindex an AliasViewArray.
Definition: sort.c:156
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:211
@ FR_DONE
Exit the Dialog.
Definition: dispatcher.h:35
@ FR_UNKNOWN
Unknown function.
Definition: dispatcher.h:33
@ FR_CONTINUE
Remain in the Dialog.
Definition: dispatcher.h:34
static struct MuttWindow * query_dialog_new(struct AliasMenuData *mdata, const char *query)
Create an Query Selection Dialog.
Definition: dlg_query.c:352
int menu_tagging_dispatcher(struct MuttWindow *win, int op)
Perform tagging operations on the Menu - Implements function_dispatcher_t -.
Definition: tagging.c:223
int global_function_dispatcher(struct MuttWindow *win, int op)
Perform a Global function - Implements function_dispatcher_t -.
Definition: global.c:164
int menu_function_dispatcher(struct MuttWindow *win, int op)
Perform a Menu function - Implements function_dispatcher_t -.
Definition: functions.c:320
int alias_function_dispatcher(struct MuttWindow *win, int op)
Perform a Alias function - Implements function_dispatcher_t -.
Definition: functions.c:333
void simple_dialog_free(struct MuttWindow **ptr)
Destroy a simple index Dialog.
Definition: simple.c:166
int km_dokey(enum MenuType mtype)
Determine what a keypress should do.
Definition: keymap.c:797
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
Definition: keymap.c:1065
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:73
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
Definition: mutt_window.c:605
@ WT_MENU
An Window containing a Menu.
Definition: mutt_window.h:98
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition: opcodes.c:46
struct AliasViewArray ava
All Aliases/Queries.
Definition: gui.h:53
struct MuttWindow * sbar
Status Bar.
Definition: gui.h:59
struct Menu * menu
Menu.
Definition: gui.h:56
struct Buffer * query
Query string.
Definition: gui.h:57
struct ConfigSubset * sub
Config items.
Definition: gui.h:55
GUI data wrapping an Alias.
Definition: gui.h:36
int num
Index number in list.
Definition: gui.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ query_complete()

int query_complete ( struct Buffer buf,
struct ConfigSubset sub 
)

Perform auto-complete using an Address Query.

Parameters
bufBuffer for completion
subConfig item
Return values
0Always

Definition at line 446 of file dlg_query.c.

447{
448 struct AliasMenuData mdata = { ARRAY_HEAD_INITIALIZER, NULL, sub };
449
450 struct AliasList al = TAILQ_HEAD_INITIALIZER(al);
451 const char *const c_query_command = cs_subset_string(sub, "query_command");
452 if (!c_query_command)
453 {
454 mutt_warning(_("Query command not defined"));
455 goto done;
456 }
457
458 query_run(mutt_buffer_string(buf), true, &al, sub);
459 if (TAILQ_EMPTY(&al))
460 goto done;
461
462 mdata.al = &al;
463
464 struct Alias *a_first = TAILQ_FIRST(&al);
465 if (!TAILQ_NEXT(a_first, entries)) // only one response?
466 {
467 struct AddressList addr = TAILQ_HEAD_INITIALIZER(addr);
468 if (alias_to_addrlist(&addr, a_first))
469 {
472 mutt_addrlist_write(&addr, buf, false);
473 mutt_addrlist_clear(&addr);
475 }
476 goto done;
477 }
478
479 struct Alias *np = NULL;
480 TAILQ_FOREACH(np, mdata.al, entries)
481 {
482 alias_array_alias_add(&mdata.ava, np);
483 }
484
485 /* multiple results, choose from query menu */
486 if (!dlg_select_query(buf, &mdata))
487 goto done;
488
490 mutt_buffer_alloc(buf, 8192);
491 bool first = true;
492 struct AliasView *avp = NULL;
493 ARRAY_FOREACH(avp, &mdata.ava)
494 {
495 if (!avp->is_tagged)
496 continue;
497
498 if (!first)
499 {
500 mutt_buffer_addstr(buf, ", ");
501 }
502
503 first = false;
504 struct AddressList al_copy = TAILQ_HEAD_INITIALIZER(al_copy);
505 if (alias_to_addrlist(&al_copy, avp->alias))
506 {
507 mutt_addrlist_to_local(&al_copy);
508 mutt_addrlist_write(&al_copy, buf, false);
509 mutt_addrlist_clear(&al_copy);
510 }
511 }
512
513done:
514 ARRAY_FREE(&mdata.ava);
515 FREE(&mdata.title);
516 FREE(&mdata.limit);
517 aliaslist_free(&al);
518 return 0;
519}
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
Definition: address.c:1443
int mutt_addrlist_to_local(struct AddressList *al)
Convert an Address list from Punycode.
Definition: address.c:1361
size_t mutt_addrlist_write(const struct AddressList *al, struct Buffer *buf, bool display)
Write an Address to a buffer.
Definition: address.c:1192
void aliaslist_free(struct AliasList *al)
Free a List of Aliases.
Definition: alias.c:662
int alias_array_alias_add(struct AliasViewArray *ava, struct Alias *alias)
Add an Alias to the AliasViewArray.
Definition: array.c:47
#define ARRAY_FREE(head)
Release all memory.
Definition: array.h:203
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
Definition: array.h:57
void mutt_buffer_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
Definition: buffer.c:313
size_t mutt_buffer_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition: buffer.c:233
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition: buffer.c:85
int query_run(const char *s, bool verbose, struct AliasList *al, const struct ConfigSubset *sub)
Run an external program to find Addresses.
Definition: dlg_query.c:256
static bool dlg_select_query(struct Buffer *buf, struct AliasMenuData *mdata)
Get the user to enter an Address Query.
Definition: dlg_query.c:389
bool alias_to_addrlist(struct AddressList *al, struct Alias *alias)
Turn an Alias into an AddressList.
Definition: dlg_query.c:118
#define mutt_warning(...)
Definition: logging.h:85
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:725
#define TAILQ_HEAD_INITIALIZER(head)
Definition: queue.h:637
AliasView array wrapper with Pattern information -.
Definition: gui.h:52
char * limit
Limit being used.
Definition: gui.h:58
struct AliasList * al
Alias data.
Definition: gui.h:54
struct Alias * alias
Alias.
Definition: gui.h:44
bool is_tagged
Is it tagged?
Definition: gui.h:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ query_index()

void query_index ( struct Mailbox m,
struct ConfigSubset sub 
)

Perform an Alias Query and display the results.

Parameters
mMailbox
subConfig item

Definition at line 526 of file dlg_query.c.

527{
528 const char *const c_query_command = cs_subset_string(sub, "query_command");
529 if (!c_query_command)
530 {
531 mutt_warning(_("Query command not defined"));
532 return;
533 }
534
535 struct AliasList al = TAILQ_HEAD_INITIALIZER(al);
536 struct AliasMenuData mdata = { ARRAY_HEAD_INITIALIZER, NULL, sub };
537 mdata.al = &al;
538
539 struct Buffer *buf = mutt_buffer_pool_get();
540 if ((mutt_buffer_get_field(_("Query: "), buf, MUTT_COMP_NO_FLAGS, false, NULL,
541 NULL, NULL) != 0) ||
543 {
544 goto done;
545 }
546
547 query_run(mutt_buffer_string(buf), false, &al, sub);
548 if (TAILQ_EMPTY(&al))
549 goto done;
550
551 struct Alias *np = NULL;
552 TAILQ_FOREACH(np, mdata.al, entries)
553 {
554 alias_array_alias_add(&mdata.ava, np);
555 }
556
557 if (!dlg_select_query(buf, &mdata))
558 goto done;
559
560 // Prepare the "To:" field of a new email
561 struct Email *e = email_new();
562 e->env = mutt_env_new();
563
564 struct AliasView *avp = NULL;
565 ARRAY_FOREACH(avp, &mdata.ava)
566 {
567 if (!avp->is_tagged)
568 continue;
569
570 struct AddressList al_copy = TAILQ_HEAD_INITIALIZER(al_copy);
571 if (alias_to_addrlist(&al_copy, avp->alias))
572 {
573 mutt_addrlist_copy(&e->env->to, &al_copy, false);
574 mutt_addrlist_clear(&al_copy);
575 }
576 }
577
578 mutt_send_message(SEND_REVIEW_TO, e, NULL, m, NULL, sub);
579
580done:
581 ARRAY_FREE(&mdata.ava);
582 FREE(&mdata.title);
583 FREE(&mdata.limit);
584 aliaslist_free(&al);
586}
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:298
struct Email * email_new(void)
Create a new Email.
Definition: email.c:78
int mutt_buffer_get_field(const char *field, struct Buffer *buf, CompletionFlags complete, bool multiple, struct Mailbox *m, char ***files, int *numfiles)
Ask the user for a string.
Definition: window.c:180
struct Envelope * mutt_env_new(void)
Create a new Envelope.
Definition: envelope.c:43
#define MUTT_COMP_NO_FLAGS
No flags are set.
Definition: mutt.h:55
int mutt_send_message(SendFlags flags, struct Email *e_templ, const char *tempfile, struct Mailbox *m, struct EmailList *el, struct ConfigSubset *sub)
Send an email.
Definition: send.c:2137
#define SEND_REVIEW_TO
Allow the user to edit the To field.
Definition: send.h:54
The envelope/body of an email.
Definition: email.h:37
struct Envelope * env
Envelope information.
Definition: email.h:66
struct AddressList to
Email's 'To' list.
Definition: envelope.h:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ QueryHelp

const struct Mapping QueryHelp[]
static
Initial value:
= {
{ N_("Exit"), OP_EXIT },
{ N_("Mail"), OP_MAIL },
{ N_("New Query"), OP_QUERY },
{ N_("Make Alias"), OP_CREATE_ALIAS },
{ N_("Sort"), OP_SORT },
{ N_("Rev-Sort"), OP_SORT_REVERSE },
{ N_("Search"), OP_SEARCH },
{ N_("Help"), OP_HELP },
{ NULL, 0 },
}
#define N_(a)
Definition: message.h:32

Help Bar for the Address Query dialog.

Definition at line 98 of file dlg_query.c.