Implement user flags for mimp
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 2 Apr 2009 14:58:27 +0000 (08:58 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 2 Apr 2009 14:58:27 +0000 (08:58 -0600)
imp/mailbox-mimp.php
imp/message-mimp.php

index fbaa686..bfcd6db 100644 (file)
@@ -109,14 +109,6 @@ while (list(,$ob) = each($mbox_info['overview'])) {
         $msg['from'] = String::substr($msg['from'], 0, $conf['mimp']['mailbox']['max_from_chars']) . '...';
     }
 
-    if (!is_null($threadob) && ($threadob->getThreadIndent($ob['uid']))) {
-        $msg['subject'] = '>> ' . ltrim($msg['subject']);
-    }
-
-    if (String::length($msg['subject']) > $conf['mimp']['mailbox']['max_subj_chars']) {
-        $msg['subject'] = String::substr($msg['subject'], 0, $conf['mimp']['mailbox']['max_subj_chars']) . '...';
-    }
-
     /* Get flag information. */
     $imp_flags = &IMP_Imap_Flags::singleton();
     $flag_parse = $imp_flags->parse(array(
@@ -128,9 +120,24 @@ while (list(,$ob) = each($mbox_info['overview'])) {
     foreach ($flag_parse as $val) {
         if (isset($val['abbrev'])) {
             $msg['status'] .= $val['abbrev'];
+        } elseif ($val['type'] == 'imapp') {
+            $msg['subject'] = '*' .
+                ((String::length($val['label']) > 8)
+                     ? String::substr($val['label'], 0, 5) . '...'
+                     : $val['label']
+                ) .
+                '* ' . $msg['subject'];
         }
     }
 
+    if (!is_null($threadob) && ($threadob->getThreadIndent($ob['uid']))) {
+        $msg['subject'] = '>> ' . ltrim($msg['subject']);
+    }
+
+    if (String::length($msg['subject']) > $conf['mimp']['mailbox']['max_subj_chars']) {
+        $msg['subject'] = String::substr($msg['subject'], 0, $conf['mimp']['mailbox']['max_subj_chars']) . '...';
+    }
+
     /* Generate the target link. */
     $msg['target'] = in_array('\\draft', $ob['flags'])
         ? IMP::composeLink(array(), array('a' => 'd', 'thismailbox' => $imp_mbox['mailbox'], 'index' => $ob['uid'], 'bodypart' => 1))
index beedafa..1405f0b 100644 (file)
@@ -224,6 +224,12 @@ $flag_parse = $imp_flags->parse(array(
 foreach ($flag_parse as $val) {
     if (isset($val['abbrev'])) {
         $status .= $val['abbrev'];
+    } elseif ($val['type'] == 'imapp') {
+        if (String::length($val['label']) > 8) {
+            $status .= ' *' . String::substr($val['label'], 0, 5) . '...*';
+        } else {
+            $status .= ' *' . $val['label'] . '*';
+        }
     }
 }
 
@@ -339,7 +345,7 @@ MIMP::addMIMPMenu($mset, 'message');
 
 $mimp_render->set('title', $display_headers['subject']);
 
-$c = &$mimp_render->add(new Horde_Mobile_card('m', $status . ' ' . $display_headers['subject'] . ' ' . sprintf(_("(%d of %d)"), $msgindex, $msgcount)));
+$c = &$mimp_render->add(new Horde_Mobile_card('m', ($status ? $status . ' | ' : '') . $display_headers['subject'] . ' ' . sprintf(_("(%d of %d)"), $msgindex, $msgcount)));
 $c->softkey('#o', _("Menu"));
 
 $imp_notify->setMobileObject($c);