X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=hook.c;h=e763f1412bf8b5a31a518a5306469a9dbea587ca;hp=fb742061170078965a35f52d02910c8ee2094e3d;hb=f7f0722b06934cf83c08e60d805238478ada2699;hpb=efe9a0bac26a7dabf3953ea0597ce06b3dcb21fe diff --git a/hook.c b/hook.c index fb74206..e763f14 100644 --- a/hook.c +++ b/hook.c @@ -19,11 +19,8 @@ #include "mutt.h" #include "mx.h" -#include "mutt_crypt.h" - -#ifdef USE_COMPRESSED +#include #include "compress.h" -#endif #include "lib/rx.h" @@ -36,7 +33,7 @@ #define ERROR_STOP 0 typedef struct hook { - unsigned long type; /* hook type */ + int type; /* hook type */ rx_t rx; /* regular expression */ char *command; /* filename, command or pattern to execute */ pattern_t *pattern; /* used for fcc,save,send-hook */ @@ -94,17 +91,15 @@ int mutt_parse_hook (BUFFER * buf __attribute__ ((unused)), BUFFER * s, unsigned p_clear(&pattern, 1); pattern.data = m_strdup(path); } -#ifdef USE_COMPRESSED else if (data & (M_APPENDHOOK | M_OPENHOOK | M_CLOSEHOOK)) { if (mutt_test_compress_command (command.data)) { m_strcpy(err->data, err->dsize, _("bad formatted command string")); return (-1); } } -#endif else if (DefaultHook && !(data & (M_CHARSETHOOK | M_ACCOUNTHOOK)) - && (!WithCrypto || !(data & M_CRYPTHOOK)) - ) { + && !(data & M_CRYPTHOOK)) + { char tmp[HUGE_STRING]; m_strcpy(tmp, sizeof(tmp), pattern.data); @@ -306,7 +301,7 @@ void mutt_folder_hook (char *path) current_hook_type = 0; } -char *mutt_find_hook (unsigned long type, const char *pat) +char *mutt_find_hook (int type, const char *pat) { HOOK *tmp = Hooks; @@ -318,7 +313,7 @@ char *mutt_find_hook (unsigned long type, const char *pat) return (NULL); } -void mutt_message_hook (CONTEXT * ctx, HEADER * hdr, unsigned long type) +void mutt_message_hook (CONTEXT * ctx, HEADER * hdr, int type) { BUFFER err, token; HOOK *hook; @@ -445,7 +440,6 @@ char *mutt_crypt_hook (address_t * adr) return _mutt_string_hook (adr->mailbox, M_CRYPTHOOK); } -#ifdef USE_SOCKET void mutt_account_hook (const char *url) { HOOK *hook; @@ -476,4 +470,3 @@ void mutt_account_hook (const char *url) p_delete(&token.data); } -#endif