[imp] patch for imp signature compose

Vijay Mahrra vijay.mahrra at es.easynet.net
Wed May 12 08:52:39 PDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi,

i've been experimenting with horde hooks and i decided to write a hook to 
randomise my signature when composing new messages with imp, which basically 
replaces %FORTUNE% with a call to the system fortune cookie program.

the function to go into hooks.php in horde and a patch against compose.php are 
attached to this message, perhaps they need to work with with the existing 
_prefs_hook_signature - i'm not sure how this works or should relate if at 
all with imp (from horde/config/hooks.php.dist):

    function _prefs_hook_signature($username = null)
    {
        $sig = $GLOBALS['prefs']->getValue('signature');
        if (preg_match('/%TAG%/', $sig)) {
            $tag = `cat /usr/share/tagline`;
            $sig = preg_replace('|%TAG%|', $tag, $sig);
        }
        return $sig;
    }

what is $username there for if it is not being used?  or am i missing 
something?

i hope that someone finds this patch amusing ;)

vijay
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAokhT/8swv0hiC1kRAkixAKCI9iWuSX8ykMl+CvL0xcb+IBiQEACgmGW4
XlgYNALd2/ZJ+lX2YAcWF/E=
=Zj0F
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compose.php.diff
Type: text/x-diff
Size: 521 bytes
Desc: not available
Url : http://lists.horde.org/archives/imp/attachments/20040512/781d52c5/compose.php.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: _imp_hook_signature.php
Type: application/x-php
Size: 438 bytes
Desc: not available
Url : http://lists.horde.org/archives/imp/attachments/20040512/781d52c5/_imp_hook_signature.bin


More information about the imp mailing list