NeoMutt  2025-12-11-949-g4870ee
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
dlg_mlist.c File Reference

Mailing-list action dialog. More...

#include "config.h"
#include <stdio.h>
#include "mutt/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "functions.h"
#include "mutt_logging.h"
#include "mx.h"
+ Include dependency graph for dlg_mlist.c:

Go to the source code of this file.

Functions

static void mlist_data_free (struct Menu *menu, void **ptr)
 Free list dialog data - Implements Menu::mdata_free() -.
 
static void mlist_data_add_entries (struct ListData *ld, const struct ListAction *action)
 Add menu rows for one mailing-list action.
 
static int mlist_make_entry (struct Menu *menu, int line, int max_cols, struct Buffer *buf)
 Format a mailing-list action for the dialog - Implements Menu::make_entry() -.
 
void dlg_mlist (struct Mailbox *m, struct Email *e)
 Display mailing-list actions for an email -.
 

Variables

static const struct Mapping MlistHelp []
 Help Bar for the Mailing-list action dialog.
 

Detailed Description

Mailing-list action dialog.

Authors
  • 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_mlist.c.

Function Documentation

◆ mlist_data_add_entries()

static void mlist_data_add_entries ( struct ListData * ld,
const struct ListAction * action )
static

Add menu rows for one mailing-list action.

Parameters
ldDialog state
actionMailing-list action

Definition at line 75 of file dlg_mlist.c.

76{
77 struct ListHead *values = mlist_action_value(&ld->headers, action);
78 struct ListNode *np = NULL;
79 STAILQ_FOREACH(np, values, entries)
80 {
81 if (!mutt_istr_startswith(np->data, "mailto:"))
82 continue;
83
84 const struct ListEntry entry = { action, np->data };
85 ARRAY_ADD(&ld->entries, entry);
86 }
87}
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
Definition array.h:157
struct ListHead * mlist_action_value(struct Rfc2369ListHeaders *headers, const struct ListAction *action)
Get the stored value for a mailing-list action.
Definition functions.c:113
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
Definition string.c:246
#define STAILQ_FOREACH(var, head, field)
Definition queue.h:390
struct ListEntryArray entries
Menu rows.
Definition functions.h:68
struct Rfc2369ListHeaders headers
Parsed List-* headers.
Definition functions.h:67
A mailing-list action in the dialog.
Definition functions.h:48
const struct ListAction * action
Action definition.
Definition functions.h:49
A List node for strings.
Definition list.h:37
char * data
String.
Definition list.h:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ MlistHelp

const struct Mapping MlistHelp[]
static
Initial value:
= {
{ N_("Exit"), OP_EXIT },
{ N_("Archive"), OP_LIST_ARCHIVE },
{ N_("Help"), OP_LIST_HELP },
{ N_("Owner"), OP_LIST_OWNER },
{ N_("Post"), OP_LIST_POST },
{ N_("Subscribe"), OP_LIST_SUBSCRIBE },
{ N_("Unsubscribe"), OP_LIST_UNSUBSCRIBE },
{ NULL, 0 },
}
#define N_(a)
Definition message.h:32

Help Bar for the Mailing-list action dialog.

Definition at line 43 of file dlg_mlist.c.

43 {
44 // clang-format off
45 { N_("Exit"), OP_EXIT },
46 { N_("Archive"), OP_LIST_ARCHIVE },
47 { N_("Help"), OP_LIST_HELP },
48 { N_("Owner"), OP_LIST_OWNER },
49 { N_("Post"), OP_LIST_POST },
50 { N_("Subscribe"), OP_LIST_SUBSCRIBE },
51 { N_("Unsubscribe"), OP_LIST_UNSUBSCRIBE },
52 { NULL, 0 },
53 // clang-format on
54};