Hi,
The attached patch makes Roundcube's subject sorting behave the same way
as Mozilla Thunderbird does. When the mail is sorted by subject, the
reply & forward identifiers (Fwd:,Re:,Fw: etc) are ignored.
Old behaviour (sorted by subject):
'Announcement of new release'
'Courier-IMAP problem when opening new mail'
'Mysql 5 final released'
'Re: announcement of new release'
New behaviour (sorted by subject):
'Announcement of new release'
'Re: Announcement of new release'
'Courier-IMAP problem when opening new mail'
'Mysql 5 final released'
Maybe the identifiers should be configured per language?
jasper
--- ../roundcube2/program/lib/imap.inc 2005-10-24 12:13:36.000000000 +0200
+++ program/lib/imap.inc 2005-10-25 15:10:28.731941456 +0200
@@ -1365,8 +1365,15 @@
}
function iil_SortHeaders($a, $field, $flag){
+
+ /*
+ Strip replies & forward identifiers when sorting the subjects
+ */
+
+ $stripArr = ($field=='subject')? array('Re: ','Fwd: ','Fw: ',"\"") : array("\"");
+
if (empty($field)) $field="uid";
$field=strtolower($field);
if ($field=="date"||$field=='internaldate') $field="timestamp";
if (empty($flag)) $flag="ASC";
@@ -1385,9 +1392,9 @@
reset($a);
while (list($key, $val)=each($a)){
$data=$a[$key]->$field;
- if (is_string($data)) $data=strtoupper(str_replace("\"", "", $data));
+ if (is_string($data)) $data=strtoupper(str_ireplace($stripArr, "", $data));
$index[$key]=$data;
}
// sort index