[Hastymail-cvs] SF.net SVN: hastymail:[1766] trunk/hastymail2/plugins/message_tags
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2011-01-19 19:13:18
|
Revision: 1766 http://hastymail.svn.sourceforge.net/hastymail/?rev=1766&view=rev Author: sailfrog Date: 2011-01-19 19:13:12 +0000 (Wed, 19 Jan 2011) Log Message: ----------- more tags plugin updates Modified Paths: -------------- trunk/hastymail2/plugins/message_tags/README trunk/hastymail2/plugins/message_tags/work.php Modified: trunk/hastymail2/plugins/message_tags/README =================================================================== --- trunk/hastymail2/plugins/message_tags/README 2011-01-19 16:56:58 UTC (rev 1765) +++ trunk/hastymail2/plugins/message_tags/README 2011-01-19 19:13:12 UTC (rev 1766) @@ -3,11 +3,11 @@ directed to ja...@ha.... TODO: - tags management options: - STARTED: rescan for tags option auto-complete existing tags when editing + Add explanitory text to the tags management page multiple instance issues + DONE: rescan for tags option DONE: delete tag DONE: rename tag DONE: and/or tag searching on main tags page Modified: trunk/hastymail2/plugins/message_tags/work.php =================================================================== --- trunk/hastymail2/plugins/message_tags/work.php 2011-01-19 16:56:58 UTC (rev 1765) +++ trunk/hastymail2/plugins/message_tags/work.php 2011-01-19 19:13:12 UTC (rev 1766) @@ -593,18 +593,33 @@ } return $tags; } - /* repair mismatched tag data where possible */ + /* repair mismatched tag data if possible */ function repair() { - /* - * if tag_source is "imap": - * - rescan all folders for non-standard flags - * - rebuild tag_list and tag_map - * - save_settings - * if tag_source is not "imap": - * - use tag_map to rebuild tag_list - * - note any mismatches - * - save_settings - */ + if ($this->tag_source == 'imap') { + $this->tag_map = array(); + $this->tag_list = array(); + foreach ($this->tools->imap_get_folders() as $vals) { + $folder = $vals['realname']; + $this->tools->imap_select_mailbox($folder, 'ARRIVAL', false, true); + $this->tag_map[$folder] = $this->get_tags($folder); + } + } + else { + $this->tag_list = array(); + foreach ($this->tag_map as $folder => $vals) { + foreach ($vals as $uid => $tlist) { + foreach ($tlist as $tag) { + if (!isset($this->tag_list[$tag][$folder])) { + $this->tag_list[$tag][$folder] = 1; + } + else { + $this->tag_list[$tag][$folder] += 1; + } + } + } + } + } + $this->save_settings(); } /* reset all tags (for debugging) */ function reset() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |