See plugins/fortune/INSTALL.
- Fix for #906217 when checking spelling of inline replies, the corrected
words would appear through original email.
- - Fixed empty information menu when viewing vcards without information
+ - Fixed empty information menu when viewing vCards without information
but name and e-mail address.
- - User may now add an e-mail address when adding vcards without one to the
+ - User may now add an e-mail address when adding vCards without one to the
address book. No need to wait for the error message anymore.
- Removed japanese_xtra function used by older XTRA_CODE calls. Plugins
should use separate xtra_code functions. Older function does not provide
set_url_var($Args[1]['attachment_common']['href'],
'ent_id',$Args[5]);
- $Args[1]['attachment_common']['text'] = _("Business Card");
+ $Args[1]['attachment_common']['text'] = _("View business Card");
$Args[6] = $Args[1]['attachment_common']['href'];
}
* @return int the number of unique addresses found
*/
function parseEmail (&$body) {
- global $color, $Email_RegExp_Match;
+ global $Email_RegExp_Match;
$sbody = $body;
$addresses = array();
$start = strpos($sbody, $regs[0]) + strlen($regs[0]);
$sbody = substr($sbody, $start);
}
+
/* Replace each email address with a compose URL */
foreach ($addresses as $text => $email) {
$comp_uri = makeComposeLink('src/compose.php?send_to='.urlencode($email), $text);
$body = str_replace($text, $comp_uri, $body);
}
+
/* Return number of unique addresses found */
return count($addresses);
}
$blength = strlen($body);
}
}
+
+/**
+ * Parses a string and returns the first e-mail address found.
+ *
+ * @param string string the string to process
+ * @return string the first e-mail address found
+ */
+function getEmail($string) {
+ global $Email_RegExp_Match;
+ $addresses = array();
+
+ /* Find all the email addresses in the body */
+ while (eregi($Email_RegExp_Match, $string, $regs)) {
+ $addresses[$regs[0]] = strtr($regs[0], array('&' => '&'));
+ $start = strpos($string, $regs[0]) + strlen($regs[0]);
+ $string = substr($string, $start);
+ }
+
+ /* Return the first address, or an empty string if no address was found */
+ $addresses = array_values($addresses);
+ return (array_key_exists(0, $addresses) ? $addresses[0] : '');
+}
+
?>
\ No newline at end of file
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-10-24 23:13+0200\n"
+"POT-Creation-Date: 2004-10-26 07:22+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "View"
msgstr ""
-msgid "Business Card"
+msgid "View business Card"
msgstr ""
msgid "Sunday"
/* SquirrelMail required files. */
require_once(SM_PATH . 'include/validate.php');
require_once(SM_PATH . 'functions/mime.php');
+require_once(SM_PATH . 'functions/url_parser.php');
/* globals */
sqgetGlobalVar('username', $username, SQ_SESSION);
'-' . $vcard_safe['lastname'], '20');
/*
- * If the vcard comes with an e-mail address it should be added to the
+ * If the vCard comes with an e-mail address it should be added to the
* address book, otherwise the user must add one manually to avoid an
- * error message in src/addressbook.php.
- *
- * TODO: If there's no e-mail address in the vcard, use the sender's address
- * instead of letting the user entering it manually.
+ * error message in src/addressbook.php. SquirrelMail is nice enough to
+ * suggest the e-mail address of the sender though.
*/
if (isset($vcard_nice['email;internet'])) {
echo addHidden('addaddr[email]', $vcard_nice['email;internet']);
} else {
+ $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
+ $header = $message->rfc822_header;
+ $from_name = $header->getAddr_s('from');
+
echo '</td></tr>' .
'<tr><td align="right"><b>' . _("E-mail address") . ':</b></td><td>' .
- addInput('addaddr[email]', '', '20');
+ addInput('addaddr[email]',
+ getEmail(decodeHeader($from_name)), '20');
}
echo '</td></tr>' .
<table border="0" cellspacing="0" cellpadding="2" align="center">
<tr><td bgcolor="<?php echo $color[4]; ?>">
</td></tr></table>
-</body></html>
+</body></html>
\ No newline at end of file