<?php
/*******************************************************************************

    Author ......... Jimmy Conner
    Contact ........ jimmy@sqmail.org
    Home Site ...... http://www.sqmail.org/
    Program ........ Address Add
    Version ........ 2.1
    Purpose ........ Allows you to add the From address to the address book

*******************************************************************************/


function squirrelmail_plugin_init_address_add() {
   global $squirrelmail_plugin_hooks;
   if (function_exists('sqgetGlobalVar'))
      $squirrelmail_plugin_hooks['read_body_header_right']['address_add'] = 'address_add_start';
   else
      $squirrelmail_plugin_hooks['read_body_after_from']['address_add'] = 'address_add_start';
}

/* These are required functions, but try to keep all the code inside another
   file to increase processing speed when we aren't using it.                */

function address_add_start () {
      global $message;
      if (!$message || !isset($message)) return;
      include_once('../plugins/address_add/class.php');
}

function address_add_version() { 
   return '2.1';
}

?>