~ubuntu-branches/ubuntu/jaunty/gnome-do-plugins/jaunty-proposed

« back to all changes in this revision

Viewing changes to Emesene/src/Emesene.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane, Daniel T Chen, Iain Lane
  • Date: 2009-03-18 00:40:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090318004051-ujn1ja3kiu3ky7ru
Tags: 0.8.1.3+dfsg-0ubuntu1
[ Daniel T Chen ]
* New upstream release (LP: #344578)
  + Banshee plugin goes crazy if banshee isn't loaded first
    (LP: #289802)
  + gnome-do gCalculate plugin fails to display "times" symbol
    (LP: #274252)
  + Banshee-1 fails to build in Mono 2.0 (LP: #309188)
  + Pidgin 2.5.4 has incompatible dbus interface. s/uint/int/
    (LP: #314927)
  + Pidgin plugin hangs opening a chat if pidgin is unresponsive
    (LP: #315565)
  + twitter plugin still reports friend updates even when
    deactivated (LP: #317674)
  + Misspelling in microblogging plugin confirmation message
    (LP: #319433)
  + make install uses mdtool, but configure doesn't check for it
    (LP: #322951)
  + Virtualbox Icon in 2.10 are broken because of a new
    specification (LP: #323902)
  + Google Maps Plugin shouldn't always use route (LP: #324271)
  + Fix for Google Maps when using newlines and other special
    characters (LP: #324667)
  + VirtualBox failed to load icon (LP: #325712)
  + 'Read Man Pages' plugin makes Gnome-Do unresponsive
    (LP: #325935)
  + Search returns broken URLs (LP: #327855)
  + Default action for SSH hosts is "open" (LP: #328236)
  + Files and Folders Configuration doesn't use standard buttons
    (LP: #328236)
  + Window manager maximize action should focus if window is not
    currently focused (LP: #258893)
  + Locate plugin has no error message (LP: #262360)
  + Wishlist: Let user specify files and folders to ignore
    (LP: #263177)
  + ts-client plugin doesn't index subdirectories (LP: #322352)
  + Max 3000 items in Files and Folders plugin (LP: #324105)
  + putty cannot find host when running from gnome do
    (LP: #324282)
  + locate plugin with globbing (LP: #334798)
  + Twitter plugin encountered an error in UpdateFriends
    (LP: #317575)
  + gnome-terminal profiles no longer work (LP: #321977)
  + Creating a task using Remember the Milk plugin can fail if
    no task list is specified (LP: #324066)
  + bundled libraries makefile needs destdir (LP: #324704)
  + Typographical error in del.icio.us plugin (LP: #330525)
  + ImageShack fails to upload (LP: #337324)
* debian/copyright
  + Refresh for new upstream version; new plugins added.
* debian/patches/00_dfsg_autofoo.dpatch
  + Update for new upstream version
  + Don't build the YouTube plugin due to removal of shipped
    exes and dlls causing FTBFS
* debian/patches/02_ssh_respect_exec_arg.dpatch
  debian/patches/03_buildsystem_respect_mcs.dpatch
  debian/patches/04_fix_pidgin_dbus_ints.dpatch
  + Drop; fixed upstream

[ Iain Lane ]
* debian/rules: Update repackaging to not delete *.dll; upstream now ships
  source copies of google-gdata meaning we can now enable the Google and
  Youtube plugins.
* debian/patches/00_dfsg_autofoo: Drop, fixed by including and building
  these libs now. 
* debian/copyright: Update with information for google-gdata. 
* debian/patches/04_fix_pidgin_dbus_ints.dpatch: Add left out piece of patch
* debian/control: Bump gnome-do build-dep to require current version. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using NDesk.DBus;
 
3
using org.freedesktop.DBus;
 
4
using System.Collections.Generic;
 
5
using Do.Universe;
 
6
using Do.Platform;
 
7
 
 
8
namespace Do.Universe
 
9
{
 
10
        public class Emesene
 
11
        {
 
12
                
 
13
                const string emeseneObjectPath = "/org/emesene/dbus";
 
14
                const string emeseneServiceBusName = "org.emesene.dbus";
 
15
                public static List<Item> status;
 
16
                
 
17
                public static string getAvatarPathForUser()
 
18
                {
 
19
                        return Emesene.getPathForUser()+"avatars";
 
20
                }
 
21
                
 
22
                public static string getCachePathForUser()
 
23
                {
 
24
                        return Emesene.getPathForUser()+"cache";
 
25
                }
 
26
                
 
27
                private static string getPathForUser(){
 
28
                        string user = Emesene.getCurrentEmeseneUser();
 
29
                        user = user.Replace(".","_");
 
30
                        user = Environment.GetFolderPath(Environment.SpecialFolder.Personal)+
 
31
                                                        "/.config/emesene1.0/"+user.Replace("@","_")+
 
32
                                                                "/";
 
33
                        return user;
 
34
                }
 
35
                
 
36
                [Interface ("org.emesene.dbus")]
 
37
                public interface EmeseneInterface
 
38
                {
 
39
                        void open_conversation(string email, bool weStarted);
 
40
                        void open_conversation(string email);
 
41
                        string get_last_display_picture(string account, bool cache);
 
42
                        string get_user_account();
 
43
                        string set_nick(string nick);
 
44
                        bool set_avatar(string path);
 
45
                        string set_psm(string psm);
 
46
                        string set_status(string status);
 
47
                        void get_conversation_history(string email);
 
48
                        void get_avatar_history(string email);
 
49
                        string get_email_page();
 
50
                }
 
51
                
 
52
                static Emesene()
 
53
                {
 
54
                        //Populate emesene status list                  
 
55
                        status = new List<Item>();
 
56
                        status.Add(new EmeseneStatusItem("online", "online status", "NLN"));
 
57
                        status.Add(new EmeseneStatusItem("away", "away status", "AWY"));
 
58
                        status.Add(new EmeseneStatusItem("brb", "brb status", "BRB"));
 
59
                        status.Add(new EmeseneStatusItem("busy", "busy status", "BSY"));
 
60
                        status.Add(new EmeseneStatusItem("idle", "idle status", "IDL"));
 
61
                        status.Add(new EmeseneStatusItem("lunch", "lunch status", "LUN"));
 
62
                        status.Add(new EmeseneStatusItem("invisible", "invisible status", "HDN"));
 
63
                        status.Add(new EmeseneStatusItem("phone", "phone status", "PHN"));
 
64
                        status.Add(new EmeseneStatusItem("offline", "offline status", "FLN"));
 
65
                        
 
66
                }
 
67
 
 
68
                public static EmeseneInterface getEmeseneObject()
 
69
                {
 
70
                        try 
 
71
                        {
 
72
                                return Bus.Session.GetObject<EmeseneInterface>
 
73
                                        (emeseneServiceBusName, new ObjectPath (emeseneObjectPath));
 
74
                        }
 
75
                        catch(Exception e)
 
76
                        {
 
77
                Log<Emesene>.Error ("Emesene > Error getting EmeseneObject - {0}", e.Message);
 
78
                                Log<Emesene>.Debug (e.StackTrace);
 
79
                                return null;
 
80
                        }
 
81
                }
 
82
                
 
83
                
 
84
                public static bool checkForEmesene()
 
85
                {
 
86
                        try
 
87
                        {
 
88
                                EmeseneInterface em = Bus.Session.GetObject<EmeseneInterface>
 
89
                                        (emeseneServiceBusName, new ObjectPath (emeseneObjectPath));
 
90
                                em.get_user_account();
 
91
                                return true;
 
92
                        } 
 
93
                        catch(Exception e) 
 
94
                        {
 
95
                                return false;
 
96
                        }
 
97
                }
 
98
                
 
99
                public static void openChatWith(string mail)
 
100
                {
 
101
                        EmeseneInterface em = Emesene.getEmeseneObject();
 
102
                        try{
 
103
                            em.open_conversation(mail, true);
 
104
                        }catch(Exception e){
 
105
                            //User is using older emesene
 
106
                            //em.open_conversation(mail);
 
107
                            Log<Emesene>.Debug ("Old version of emesene");
 
108
                        Log<Emesene>.Debug (e.StackTrace);
 
109
                        }
 
110
                        
 
111
                }
 
112
                
 
113
                public static string getCurrentEmeseneUser()
 
114
                {
 
115
                        EmeseneInterface em = Emesene.getEmeseneObject();
 
116
                        return em.get_user_account();
 
117
                }
 
118
                
 
119
                public static string get_last_display_picture(string account, bool cache)
 
120
                {
 
121
                        EmeseneInterface em = Emesene.getEmeseneObject();
 
122
                        return em.get_last_display_picture(account, cache);
 
123
                }
 
124
                
 
125
                public static string set_nick(string nick)
 
126
                {
 
127
                        EmeseneInterface em = Emesene.getEmeseneObject();
 
128
                        return em.set_nick(nick);
 
129
                }
 
130
                
 
131
                public static bool set_avatar(string path)
 
132
                {
 
133
                        EmeseneInterface em = Emesene.getEmeseneObject();
 
134
                        return em.set_avatar(path);
 
135
                }
 
136
                
 
137
                public static string set_psm(string psm)
 
138
                {
 
139
                        EmeseneInterface em = Emesene.getEmeseneObject();
 
140
                        return em.set_psm(psm);
 
141
                }
 
142
                
 
143
                public static string set_status(string status)
 
144
                {
 
145
                        EmeseneInterface em = Emesene.getEmeseneObject();
 
146
                        return em.set_status(status);
 
147
                }
 
148
                
 
149
                public static void get_conversation_history(string email)
 
150
                {
 
151
                        EmeseneInterface em = Emesene.getEmeseneObject();
 
152
                        em.get_conversation_history(email);
 
153
                }
 
154
                
 
155
                public static void get_avatar_history(string email)
 
156
                {
 
157
                        EmeseneInterface em = Emesene.getEmeseneObject();
 
158
                        em.get_avatar_history(email);
 
159
                }
 
160
                
 
161
                public static string get_email_page()
 
162
                {
 
163
                        EmeseneInterface em = Emesene.getEmeseneObject();
 
164
                        return em.get_email_page();
 
165
                }
 
166
                
 
167
        }
 
168
}