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

« back to all changes in this revision

Viewing changes to src/dbusservice/dbus-conversation.vala

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2013-10-10 17:40:37 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20131010174037-5p5o4dlsoewek2kg
Tags: 0.4.0-0ubuntu1
New stable version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2011-2013 Yorba Foundation
2
 
 *
3
 
 * This software is licensed under the GNU Lesser General Public License
4
 
 * (version 2.1 or later).  See the COPYING file in this distribution.
5
 
 */
6
 
 
7
 
[DBus (name = "org.yorba.Geary.Conversation", timeout = 120000)]
8
 
public class Geary.DBus.Conversation : Object {
9
 
    
10
 
    public static const string INTERFACE_NAME = "org.yorba.Geary.Conversation";
11
 
    
12
 
    private Geary.App.Conversation conversation;
13
 
    private Geary.Folder folder;
14
 
    
15
 
    public Conversation(Geary.App.Conversation c, Geary.Folder f) {
16
 
        conversation = c;
17
 
        folder = f;
18
 
    }
19
 
    
20
 
    public async ObjectPath[] get_emails() throws IOError {
21
 
        Gee.List<Geary.Email> pool = conversation.get_emails(Geary.App.Conversation.Ordering.DATE_ASCENDING);
22
 
        if (pool.size == 0)
23
 
            return new ObjectPath[0];
24
 
        
25
 
        ObjectPath[] paths = new ObjectPath[0];
26
 
        
27
 
        foreach (Geary.Email e in pool) {
28
 
            paths += new ObjectPath(Database.instance.get_email_path(e, folder));
29
 
        }
30
 
        
31
 
        return paths;
32
 
    }
33
 
}