~ubuntu-branches/ubuntu/saucy/geary/saucy-updates

« back to all changes in this revision

Viewing changes to src/engine/imap/transport/imap-mailbox.vala

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2013-03-14 13:48:23 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130314134823-gyk5av1g508zyj8a
Tags: 0.3.0~pr1-0ubuntu1
New upstream version (FFE lp: #1154316), supports multiple account as
well as full conversation views with inline replies

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    public string name { get { return context.name; } }
23
23
    public int exists { get { return context.exists; } }
24
24
    public int recent { get { return context.recent; } }
25
 
    public int unseen { get { return context.unseen; } }
26
25
    public bool is_readonly { get { return context.is_readonly; } }
27
26
    public UIDValidity? uid_validity { get { return context.uid_validity; } }
28
27
    public UID? uid_next { get { return context.uid_next; } }
29
28
    
30
29
    private SelectedContext context;
 
30
    private Geary.FolderPath folder_path;
31
31
    
32
32
    public signal void exists_altered(int old_exists, int new_exists);
33
33
    
41
41
    
42
42
    public signal void disconnected(Geary.Folder.CloseReason reason);
43
43
    
44
 
    internal Mailbox(SelectedContext context) {
 
44
    internal Mailbox(SelectedContext context, Geary.FolderPath folder_path) {
45
45
        base (context);
46
46
        
47
47
        this.context = context;
 
48
        this.folder_path = folder_path;
48
49
        
49
50
        context.closed.connect(on_closed);
50
51
        context.disconnected.connect(on_disconnected);
77
78
        UID? uid = results.get_data(FetchDataType.UID) as UID;
78
79
        assert(uid != null);
79
80
        
80
 
        Geary.Email email = new Geary.Email(results.msg_num, new Geary.Imap.EmailIdentifier(uid));
 
81
        Geary.Email email = new Geary.Email(results.msg_num,
 
82
            new Geary.Imap.EmailIdentifier(uid, folder_path));
81
83
        msgs.add(email);
82
84
        pos_map.set(email.position, email);
83
85
        
264
266
                if (preview_email == null)
265
267
                    preview_email = accumulate_email(preview_res, msgs, pos_map);
266
268
                
267
 
                preview_email.set_message_preview(new RFC822.PreviewText(
 
269
                preview_email.set_message_preview(new RFC822.PreviewText.with_header(
268
270
                    preview_res.get_body_data()[0], preview_header_results[i].get_body_data()[0]));
269
271
                i++;
270
272
            }
591
593
            if (msg_flags != null) {
592
594
                Geary.Imap.EmailFlags email_flags = new Geary.Imap.EmailFlags(msg_flags);
593
595
                
594
 
                map.set(new Geary.Imap.EmailIdentifier(uid) , email_flags);
 
596
                map.set(new Geary.Imap.EmailIdentifier(uid, folder_path) , email_flags);
595
597
            } else {
596
598
                debug("No flags returned");
597
599
            }
604
606
        if (context.is_closed())
605
607
            throw new ImapError.NOT_SELECTED("Mailbox %s closed", name);
606
608
 
607
 
        yield context.session.send_command_async(new CopyCommand(msg_set, destination.to_string()),
 
609
        yield context.session.send_command_async(
 
610
            new CopyCommand(msg_set, new Geary.Imap.MailboxParameter(destination.to_string())),
608
611
            cancellable);
609
612
    }
610
613
 
640
643
    public string name { get; protected set; }
641
644
    public int exists { get; protected set; }
642
645
    public int recent { get; protected set; }
643
 
    public int unseen { get; protected set; }
644
646
    public bool is_readonly { get; protected set; }
645
647
    public UIDValidity? uid_validity { get; protected set; }
646
648
    public UID? uid_next { get; protected set; }
668
670
        is_readonly = results.readonly;
669
671
        exists = results.exists;
670
672
        recent = results.recent;
671
 
        unseen = results.unseen;
672
673
        uid_validity = results.uid_validity;
673
674
        uid_next = results.uid_next;
674
675