Changeset 619


Ignore:
Timestamp:
01/20/10 18:19:59 (2 years ago)
Author:
octorian
Message:

Made a mailbox do a full (not flags-only) fetch on any refresh request other than the first one. This fixes the destination-folder issue with doing IMAP copy, and probably other issues as well.

Location:
trunk/LogicMail/src/org/logicprobe/LogicMail
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LogicMail/src/org/logicprobe/LogicMail/mail/FolderTreeItem.java

    r593 r619  
    245245        this.unseenCount = unseenCount; 
    246246    } 
     247 
     248    /* (non-Javadoc) 
     249     * @see java.lang.Object#hashCode() 
     250     */ 
     251    public int hashCode() { 
     252        return 31 * 1 + (int) (uniqueId ^ (uniqueId >>> 32)); 
     253    } 
     254 
     255    /* (non-Javadoc) 
     256     * @see java.lang.Object#equals(java.lang.Object) 
     257     */ 
     258    public boolean equals(Object obj) { 
     259        if (this == obj) { 
     260            return true; 
     261        } 
     262        if (obj == null) { 
     263            return false; 
     264        } 
     265        if (getClass() != obj.getClass()) { 
     266            return false; 
     267        } 
     268        FolderTreeItem other = (FolderTreeItem) obj; 
     269        if (uniqueId != other.uniqueId) { 
     270            return false; 
     271        } 
     272        return true; 
     273    } 
    247274} 
  • trunk/LogicMail/src/org/logicprobe/LogicMail/model/MailboxNode.java

    r618 r619  
    7575        private int unseenMessageCount; 
    7676    private Vector pendingExpungeMessages = new Vector(); 
    77          
     77     
     78    /** 
     79     * Flag to ensure that a flags-only fetch only happens on the first 
     80     * refresh of a network store backed mailbox. 
     81     */ 
     82        private boolean fetchFlagsOnly = true; 
     83     
    7884        protected Object fetchLock = new Object(); 
    7985        protected Thread fetchThread; 
     
    936942     
    937943    private class RefreshMessagesThread extends Thread implements MessageNodeCallback { 
    938  
    939944        public RefreshMessagesThread() { 
    940945             
     
    959964            else { 
    960965                // Request flags and tokens for recent messages from the mail store 
    961                 parentAccount.getMailStore().requestFolderMessagesRecent(folderTreeItem, true); 
     966                parentAccount.getMailStore().requestFolderMessagesRecent( 
     967                        folderTreeItem, 
     968                        fetchFlagsOnly, 
     969                        new MailStoreRequestCallback() { 
     970                            public void mailStoreRequestComplete() { 
     971                                synchronized(fetchLock) { 
     972                                    fetchFlagsOnly = false; 
     973                                } 
     974                            } 
     975                            public void mailStoreRequestFailed(Throwable exception) { } 
     976                        }); 
    962977            } 
    963978        }         
Note: See TracChangeset for help on using the changeset viewer.