goto error;
}
- mutt_extract_token (&command, s,
- (data &
- (M_FOLDERHOOK | M_SENDHOOK | M_SEND2HOOK |
- M_ACCOUNTHOOK | M_REPLYHOOK)) ? M_TOKEN_SPACE : 0);
+ mutt_extract_token(&command, s, (data & (M_FOLDERHOOK | M_SENDHOOK |
+ M_SEND2HOOK | M_REPLYHOOK)) ?
+ M_TOKEN_SPACE : 0);
if (!command.data) {
m_strcpy(err->data, err->dsize, _("too few arguments"));
return (-1);
}
}
- else if (DefaultHook && !(data & M_ACCOUNTHOOK) && !(data & M_CRYPTHOOK))
+ else if (DefaultHook && !(data & M_CRYPTHOOK))
{
char tmp[HUGE_STRING];
for (ptr = Hooks; ptr; ptr = ptr->next) {
if (ptr->type == (int)data &&
ptr->rx.neg == neg && !m_strcmp(pattern.data, ptr->rx.pattern)) {
- if (data &
- (M_FOLDERHOOK | M_SENDHOOK | M_SEND2HOOK | M_MESSAGEHOOK |
- M_ACCOUNTHOOK | M_REPLYHOOK)) {
+ if (data & (M_FOLDERHOOK | M_SENDHOOK | M_SEND2HOOK | M_MESSAGEHOOK |
+ M_REPLYHOOK))
+ {
/* these hooks allow multiple commands with the same
* pattern, so if we've already seen this pattern/command pair, just
* ignore it instead of creating a duplicate */
{
return _mutt_string_hook (adr->mailbox, M_CRYPTHOOK);
}
-
-void mutt_account_hook (const char *url)
-{
- hook_t *hook;
- BUFFER token;
- BUFFER err;
- char buf[STRING];
-
- err.data = buf;
- err.dsize = sizeof (buf);
- p_clear(&token, 1);
-
- for (hook = Hooks; hook; hook = hook->next) {
- if (!(hook->command && (hook->type & M_ACCOUNTHOOK)))
- continue;
-
- if ((regexec (hook->rx.rx, url, 0, NULL, 0) == 0) ^ hook->rx.neg) {
- if (mutt_parse_rc_line (hook->command, &token, &err) == -1) {
- mutt_error ("%s", err.data);
- mutt_sleep (1);
- }
- }
- }
-
- p_delete(&token.data);
-}
{"bind", mutt_parse_bind, 0},
{"color", mutt_parse_color, 0},
{"exec", mutt_parse_exec, 0},
- {"account-hook", mutt_parse_hook, M_ACCOUNTHOOK},
{"append-hook", mutt_parse_hook, M_APPENDHOOK},
{"close-hook", mutt_parse_hook, M_CLOSEHOOK},
{"crypt-hook", mutt_parse_hook, M_CRYPTHOOK},
CONNECTION *mutt_conn_find (const CONNECTION * start, const ACCOUNT * account)
{
CONNECTION *conn;
- ciss_url_t url;
- char hook[LONG_STRING];
-
- /* account isn't actually modified, since url isn't either */
- mutt_account_tourl ((ACCOUNT *) account, &url);
- url.path = NULL;
- url_ciss_tostring (&url, hook, sizeof (hook), 0);
- mutt_account_hook (hook);
conn = start ? start->next : Connections;
while (conn) {
} event_t;
/* types for mutt_add_hook() */
-#define M_FOLDERHOOK 1
+#define M_FOLDERHOOK (1<<0)
#define M_MBOXHOOK (1<<1)
#define M_SENDHOOK (1<<2)
#define M_FCCHOOK (1<<3)
#define M_SAVEHOOK (1<<4)
#define M_MESSAGEHOOK (1<<5)
#define M_CRYPTHOOK (1<<6)
-#define M_ACCOUNTHOOK (1<<7)
-#define M_REPLYHOOK (1<<8)
-#define M_SEND2HOOK (1<<9)
+#define M_REPLYHOOK (1<<7)
+#define M_SEND2HOOK (1<<8)
-#define M_OPENHOOK (1<<10)
-#define M_APPENDHOOK (1<<11)
-#define M_CLOSEHOOK (1<<12)
+#define M_OPENHOOK (1<<9)
+#define M_APPENDHOOK (1<<10)
+#define M_CLOSEHOOK (1<<11)
/* tree characters for linearize_tree and print_enriched_string */
#define M_TREE_LLCORNER 1
const char *mutt_fqdn (short);
-void mutt_account_hook (const char *url);
void mutt_add_to_reference_headers (ENVELOPE * env, ENVELOPE * curenv,
string_list_t *** pp, string_list_t *** qq);
int mutt_bounce_message (FILE * fp, HEADER *, address_t *);