From: x2003bruneau Date: Sat, 13 Jan 2007 20:37:45 +0000 (+0000) Subject: Fix From formatting and unread message support X-Git-Tag: xorg/0.9.13~141 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=b8bf029a6dedfdcb53e5b38f8566a7a3f6128490;p=platal.git Fix From formatting and unread message support git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1330 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/modules/banana/banana.inc.php b/modules/banana/banana.inc.php index 3424c93..0ab2eee 100644 --- a/modules/banana/banana.inc.php +++ b/modules/banana/banana.inc.php @@ -25,31 +25,28 @@ function hook_formatDisplayHeader($_header, $_text, $in_spool = false) { switch ($_header) { case 'from': case 'to': case 'cc': case 'reply-to': - if (in_array($_header, $handled)) { - $addresses = preg_split("/ *, */", $_text); - $text = ''; - foreach ($addresses as $address) { - $address = BananaMessage::formatFrom(trim($address)); - if ($_header == 'from') { - if ($id = Banana::$message->getHeaderValue('x-org-id')) { - return $address . ' ' - . ''; - } elseif ($id = Banana::$message->getHeaderValue('x-org-mail')) { - list($id, $domain) = explode('@', $id); - return $address . ' ' - . ''; - } else { - return $address; - } - } - if (!empty($text)) { - $text .= ', '; - } - $text .= $address; + $addresses = preg_split("/ *, */", $_text); + $text = ''; + foreach ($addresses as $address) { + $address = BananaMessage::formatFrom(trim($address)); + if ($_header == 'from') { + if ($id = Banana::$message->getHeaderValue('x-org-id')) { + return $address . ' ' + . ''; + } elseif ($id = Banana::$message->getHeaderValue('x-org-mail')) { + list($id, $domain) = explode('@', $id); + return $address . ' ' + . ''; + } else { + return $address; + } } - return $text; + if (!empty($text)) { + $text .= ', '; + } + $text .= $address; } - break; + return $text; case 'subject': $link = null; @@ -194,10 +191,6 @@ class PlatalBanana extends Banana SET banana_last = FROM_UNIXTIME({?}) WHERE user_id={?}", $time, S::i('uid')); - if (!is_null(Banana::$group) && !$maj) { - $this->loadSpool(Banana::$group); - Banana::$spool->markAllAsRead(); - } } // Register custom Banana links and tabs