Merge lp://qastaging/~luismmontielg/do-plugins/Facebook into lp://qastaging/do-plugins
- Merge into trunk
Proposed by
Alex Launi
Status: | Rejected |
---|---|
Rejected by: | Alex Launi |
Proposed branch: | lp://qastaging/~luismmontielg/do-plugins/Facebook |
Merge into: | lp://qastaging/do-plugins |
Diff against target: | None lines |
To merge this branch: | bzr merge lp://qastaging/~luismmontielg/do-plugins/Facebook |
Related bugs: |
This proposal supersedes a proposal from 2009-02-09.
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Luis Montiel (luismmontielg) wrote : Posted in a previous version of this proposal | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alex Launi (alexlauni) wrote : Posted in a previous version of this proposal | # |
Looks good!
review:
Approve
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alex Launi (alexlauni) wrote : Posted in a previous version of this proposal | # |
Uh, i never voted on this proposal, I voted on Shelf. Wtf!
review:
Abstain
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alex Launi (alexlauni) wrote : Posted in a previous version of this proposal | # |
Requires a restart of Do to connect, you should make it do a connect whenever the "apply" button is clicked.
review:
Disapprove
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alex Launi (alexlauni) wrote : Posted in a previous version of this proposal | # |
It's kind of annoying to index my wall posts, messages, etc. You should just keep these wrapped up in an item source and let me arrow into them. Indexing friends is ok however.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Luis Montiel (luismmontielg) wrote : Posted in a previous version of this proposal | # |
yeah thanks, they are not indexed anymore :) check it out
Unmerged revisions
- 546. By Luis Montiel <luis@luis-laptop>
-
no more indexing walls and inbox
- 545. By Luis Montiel <luis@luis-laptop>
- 544. By Luis Montiel <luis@luis-laptop>
-
updating with latest trunk
- 543. By Luis Montiel <luis@luis-laptop>
-
fixedstatus notification
- 542. By Luis Montiel <luis@luis-laptop>
-
fixed crash
- 541. By Luis Montiel <luis@luis-laptop>
-
minor fixes
- 540. By Luis Montiel <luis@luis-laptop>
-
updating with latest trunk
- 539. By Luis Montiel <luis@luis-laptop>
-
no more goto
- 538. By Luis Montiel <luis@luis-laptop>
-
minor fixes
- 537. By Luis Montiel <luis@luis-laptop>
-
updating with latest trun
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'BundledLibraries/FacebookCSharp_Desktop.dll' |
2 | Binary files BundledLibraries/FacebookCSharp_Desktop.dll 1970-01-01 00:00:00 +0000 and BundledLibraries/FacebookCSharp_Desktop.dll 2009-02-11 21:48:29 +0000 differ |
3 | === modified file 'BundledLibraries/Makefile.am' |
4 | --- BundledLibraries/Makefile.am 2009-02-05 23:34:47 +0000 |
5 | +++ BundledLibraries/Makefile.am 2009-02-09 20:53:00 +0000 |
6 | @@ -9,8 +9,12 @@ |
7 | Google.GData.YouTube.dll \ |
8 | Google.GData.Extensions.dll |
9 | |
10 | +FACEBOOK_LIBS = \ |
11 | + FacebookCSharp_Desktop.dll |
12 | + |
13 | bundle_DATA = \ |
14 | $(addprefix $(srcdir)/,$(GOOGLE_LIBS)) \ |
15 | + $(addprefix $(srcdir)/,$(FACEBOOK_LIBS)) \ |
16 | $(BANSHEE_INDEXER_DLL) |
17 | |
18 | EXTRA_DIST=$(GOOGLE_LIBS) gmcs.exe |
19 | |
20 | === modified file 'DoPlugins.mds' |
21 | --- DoPlugins.mds 2009-02-28 16:16:48 +0000 |
22 | +++ DoPlugins.mds 2009-03-01 18:29:01 +0000 |
23 | @@ -69,6 +69,7 @@ |
24 | <Entry build="True" name="xmms2" configuration="Debug" /> |
25 | <Entry build="True" name="TinyUrl" configuration="Debug" /> |
26 | <Entry build="True" name="Tracker" configuration="Debug" /> |
27 | + <Entry build="True" name="Facebook" configuration="Debug" /> |
28 | <Entry build="True" name="YouTube" configuration="Debug" /> |
29 | <Entry build="True" name="Emesene" configuration="Debug" /> |
30 | </Configuration> |
31 | @@ -140,6 +141,7 @@ |
32 | <Entry build="True" name="xmms2" configuration="Release" /> |
33 | <Entry build="True" name="TinyUrl" configuration="Release" /> |
34 | <Entry build="True" name="Tracker" configuration="Release" /> |
35 | + <Entry build="True" name="Facebook" configuration="Release" /> |
36 | <Entry build="True" name="YouTube" configuration="Release" /> |
37 | <Entry build="True" name="Emesene" configuration="Release" /> |
38 | </Configuration> |
39 | @@ -212,6 +214,7 @@ |
40 | <Execute type="None" entry="xmms2" /> |
41 | <Execute type="None" entry="TinyUrl" /> |
42 | <Execute type="None" entry="Tracker" /> |
43 | + <Execute type="None" entry="Facebook" /> |
44 | <Execute type="None" entry="YouTube" /> |
45 | <Execute type="None" entry="Emesene" /> |
46 | </StartMode> |
47 | @@ -284,6 +287,7 @@ |
48 | <Entry filename="Xmms2/xmms2.mdp" /> |
49 | <Entry filename="TinyUrl/TinyUrl.mdp" /> |
50 | <Entry filename="Tracker/Tracker.mdp" /> |
51 | + <Entry filename="Facebook/Facebook.mdp" /> |
52 | <Entry filename="YouTube/YouTube.mdp" /> |
53 | <Entry filename="Emesene/Emesene.mdp" /> |
54 | </Entries> |
55 | |
56 | === added directory 'Facebook' |
57 | === added file 'Facebook/Facebook.mdp' |
58 | --- Facebook/Facebook.mdp 1970-01-01 00:00:00 +0000 |
59 | +++ Facebook/Facebook.mdp 2009-03-04 23:34:47 +0000 |
60 | @@ -0,0 +1,72 @@ |
61 | +<Project name="Facebook" fileversion="2.0" language="C#" clr-version="Net_2_0" targetFramework="2.0" ctype="DotNetProject"> |
62 | + <Configurations active="Debug"> |
63 | + <Configuration name="Debug" ctype="DotNetProjectConfiguration"> |
64 | + <Output directory="bin/Debug" assembly="Facebook" /> |
65 | + <Build debugmode="True" target="Library" /> |
66 | + <Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" /> |
67 | + <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> |
68 | + </Configuration> |
69 | + <Configuration name="Release" ctype="DotNetProjectConfiguration"> |
70 | + <Output directory="bin/Release" assembly="Facebook" /> |
71 | + <Build debugmode="False" target="Library" /> |
72 | + <Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" /> |
73 | + <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> |
74 | + </Configuration> |
75 | + </Configurations> |
76 | + <Contents> |
77 | + <File name="." subtype="Directory" buildaction="Compile" /> |
78 | + <File name="src/Facebook.cs" subtype="Code" buildaction="Compile" /> |
79 | + <File name="src/FacebookContactItem.cs" subtype="Code" buildaction="Compile" /> |
80 | + <File name="src/FacebookContactItemSource.cs" subtype="Code" buildaction="Compile" /> |
81 | + <File name="src/Preferences.cs" subtype="Code" buildaction="Compile" /> |
82 | + <File name="src/FacebookConfig.cs" subtype="Code" buildaction="Compile" /> |
83 | + <File name="Resources/Facebook.addin.xml" subtype="Code" buildaction="EmbedAsResource" /> |
84 | + <File name="Resources/Facebook.png" subtype="Code" buildaction="EmbedAsResource" /> |
85 | + <File name="Resources/Facebook_user.png" subtype="Code" buildaction="EmbedAsResource" /> |
86 | + <File name="src/FacebookPostWallAction.cs" subtype="Code" buildaction="Compile" /> |
87 | + <File name="src/FacebookSendMailAction.cs" subtype="Code" buildaction="Compile" /> |
88 | + <File name="Resources/Facebook_mail.png" subtype="Code" buildaction="EmbedAsResource" /> |
89 | + <File name="Resources/Facebook_wall.png" subtype="Code" buildaction="EmbedAsResource" /> |
90 | + <File name="src/FacebookInboxMessageItem.cs" subtype="Code" buildaction="Compile" /> |
91 | + <File name="src/FacebookChangePSMAction.cs" subtype="Code" buildaction="Compile" /> |
92 | + <File name="Resources/Facebook_changePSM.png" subtype="Code" buildaction="EmbedAsResource" /> |
93 | + <File name="src/FacebookPokeFriendAction.cs" subtype="Code" buildaction="Compile" /> |
94 | + <File name="Resources/Facebook_poke.png" subtype="Code" buildaction="EmbedAsResource" /> |
95 | + <File name="src/FacebookOpenAlbumAction.cs" subtype="Code" buildaction="Compile" /> |
96 | + <File name="Resources/Facebook_albums.png" subtype="Code" buildaction="EmbedAsResource" /> |
97 | + <File name="src/FacebookOutBoxMessageItem.cs" subtype="Code" buildaction="Compile" /> |
98 | + <File name="src/FacebookPageItemSource.cs" subtype="Code" buildaction="Compile" /> |
99 | + <File name="src/FacebookPageItem.cs" subtype="Code" buildaction="Compile" /> |
100 | + <File name="Resources/Facebook_boxes.png" subtype="Code" buildaction="EmbedAsResource" /> |
101 | + <File name="Resources/Facebook_bumper.png" subtype="Code" buildaction="EmbedAsResource" /> |
102 | + <File name="Resources/Facebook_events.png" subtype="Code" buildaction="EmbedAsResource" /> |
103 | + <File name="Resources/Facebook_friend_request.png" subtype="Code" buildaction="EmbedAsResource" /> |
104 | + <File name="Resources/Facebook_home.png" subtype="Code" buildaction="EmbedAsResource" /> |
105 | + <File name="Resources/Facebook_notifications.png" subtype="Code" buildaction="EmbedAsResource" /> |
106 | + <File name="Resources/Facebook_pages.png" subtype="Code" buildaction="EmbedAsResource" /> |
107 | + <File name="Resources/Facebook_profile.png" subtype="Code" buildaction="EmbedAsResource" /> |
108 | + <File name="Resources/Facebook_video.png" subtype="Code" buildaction="EmbedAsResource" /> |
109 | + <File name="src/FacebookOpenWallToWallAction.cs" subtype="Code" buildaction="Compile" /> |
110 | + <File name="Resources/Facebook_mail2.png" subtype="Code" buildaction="EmbedAsResource" /> |
111 | + <File name="Resources/Facebook_mail-inbox.png" subtype="Code" buildaction="EmbedAsResource" /> |
112 | + <File name="Resources/Facebook_compose_mail.png" subtype="Code" buildaction="EmbedAsResource" /> |
113 | + <File name="src/FacebookOpenVideosAction.cs" subtype="Code" buildaction="Compile" /> |
114 | + <File name="src/FacebookOpenBoxesAction.cs" subtype="Code" buildaction="Compile" /> |
115 | + <File name="src/FacebookOpenFriendsInCommonAction.cs" subtype="Code" buildaction="Compile" /> |
116 | + <File name="src/FacebookWallPostItem.cs" subtype="Code" buildaction="Compile" /> |
117 | + <File name="src/FacebookReplyWallAction.cs" subtype="Code" buildaction="Compile" /> |
118 | + <File name="src/FacebookReplyMessageAction.cs" subtype="Code" buildaction="Compile" /> |
119 | + <File name="src/Notifications.cs" subtype="Code" buildaction="Compile" /> |
120 | + </Contents> |
121 | + <References> |
122 | + <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
123 | + <ProjectReference type="Gac" localcopy="True" refto="Do.Platform, Version=0.9.0.0, Culture=neutral, PublicKeyToken=null" /> |
124 | + <ProjectReference type="Gac" localcopy="True" refto="Do.Universe, Version=0.9.0.0, Culture=neutral, PublicKeyToken=null" /> |
125 | + <ProjectReference type="Gac" localcopy="True" refto="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
126 | + <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" /> |
127 | + <ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
128 | + <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
129 | + <ProjectReference type="Gac" localcopy="True" refto="Do.Platform.Linux, Version=0.9.0.0, Culture=neutral, PublicKeyToken=null" /> |
130 | + <ProjectReference type="Assembly" localcopy="True" refto="../BundledLibraries/FacebookCSharp_Desktop.dll" /> |
131 | + </References> |
132 | +</Project> |
133 | \ No newline at end of file |
134 | |
135 | === added file 'Facebook/Makefile.am' |
136 | --- Facebook/Makefile.am 1970-01-01 00:00:00 +0000 |
137 | +++ Facebook/Makefile.am 2009-03-04 23:34:47 +0000 |
138 | @@ -0,0 +1,59 @@ |
139 | +include $(top_srcdir)/build.rules.mk |
140 | + |
141 | +ASSEMBLY=Facebook |
142 | + |
143 | +FILES = \ |
144 | + src/Facebook.cs \ |
145 | + src/FacebookChangePSMAction.cs \ |
146 | + src/FacebookConfig.cs \ |
147 | + src/FacebookContactItem.cs \ |
148 | + src/FacebookContactItemSource.cs \ |
149 | + src/FacebookInboxMessageItem.cs \ |
150 | + src/FacebookOpenAlbumAction.cs \ |
151 | + src/FacebookOpenBoxesAction.cs \ |
152 | + src/FacebookOpenFriendsInCommonAction.cs \ |
153 | + src/FacebookOpenVideosAction.cs \ |
154 | + src/FacebookOpenWallToWallAction.cs \ |
155 | + src/FacebookOutBoxMessageItem.cs \ |
156 | + src/FacebookPageItem.cs \ |
157 | + src/FacebookPageItemSource.cs \ |
158 | + src/FacebookPokeFriendAction.cs \ |
159 | + src/FacebookPostWallAction.cs \ |
160 | + src/FacebookSendMailAction.cs \ |
161 | + src/FacebookReplyMessageAction.cs \ |
162 | + src/FacebookReplyWallAction.cs \ |
163 | + src/FacebookWallPostItem.cs \ |
164 | + src/Notifications.cs \ |
165 | + src/Preferences.cs |
166 | + |
167 | +RESOURCES = \ |
168 | + Resources/Facebook.addin.xml \ |
169 | + Resources/Facebook.png \ |
170 | + Resources/Facebook_albums.png \ |
171 | + Resources/Facebook_boxes.png \ |
172 | + Resources/Facebook_bumper.png \ |
173 | + Resources/Facebook_changePSM.png \ |
174 | + Resources/Facebook_compose_mail.png \ |
175 | + Resources/Facebook_events.png \ |
176 | + Resources/Facebook_friend_request.png \ |
177 | + Resources/Facebook_home.png \ |
178 | + Resources/Facebook_mail.png \ |
179 | + Resources/Facebook_mail2.png \ |
180 | + Resources/Facebook_mail-inbox.png \ |
181 | + Resources/Facebook_notifications.png \ |
182 | + Resources/Facebook_pages.png \ |
183 | + Resources/Facebook_poke.png \ |
184 | + Resources/Facebook_profile.png \ |
185 | + Resources/Facebook_user.png \ |
186 | + Resources/Facebook_video.png \ |
187 | + Resources/Facebook_wall.png |
188 | + |
189 | +REFERENCES = \ |
190 | + System \ |
191 | + System.Core \ |
192 | + Mono.Posix \ |
193 | + $(top_srcdir)/BundledLibraries/FacebookCSharp_Desktop.dll \ |
194 | + $(DO_PLATFORM_LIBS) \ |
195 | + $(GTK_SHARP_20_LIBS) \ |
196 | + $(DO_PLATFORM_LINUX_LIBS) \ |
197 | + $(DO_UNIVERSE_LIBS) |
198 | |
199 | === added directory 'Facebook/Resources' |
200 | === added file 'Facebook/Resources/Facebook.addin.xml' |
201 | --- Facebook/Resources/Facebook.addin.xml 1970-01-01 00:00:00 +0000 |
202 | +++ Facebook/Resources/Facebook.addin.xml 2009-03-04 23:34:47 +0000 |
203 | @@ -0,0 +1,39 @@ |
204 | +<Addin |
205 | + id="Facebook" |
206 | + namespace="Do" |
207 | + version="1.2" |
208 | + name="Facebook" |
209 | + description="Indexes your Facebook contact list, and allows you to send wall posts and mails." |
210 | + author="Luis Miguel Montiel G" |
211 | + category="Community" |
212 | +> |
213 | + |
214 | + <Runtime> |
215 | + <Import assembly="Facebook.dll"/> |
216 | + <Import assembly="FacebookCSharp_Desktop.dll"/> |
217 | + </Runtime> |
218 | + |
219 | + <Dependencies> |
220 | + <Addin id="Universe" version="1.0" /> |
221 | + </Dependencies> |
222 | + |
223 | + <!-- Extensions included in this assembly --> |
224 | + <!-- Sources --> |
225 | + <Extension path="/Do/ItemSource"> |
226 | + <ItemSource type="Facebook.FacebookContactItemSource" /> |
227 | + <ItemSource type="Facebook.FacebookPageItemSource" /> |
228 | + </Extension> |
229 | + <Extension path = "/Do/Action"> |
230 | + <Action type="Facebook.FacebookPostWallAction" /> |
231 | + <Action type="Facebook.FacebookSendMailAction" /> |
232 | + <Action type="Facebook.FacebookChangePSMAction" /> |
233 | + <Action type="Facebook.FacebookPokeFriendAction" /> |
234 | + <Action type="Facebook.FacebookOpenAlbumAction" /> |
235 | + <Action type="Facebook.FacebookOpenBoxesAction" /> |
236 | + <Action type="Facebook.FacebookOpenVideosAction" /> |
237 | + <Action type="Facebook.FacebookFriendsInCommonAction" /> |
238 | + <Action type="Facebook.FacebookOpenWallToWallAction" /> |
239 | + <Action type="Facebook.FacebookReplyWallAction" /> |
240 | + <Action type="Facebook.FacebookReplyMessageAction" /> |
241 | + </Extension> |
242 | +</Addin> |
243 | |
244 | === added file 'Facebook/Resources/Facebook.png' |
245 | Binary files Facebook/Resources/Facebook.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook.png 2009-02-05 23:45:40 +0000 differ |
246 | === added file 'Facebook/Resources/Facebook_albums.png' |
247 | Binary files Facebook/Resources/Facebook_albums.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_albums.png 2009-02-09 20:53:00 +0000 differ |
248 | === added file 'Facebook/Resources/Facebook_boxes.png' |
249 | Binary files Facebook/Resources/Facebook_boxes.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_boxes.png 2009-02-09 20:53:00 +0000 differ |
250 | === added file 'Facebook/Resources/Facebook_bumper.png' |
251 | Binary files Facebook/Resources/Facebook_bumper.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_bumper.png 2009-02-09 20:53:00 +0000 differ |
252 | === added file 'Facebook/Resources/Facebook_changePSM.png' |
253 | Binary files Facebook/Resources/Facebook_changePSM.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_changePSM.png 2009-02-09 20:53:00 +0000 differ |
254 | === added file 'Facebook/Resources/Facebook_compose_mail.png' |
255 | Binary files Facebook/Resources/Facebook_compose_mail.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_compose_mail.png 2009-02-09 20:53:00 +0000 differ |
256 | === added file 'Facebook/Resources/Facebook_events.png' |
257 | Binary files Facebook/Resources/Facebook_events.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_events.png 2009-02-09 20:53:00 +0000 differ |
258 | === added file 'Facebook/Resources/Facebook_friend_request.png' |
259 | Binary files Facebook/Resources/Facebook_friend_request.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_friend_request.png 2009-02-09 20:53:00 +0000 differ |
260 | === added file 'Facebook/Resources/Facebook_home.png' |
261 | Binary files Facebook/Resources/Facebook_home.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_home.png 2009-02-09 20:53:00 +0000 differ |
262 | === added file 'Facebook/Resources/Facebook_mail-inbox.png' |
263 | Binary files Facebook/Resources/Facebook_mail-inbox.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_mail-inbox.png 2009-02-09 20:53:00 +0000 differ |
264 | === added file 'Facebook/Resources/Facebook_mail.png' |
265 | Binary files Facebook/Resources/Facebook_mail.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_mail.png 2009-02-09 20:53:00 +0000 differ |
266 | === added file 'Facebook/Resources/Facebook_mail2.png' |
267 | Binary files Facebook/Resources/Facebook_mail2.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_mail2.png 2009-02-09 20:53:00 +0000 differ |
268 | === added file 'Facebook/Resources/Facebook_notifications.png' |
269 | Binary files Facebook/Resources/Facebook_notifications.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_notifications.png 2009-02-09 20:53:00 +0000 differ |
270 | === added file 'Facebook/Resources/Facebook_pages.png' |
271 | Binary files Facebook/Resources/Facebook_pages.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_pages.png 2009-02-09 20:53:00 +0000 differ |
272 | === added file 'Facebook/Resources/Facebook_poke.png' |
273 | Binary files Facebook/Resources/Facebook_poke.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_poke.png 2009-02-09 20:53:00 +0000 differ |
274 | === added file 'Facebook/Resources/Facebook_profile.png' |
275 | Binary files Facebook/Resources/Facebook_profile.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_profile.png 2009-02-09 20:53:00 +0000 differ |
276 | === added file 'Facebook/Resources/Facebook_user.png' |
277 | Binary files Facebook/Resources/Facebook_user.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_user.png 2009-02-09 20:53:00 +0000 differ |
278 | === added file 'Facebook/Resources/Facebook_video.png' |
279 | Binary files Facebook/Resources/Facebook_video.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_video.png 2009-02-09 20:53:00 +0000 differ |
280 | === added file 'Facebook/Resources/Facebook_wall.png' |
281 | Binary files Facebook/Resources/Facebook_wall.png 1970-01-01 00:00:00 +0000 and Facebook/Resources/Facebook_wall.png 2009-02-05 23:45:40 +0000 differ |
282 | === added directory 'Facebook/src' |
283 | === added file 'Facebook/src/Facebook.cs' |
284 | --- Facebook/src/Facebook.cs 1970-01-01 00:00:00 +0000 |
285 | +++ Facebook/src/Facebook.cs 2009-03-04 23:34:47 +0000 |
286 | @@ -0,0 +1,386 @@ |
287 | +/* Facebook.cs |
288 | + * |
289 | + * GNOME Do is the legal property of its developers. Please refer to the |
290 | + * COPYRIGHT file distributed with this |
291 | + * source distribution. |
292 | + * |
293 | + * This program is free software: you can redistribute it and/or modify |
294 | + * it under the terms of the GNU General Public License as published by |
295 | + * the Free Software Foundation, either version 3 of the License, or |
296 | + * (at your option) any later version. |
297 | + * |
298 | + * This program is distributed in the hope that it will be useful, |
299 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
300 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
301 | + * GNU General Public License for more details. |
302 | + * |
303 | + * You should have received a copy of the GNU General Public License |
304 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
305 | + */ |
306 | + |
307 | +using System; |
308 | +using System.Collections.Generic; |
309 | +using Do.Universe; |
310 | +using System.Threading; |
311 | +using Do.Platform; |
312 | +using Mono.Unix; |
313 | +using GoogleCode.FacebookCSharp; |
314 | + |
315 | +namespace Facebook |
316 | +{ |
317 | + public class Facebook |
318 | + { |
319 | + |
320 | + static readonly string ConnectionErrorMessage = Catalog.GetString ("An error occurred connecting to Facebook, " |
321 | + + "are your credentials valid?"); |
322 | + |
323 | + static readonly string MissingCredentialsMessage = Catalog.GetString ("Missing login credentials. Please set " |
324 | + + "login information in Facebook plugin configuration."); |
325 | + |
326 | + private static List<Item> friends; |
327 | + private static List<Item> pages; |
328 | + private static List<Item> inboxMessages; |
329 | + private static List<Item> wallPosts; |
330 | + |
331 | + private static WallPost[] wallArray; |
332 | + private static InboxMessage[] inboxArray; |
333 | + private static Thread notificationThread; |
334 | + private static Notifications notifications; |
335 | + |
336 | + private static string username; |
337 | + private static string password; |
338 | + private static string statusText; |
339 | + |
340 | + private static GoogleCode.FacebookCSharp.Facebook facebook; |
341 | + private static OwnerInformation user; |
342 | + |
343 | + private static int contactsUpdate; |
344 | + |
345 | + public static GoogleCode.FacebookCSharp.Facebook FacebookObject{ |
346 | + get{return facebook;} |
347 | + } |
348 | + |
349 | + public static List<Item> Inbox{ |
350 | + get{return Facebook.inboxMessages;} |
351 | + } |
352 | + |
353 | + public static OwnerInformation User{ |
354 | + get{return Facebook.user;} |
355 | + } |
356 | + |
357 | + public static List<Item> Pages{ |
358 | + get{return Facebook.pages;} |
359 | + } |
360 | + |
361 | + public static List<Item> Wall{ |
362 | + get{return Facebook.wallPosts;} |
363 | + } |
364 | + |
365 | + public static List<Item> Friends{ |
366 | + get{return Facebook.friends;} |
367 | + } |
368 | + |
369 | + public static FacebookPreferences Preferences { get; private set; } |
370 | + |
371 | + static Facebook() |
372 | + { |
373 | + Facebook.notifications = new Notifications(); |
374 | + Facebook.friends = new List<Item>(); |
375 | + Facebook.inboxMessages = new List<Item>(); |
376 | + Facebook.pages = new List<Item>(); |
377 | + Facebook.wallPosts = new List<Item>(); |
378 | + Preferences = new FacebookPreferences (); |
379 | + contactsUpdate = 0; |
380 | + username = Preferences.Username; |
381 | + password = Preferences.Password; |
382 | + statusText = ""; |
383 | + Facebook.facebook = new GoogleCode.FacebookCSharp.Facebook(); |
384 | + facebook.AutoFetchPictures=false; |
385 | + facebook.AutoFetchProfiles= false; |
386 | + facebook.GotChatMessage += new EventHandler<ChatMessageEventArgs>(Facebook.OnGotChatMessage); |
387 | + facebook.OwnerUpdated += new EventHandler<OwnerEventArgs>(Facebook.OnOwnerUpdated); |
388 | + facebook.FriendUpdated+= new EventHandler<FriendUpdatedEventArgs>(Facebook.OnFriendUpdated); |
389 | + facebook.ExceptionOccured += new EventHandler<ExceptionEventArgs>(Facebook.OnException); |
390 | + Thread thread = new Thread ((ThreadStart) (new FacebookConnectionThread(username, password).Connect)); |
391 | + thread.IsBackground = true; |
392 | + thread.Start (); |
393 | + } |
394 | + |
395 | + public static void updateContacts() |
396 | + { |
397 | + if(Facebook.facebook == null) |
398 | + return; |
399 | + contactsUpdate++; |
400 | + if(!(Facebook.facebook.ConnectedToAPI || Facebook.facebook.ConnectedToWebsite)){ |
401 | + Log<Facebook>.Debug("Not connected to facebook network yet"); |
402 | + if(contactsUpdate > 3) |
403 | + { |
404 | + Thread thread = new Thread ((ThreadStart) (new FacebookConnectionThread(username, password).Connect)); |
405 | + thread.IsBackground = true; |
406 | + thread.Start (); |
407 | + } |
408 | + return; |
409 | + } |
410 | + Log<Facebook>.Debug("Update contacts tries = {0} - friends.Count : {1}", contactsUpdate, Facebook.friends.Count); |
411 | + if (Facebook.friends.Count == 0 || contactsUpdate%10 == 0){ |
412 | + Facebook.friends.Clear(); |
413 | + foreach (FriendInformation friend in facebook.Friends) |
414 | + { |
415 | + Facebook.friends.Add(new FacebookContactItem(friend.UserID, friend.Name, friend.StatusText, user.UserID)); |
416 | + } |
417 | + } |
418 | + } |
419 | + |
420 | + public static void updatePages() |
421 | + { |
422 | + if(Facebook.facebook == null) |
423 | + return; |
424 | + if(!(Facebook.facebook.ConnectedToAPI || Facebook.facebook.ConnectedToWebsite)){ |
425 | + Log<Facebook>.Debug("Not connected to facebook network yet"); |
426 | + return; |
427 | + } |
428 | + if(Facebook.Pages.Count != 0) |
429 | + return; |
430 | + //only when connected init the pages |
431 | + Facebook.Pages.Add(new FacebookPageItem("videos")); |
432 | + Facebook.Pages.Add(new FacebookPageItem("photo albums")); |
433 | + Facebook.Pages.Add(new FacebookPageItem("boxes")); |
434 | + Facebook.Pages.Add(new FacebookPageItem("home")); |
435 | + Facebook.Pages.Add(new FacebookPageItem("profile")); |
436 | + Facebook.Pages.Add(new FacebookPageItem("bumper stickers")); |
437 | + Facebook.Pages.Add(new FacebookPageItem("friend requests")); |
438 | + Facebook.Pages.Add(new FacebookPageItem("event requests")); |
439 | + Facebook.Pages.Add(new FacebookPageItem("inbox")); |
440 | + Facebook.Pages.Add(new FacebookPageItem("notifications")); |
441 | + Facebook.Pages.Add(new FacebookPageItem("photo news")); |
442 | + Facebook.Pages.Add(new FacebookPageItem("wall")); |
443 | + } |
444 | + |
445 | + public static void WriteOnWall(long id, string msg) |
446 | + { |
447 | + Facebook.facebook.WriteOnWall(id, msg); |
448 | + } |
449 | + |
450 | + public static void ChangePSM(string msg) |
451 | + { |
452 | + Facebook.facebook.SetStatusText(msg); |
453 | + } |
454 | + |
455 | + public static void sendMail(long id, string subject, string msg) |
456 | + { |
457 | + Facebook.facebook.SendInboxMessage(id, subject, msg); |
458 | + } |
459 | + |
460 | + public static void ReplyMailThread(long id, string msg){ |
461 | + facebook.SendInboxReply(id, msg); |
462 | + } |
463 | + |
464 | + public static bool TryConnect (string username, string password) |
465 | + { |
466 | + try |
467 | + { |
468 | + GoogleCode.FacebookCSharp.Facebook fb = new GoogleCode.FacebookCSharp.Facebook(); |
469 | + fb.Login(username, password); |
470 | + fb.Logout(); |
471 | + } |
472 | + catch (Exception e) |
473 | + { |
474 | + Log<Facebook>.Error (ConnectionErrorMessage); |
475 | + return false; |
476 | + } |
477 | + Thread thread = new Thread ((ThreadStart) (new FacebookConnectionThread(username, password).Connect)); |
478 | + thread.IsBackground = true; |
479 | + thread.Start (); |
480 | + return true; |
481 | + } |
482 | + |
483 | + public static void Connect (string username, string password) |
484 | + { |
485 | + lock(facebook) |
486 | + { |
487 | + if((Facebook.facebook.ConnectedToAPI || Facebook.facebook.ConnectedToWebsite)) |
488 | + return; |
489 | + |
490 | + Log<Facebook>.Debug("Connecting to facebook network..."); |
491 | + if (string.IsNullOrEmpty (username) || string.IsNullOrEmpty (password)) { |
492 | + Log<Facebook>.Error (MissingCredentialsMessage); |
493 | + return; |
494 | + } |
495 | + try |
496 | + { |
497 | + Facebook.user = Facebook.facebook.Login(username, password); |
498 | + Log<Facebook>.Debug("Connected"); |
499 | + Facebook.notifications.Notify(new LoginNotification(user.Name)); |
500 | + Facebook.notificationThread = new Thread(NotificationsThread); |
501 | + Facebook.notificationThread.IsBackground = true; |
502 | + Facebook.notificationThread.Start(); |
503 | + } |
504 | + catch (Exception e) |
505 | + { |
506 | + Log<Facebook>.Error (ConnectionErrorMessage); |
507 | + } |
508 | + } |
509 | + } |
510 | + |
511 | + static void OnException(object sender, ExceptionEventArgs e) |
512 | + { |
513 | + if(e.Exception is FormatException){ |
514 | + Log<Facebook>.Debug("Got a format exception while getting either wall or inbox"); |
515 | + }else{ |
516 | + Log<Facebook>.Debug("Facebook object internal exception"); |
517 | + } |
518 | + } |
519 | + |
520 | + static void OnGotChatMessage(object sender, ChatMessageEventArgs e) |
521 | + { |
522 | + Facebook.notifications.Notify(new ChatMessageNotification(e.Friend.Name, e.Text)); |
523 | + } |
524 | + |
525 | + static void OnOwnerUpdated(object sender, OwnerEventArgs e) |
526 | + { |
527 | + try{ |
528 | + Log<Facebook>.Debug("Got an Owner update!"); |
529 | + if(e.FieldUpdated(UserField.Poked)) |
530 | + notifications.Notify(new PokeNotification()); |
531 | + if(e.FieldUpdated(UserField.StatusText)){ |
532 | + Log<Facebook>.Debug("got an status update.."); |
533 | + if(e.Owner.StatusText != null && !(user.StatusText.Equals(e.Owner.StatusText))){ |
534 | + Log<Facebook>.Debug("New status text: "+e.Owner.StatusText); |
535 | + if(e.Owner.StatusText == "" || e.Owner.StatusText.Length == 0) |
536 | + return; |
537 | + notifications.Notify(new StatusChangedNotification(e.Owner.Name, e.Owner.StatusText)); |
538 | + } |
539 | + } |
540 | + }catch(Exception ex){ |
541 | + Log<Facebook>.Error("Exception ocurred on Owner event"); |
542 | + } |
543 | + } |
544 | + |
545 | + static void OnFriendUpdated(object sender, FriendUpdatedEventArgs e) |
546 | + { |
547 | + |
548 | + if(e.FieldUpdated(UserField.StatusText)){ |
549 | + Log<Facebook>.Debug("A friend changed his status!"); |
550 | + notifications.Notify(new StatusChangedNotification(e.Friend.Name, e.Friend.StatusText)); |
551 | + } |
552 | + } |
553 | + |
554 | + //Thread that checks for new walls and inbox messages |
555 | + private static void NotificationsThread() |
556 | + { |
557 | + try |
558 | + { |
559 | + if(!(Facebook.facebook.ConnectedToAPI || Facebook.facebook.ConnectedToWebsite)) |
560 | + Log<Facebook>.Debug("Not connected to facebook network yet"); |
561 | + Log<Facebook>.Debug("Started notifications Thread"); |
562 | + Facebook.wallArray = facebook.GetWall(user.UserID); |
563 | + foreach (WallPost wall in Facebook.wallArray) |
564 | + Facebook.wallPosts.Add(new FacebookWallPostItem(wall.Sender, wall.Contents)); |
565 | + Facebook.inboxArray = facebook.GetInbox(); |
566 | + foreach (InboxMessage msg in Facebook.inboxArray) |
567 | + Facebook.inboxMessages.Add(new FacebookInboxMessageItem(msg.SenderID, msg.SenderName, msg.Subject, msg.Body)); |
568 | + } |
569 | + catch(Exception e) |
570 | + { |
571 | + Log<Facebook>.Error("Exception while trying to fetch inbox or wall"); |
572 | + } |
573 | + |
574 | + while(true) |
575 | + { |
576 | + try |
577 | + { |
578 | + if(!(Facebook.facebook.ConnectedToAPI || Facebook.facebook.ConnectedToWebsite)) |
579 | + Log<Facebook>.Debug("Not connected to facebook network yet"); |
580 | + if(wallArray == null) |
581 | + { |
582 | + Facebook.wallArray = facebook.GetWall(user.UserID); |
583 | + foreach (WallPost wall in Facebook.wallArray) |
584 | + Facebook.wallPosts.Add(new FacebookWallPostItem(wall.Sender, wall.Contents)); |
585 | + } |
586 | + if(inboxArray == null) |
587 | + { |
588 | + Facebook.inboxArray = facebook.GetInbox(); |
589 | + foreach (InboxMessage msg in Facebook.inboxArray) |
590 | + Facebook.inboxMessages.Add(new FacebookInboxMessageItem(msg.SenderID, msg.SenderName, msg.Subject, msg.Body)); |
591 | + } |
592 | + |
593 | + Log<Facebook>.Debug("NotificationsThread -> updating..."); |
594 | + |
595 | + //Check for new walls |
596 | + WallPost[] newWalls = null; |
597 | + try{ |
598 | + newWalls = facebook.GetWall(user.UserID); |
599 | + }catch{ |
600 | + Log<Facebook>.Debug("Got a format exception while getting wall"); |
601 | + Thread.Sleep(30000); |
602 | + continue; |
603 | + } |
604 | + WallPost latestWall = null; |
605 | + try{ |
606 | + latestWall = newWalls[0]; |
607 | + } |
608 | + catch(Exception e){ |
609 | + Thread.Sleep(30000); |
610 | + continue; |
611 | + } |
612 | + |
613 | + if(! (Facebook.wallArray[0].Contents.Equals(latestWall.Contents) && Facebook.wallArray[0].Sender.Name.Equals(latestWall.Sender.Name)) ) |
614 | + { |
615 | + Facebook.wallArray = newWalls; |
616 | + wallPosts.Add(new FacebookWallPostItem(latestWall.Sender, latestWall.Contents)); |
617 | + if(!(Facebook.wallArray[1].Contents.Equals(latestWall.Contents))) |
618 | + Facebook.notifications.Notify(new WallNotification(latestWall.Sender.Name, latestWall.Contents)); |
619 | + } |
620 | + |
621 | + //Inbox messages |
622 | + InboxMessage[] newMessages = null; |
623 | + try{ |
624 | + newMessages = facebook.GetInbox(); |
625 | + }catch{ |
626 | + Log<Facebook>.Debug("Got a format exception while getting inbox"); |
627 | + Thread.Sleep(30000); |
628 | + continue; |
629 | + } |
630 | + InboxMessage latestMessage = null; |
631 | + try{ |
632 | + latestMessage = newMessages[0]; |
633 | + } |
634 | + catch(Exception e){ |
635 | + Thread.Sleep(30000); |
636 | + continue; |
637 | + } |
638 | + |
639 | + if(! (Facebook.inboxArray[0].Body.Equals(latestMessage.Body) && Facebook.inboxArray[0].SenderName.Equals(latestMessage.SenderName)) ) |
640 | + { |
641 | + Facebook.inboxArray = newMessages; |
642 | + Facebook.inboxMessages.Add(new FacebookInboxMessageItem(latestMessage.SenderID, latestMessage.SenderName, latestMessage.Subject, latestMessage.Body)); |
643 | + if(!(Facebook.wallArray[1].Contents.Equals(latestWall.Contents))) |
644 | + Facebook.notifications.Notify(new NewInboxNotification(latestMessage.SenderName, latestMessage.Subject, latestMessage.Body)); |
645 | + } |
646 | + Log<Facebook>.Debug("NotificationsThread -> sleeping..."); |
647 | + //Will refresh in 35 seconds |
648 | + Thread.Sleep(35000); |
649 | + }catch (Exception e) { |
650 | + Log<Facebook>.Error("Exception while fetching inbox or wall"); |
651 | + Thread.Sleep(30000); |
652 | + } |
653 | + } |
654 | + } |
655 | + |
656 | + } |
657 | + |
658 | + class FacebookConnectionThread |
659 | + { |
660 | + string username; |
661 | + string password; |
662 | + |
663 | + public FacebookConnectionThread(string username, string password){ |
664 | + this.username = username; |
665 | + this.password = password; |
666 | + } |
667 | + |
668 | + public void Connect(){ |
669 | + Facebook.Connect(this.username, this.password); |
670 | + } |
671 | + } |
672 | +} |
673 | |
674 | === added file 'Facebook/src/FacebookChangePSMAction.cs' |
675 | --- Facebook/src/FacebookChangePSMAction.cs 1970-01-01 00:00:00 +0000 |
676 | +++ Facebook/src/FacebookChangePSMAction.cs 2009-02-12 18:06:50 +0000 |
677 | @@ -0,0 +1,88 @@ |
678 | +/* FacebookChangePSMAction.cs |
679 | + * |
680 | + * GNOME Do is the legal property of its developers. Please refer to the |
681 | + * COPYRIGHT file distributed with this |
682 | + * source distribution. |
683 | + * |
684 | + * This program is free software: you can redistribute it and/or modify |
685 | + * it under the terms of the GNU General Public License as published by |
686 | + * the Free Software Foundation, either version 3 of the License, or |
687 | + * (at your option) any later version. |
688 | + * |
689 | + * This program is distributed in the hope that it will be useful, |
690 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
691 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
692 | + * GNU General Public License for more details. |
693 | + * |
694 | + * You should have received a copy of the GNU General Public License |
695 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
696 | + */ |
697 | + |
698 | +using System; |
699 | +using Do.Universe; |
700 | +using System.Threading; |
701 | +using System.Linq; |
702 | +using System.Collections.Generic; |
703 | +using Do.Platform; |
704 | + |
705 | +namespace Facebook |
706 | +{ |
707 | + |
708 | + |
709 | + public class FacebookChangePSMAction : Act |
710 | + { |
711 | + |
712 | + public FacebookChangePSMAction() |
713 | + { |
714 | + } |
715 | + |
716 | + public override string Name |
717 | + { |
718 | + get { return "Change facebook personal message."; } |
719 | + } |
720 | + |
721 | + public override string Description |
722 | + { |
723 | + get { return "Change your facebook personal message."; } |
724 | + } |
725 | + |
726 | + public override string Icon {get { return "Facebook_changePSM.png@" + GetType ().Assembly.FullName; } } |
727 | + |
728 | + public override IEnumerable<Type> SupportedItemTypes |
729 | + { |
730 | + get { yield return typeof (ITextItem); } |
731 | + } |
732 | + |
733 | + public override bool SupportsItem (Item item) |
734 | + { |
735 | + return (item is ITextItem); |
736 | + } |
737 | + |
738 | + |
739 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
740 | + { |
741 | + Thread thread = new Thread ((ThreadStart) (new ChangePSMThread((items.First () as ITextItem).Text)).ChangePSM); |
742 | + thread.IsBackground = true; |
743 | + thread.Start (); |
744 | + yield break; |
745 | + } |
746 | + } |
747 | + |
748 | + class ChangePSMThread |
749 | + { |
750 | + string msg; |
751 | + |
752 | + public ChangePSMThread(string msg) |
753 | + { |
754 | + this.msg = msg; |
755 | + } |
756 | + |
757 | + public void ChangePSM(){ |
758 | + if(!(Facebook.FacebookObject.ConnectedToAPI || Facebook.FacebookObject.ConnectedToWebsite)){ |
759 | + Log<FacebookChangePSMAction>.Debug("Not connected to facebook network yet"); |
760 | + return; |
761 | + } |
762 | + Facebook.ChangePSM(this.msg); |
763 | + } |
764 | + } |
765 | +} |
766 | |
767 | === added file 'Facebook/src/FacebookConfig.cs' |
768 | --- Facebook/src/FacebookConfig.cs 1970-01-01 00:00:00 +0000 |
769 | +++ Facebook/src/FacebookConfig.cs 2009-02-09 20:53:00 +0000 |
770 | @@ -0,0 +1,53 @@ |
771 | +/* FacebookConfig.cs |
772 | + * |
773 | + * GNOME Do is the legal property of its developers. Please refer to the |
774 | + * COPYRIGHT file distributed with this |
775 | + * source distribution. |
776 | + * |
777 | + * This program is free software: you can redistribute it and/or modify |
778 | + * it under the terms of the GNU General Public License as published by |
779 | + * the Free Software Foundation, either version 3 of the License, or |
780 | + * (at your option) any later version. |
781 | + * |
782 | + * This program is distributed in the hope that it will be useful, |
783 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
784 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
785 | + * GNU General Public License for more details. |
786 | + * |
787 | + * You should have received a copy of the GNU General Public License |
788 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
789 | + */ |
790 | + |
791 | +using System; |
792 | +using Gtk; |
793 | +using Do.Platform; |
794 | +using Do.Platform.Linux; |
795 | + |
796 | +namespace Facebook |
797 | +{ |
798 | + |
799 | + public class FacebookConfig : AbstractLoginWidget |
800 | + { |
801 | + const string Uri = "http://www.facebook.com"; |
802 | + |
803 | + public FacebookConfig() : base ("Facebook", Uri) |
804 | + { |
805 | + Username = Facebook.Preferences.Username; |
806 | + Password = Facebook.Preferences.Password; |
807 | + } |
808 | + |
809 | + |
810 | + protected override void SaveAccountData(string username, string password) |
811 | + { |
812 | + Facebook.Preferences.Username = username; |
813 | + Facebook.Preferences.Password = password; |
814 | + } |
815 | + |
816 | + protected override bool Validate (string username, string password) |
817 | + { |
818 | + if (username.Length > 0 && password.Length > 0) |
819 | + return Facebook.TryConnect (username, password); |
820 | + return false; |
821 | + } |
822 | + } |
823 | +} |
824 | |
825 | === added file 'Facebook/src/FacebookContactItem.cs' |
826 | --- Facebook/src/FacebookContactItem.cs 1970-01-01 00:00:00 +0000 |
827 | +++ Facebook/src/FacebookContactItem.cs 2009-02-11 21:48:29 +0000 |
828 | @@ -0,0 +1,104 @@ |
829 | +/* FacebookContactItem.cs |
830 | + * |
831 | + * GNOME Do is the legal property of its developers. Please refer to the |
832 | + * COPYRIGHT file distributed with this |
833 | + * source distribution. |
834 | + * |
835 | + * This program is free software: you can redistribute it and/or modify |
836 | + * it under the terms of the GNU General Public License as published by |
837 | + * the Free Software Foundation, either version 3 of the License, or |
838 | + * (at your option) any later version. |
839 | + * |
840 | + * This program is distributed in the hope that it will be useful, |
841 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
842 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
843 | + * GNU General Public License for more details. |
844 | + * |
845 | + * You should have received a copy of the GNU General Public License |
846 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
847 | + */ |
848 | + |
849 | +using System; |
850 | +using Do.Universe; |
851 | +using Do.Platform; |
852 | + |
853 | +namespace Facebook |
854 | +{ |
855 | + public class FacebookContactItem : Item, IUrlItem |
856 | + { |
857 | + |
858 | + protected string name; |
859 | + protected string url; |
860 | + protected string description; |
861 | + protected long id; |
862 | + protected long ownerId; |
863 | + |
864 | + public FacebookContactItem(long id, long ownerId){ |
865 | + this.id = id; |
866 | + this.ownerId = ownerId; |
867 | + } |
868 | + |
869 | + public FacebookContactItem(long id, string name, string description, long ownerId) |
870 | + { |
871 | + this.id = id; |
872 | + this.name= name; |
873 | + this.url = "http://www.facebook.com/home.php?#/profile.php?id="+id+"&ref=ts"; |
874 | + this.description = description; |
875 | + this.ownerId = ownerId; |
876 | + } |
877 | + |
878 | + public override string Name |
879 | + { |
880 | + get { return name; } |
881 | + } |
882 | + |
883 | + public long Id |
884 | + { |
885 | + get { return id; } |
886 | + } |
887 | + |
888 | + public long OwnerId |
889 | + { |
890 | + get { return this.ownerId; } |
891 | + } |
892 | + |
893 | + public override string Description |
894 | + { |
895 | + get { return description; } |
896 | + } |
897 | + |
898 | + public override string Icon |
899 | + { |
900 | + get { return "Facebook_user.png@" + GetType ().Assembly.FullName; } |
901 | + } |
902 | + |
903 | + public string Url |
904 | + { |
905 | + get { return url; } |
906 | + } |
907 | + |
908 | + public void OpenAlbums(){ |
909 | + Services.Environment.OpenUrl(this.url+"&v=photos&viewas="+this.ownerId); |
910 | + } |
911 | + |
912 | + public void Poke(){ |
913 | + Facebook.FacebookObject.Poke(this.id); |
914 | + } |
915 | + |
916 | + public void OpenBoxes(){ |
917 | + Services.Environment.OpenUrl(this.url+"&v=box_3&viewas="+this.ownerId); |
918 | + } |
919 | + |
920 | + public void OpenVideos(){ |
921 | + Services.Environment.OpenUrl("http://www.facebook.com/video/?of="+this.id); |
922 | + } |
923 | + |
924 | + public void OpenFriendsInCommon(){ |
925 | + Services.Environment.OpenUrl("http://www.facebook.com/friends/?mutual&id="+this.id); |
926 | + } |
927 | + |
928 | + public void WallToWall(){ |
929 | + Services.Environment.OpenUrl("http://www.new.facebook.com/wall.php?id="+ this.id +"&banter_id="+this.ownerId); |
930 | + } |
931 | + } |
932 | +} |
933 | |
934 | === added file 'Facebook/src/FacebookContactItemSource.cs' |
935 | --- Facebook/src/FacebookContactItemSource.cs 1970-01-01 00:00:00 +0000 |
936 | +++ Facebook/src/FacebookContactItemSource.cs 2009-02-11 21:48:29 +0000 |
937 | @@ -0,0 +1,60 @@ |
938 | +/* FacebookContactItemSource.cs |
939 | + * |
940 | + * GNOME Do is the legal property of its developers. Please refer to the |
941 | + * COPYRIGHT file distributed with this |
942 | + * source distribution. |
943 | + * |
944 | + * This program is free software: you can redistribute it and/or modify |
945 | + * it under the terms of the GNU General Public License as published by |
946 | + * the Free Software Foundation, either version 3 of the License, or |
947 | + * (at your option) any later version. |
948 | + * |
949 | + * This program is distributed in the hope that it will be useful, |
950 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
951 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
952 | + * GNU General Public License for more details. |
953 | + * |
954 | + * You should have received a copy of the GNU General Public License |
955 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
956 | + */ |
957 | + |
958 | +using System; |
959 | +using System.Collections.Generic; |
960 | +using Mono.Unix; |
961 | +using Gtk; |
962 | +using Do.Universe; |
963 | +using Do.Platform.Linux; |
964 | + |
965 | +namespace Facebook |
966 | +{ |
967 | + public class FacebookContactItemSource : ItemSource, IConfigurable |
968 | + { |
969 | + public FacebookContactItemSource() |
970 | + { |
971 | + } |
972 | + |
973 | + public override IEnumerable<Type> SupportedItemTypes |
974 | + { |
975 | + get {yield return typeof (FacebookContactItem);} |
976 | + } |
977 | + |
978 | + public override string Name { get { return "Facebook Friends"; } } |
979 | + public override string Description { get { return "Your Facebook Friends"; } } |
980 | + public override string Icon {get { return "Facebook.png@" + GetType ().Assembly.FullName; } } |
981 | + |
982 | + public override IEnumerable<Do.Universe.Item> Items |
983 | + { |
984 | + get { return Facebook.Friends; } |
985 | + } |
986 | + |
987 | + public override void UpdateItems () |
988 | + { |
989 | + Facebook.updateContacts(); |
990 | + } |
991 | + |
992 | + public Gtk.Bin GetConfiguration () |
993 | + { |
994 | + return new FacebookConfig (); |
995 | + } |
996 | + } |
997 | +} |
998 | |
999 | === added file 'Facebook/src/FacebookInboxMessageItem.cs' |
1000 | --- Facebook/src/FacebookInboxMessageItem.cs 1970-01-01 00:00:00 +0000 |
1001 | +++ Facebook/src/FacebookInboxMessageItem.cs 2009-02-11 21:48:29 +0000 |
1002 | @@ -0,0 +1,85 @@ |
1003 | +/* FacebookInboxMessageItem.cs |
1004 | + * |
1005 | + * GNOME Do is the legal property of its developers. Please refer to the |
1006 | + * COPYRIGHT file distributed with this |
1007 | + * source distribution. |
1008 | + * |
1009 | + * This program is free software: you can redistribute it and/or modify |
1010 | + * it under the terms of the GNU General Public License as published by |
1011 | + * the Free Software Foundation, either version 3 of the License, or |
1012 | + * (at your option) any later version. |
1013 | + * |
1014 | + * This program is distributed in the hope that it will be useful, |
1015 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1016 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1017 | + * GNU General Public License for more details. |
1018 | + * |
1019 | + * You should have received a copy of the GNU General Public License |
1020 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1021 | + */ |
1022 | + |
1023 | +using System; |
1024 | +using Do.Universe; |
1025 | +using Do.Platform; |
1026 | + |
1027 | +namespace Facebook |
1028 | +{ |
1029 | + |
1030 | + |
1031 | + public class FacebookInboxMessageItem : Item, IUrlItem |
1032 | + { |
1033 | + protected string subject; |
1034 | + protected string description; |
1035 | + protected string senderName; |
1036 | + protected long id; |
1037 | + protected string body; |
1038 | + |
1039 | + public FacebookInboxMessageItem(long id, string senderName, string subject, string body) |
1040 | + { |
1041 | + this.id = id; |
1042 | + this.body = body; |
1043 | + this.senderName = senderName; |
1044 | + if(body.Length > 125) |
1045 | + this.description = body.Substring(0,125)+"..."; |
1046 | + else |
1047 | + this.description = this.body; |
1048 | + this.subject = subject; |
1049 | + } |
1050 | + |
1051 | + public string Subject |
1052 | + { |
1053 | + get { return this.subject; } |
1054 | + } |
1055 | + |
1056 | + public string Body |
1057 | + { |
1058 | + get { return this.body; } |
1059 | + } |
1060 | + |
1061 | + public long ThreadID |
1062 | + { |
1063 | + get { return this.id; } |
1064 | + } |
1065 | + |
1066 | + public override string Name |
1067 | + { |
1068 | + get { return "From: "+ this.senderName +" Subject: "+this.subject; } |
1069 | + } |
1070 | + |
1071 | + public override string Description |
1072 | + { |
1073 | + get |
1074 | + { return this.description; } |
1075 | + } |
1076 | + |
1077 | + public override string Icon |
1078 | + { |
1079 | + get { return "Facebook_mail2.png@" + GetType ().Assembly.FullName; } |
1080 | + } |
1081 | + |
1082 | + public string Url |
1083 | + { |
1084 | + get{ return "http://www.facebook.com/inbox/readmessage.php?t="+this.id+"&mbox_pos=0"; } |
1085 | + } |
1086 | + } |
1087 | +} |
1088 | |
1089 | === added file 'Facebook/src/FacebookOpenAlbumAction.cs' |
1090 | --- Facebook/src/FacebookOpenAlbumAction.cs 1970-01-01 00:00:00 +0000 |
1091 | +++ Facebook/src/FacebookOpenAlbumAction.cs 2009-02-09 20:53:00 +0000 |
1092 | @@ -0,0 +1,66 @@ |
1093 | +/* FacebookOpenAlbumAction.cs |
1094 | + * |
1095 | + * GNOME Do is the legal property of its developers. Please refer to the |
1096 | + * COPYRIGHT file distributed with this |
1097 | + * source distribution. |
1098 | + * |
1099 | + * This program is free software: you can redistribute it and/or modify |
1100 | + * it under the terms of the GNU General Public License as published by |
1101 | + * the Free Software Foundation, either version 3 of the License, or |
1102 | + * (at your option) any later version. |
1103 | + * |
1104 | + * This program is distributed in the hope that it will be useful, |
1105 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1106 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1107 | + * GNU General Public License for more details. |
1108 | + * |
1109 | + * You should have received a copy of the GNU General Public License |
1110 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1111 | + */ |
1112 | + |
1113 | +using System; |
1114 | +using Do.Universe; |
1115 | +using Do.Platform; |
1116 | +using System.Linq; |
1117 | +using System.Collections.Generic; |
1118 | + |
1119 | +namespace Facebook |
1120 | +{ |
1121 | + |
1122 | + |
1123 | + public class FacebookOpenAlbumAction : Act |
1124 | + { |
1125 | + |
1126 | + public FacebookOpenAlbumAction() |
1127 | + { |
1128 | + } |
1129 | + |
1130 | + public override string Name |
1131 | + { |
1132 | + get { return "Photo Albums"; } |
1133 | + } |
1134 | + |
1135 | + public override string Description |
1136 | + { |
1137 | + get { return "Opens your friend's photo albums"; } |
1138 | + } |
1139 | + |
1140 | + public override string Icon {get { return "Facebook_albums.png@" + GetType ().Assembly.FullName; } } |
1141 | + |
1142 | + public override IEnumerable<Type> SupportedItemTypes { |
1143 | + get {yield return typeof (FacebookContactItem);} |
1144 | + } |
1145 | + |
1146 | + public override bool SupportsItem (Item item) |
1147 | + { |
1148 | + return (item is FacebookContactItem); |
1149 | + } |
1150 | + |
1151 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
1152 | + { |
1153 | + (items.First () as FacebookContactItem).OpenAlbums(); |
1154 | + yield break; |
1155 | + } |
1156 | + |
1157 | + } |
1158 | +} |
1159 | |
1160 | === added file 'Facebook/src/FacebookOpenBoxesAction.cs' |
1161 | --- Facebook/src/FacebookOpenBoxesAction.cs 1970-01-01 00:00:00 +0000 |
1162 | +++ Facebook/src/FacebookOpenBoxesAction.cs 2009-02-09 20:53:00 +0000 |
1163 | @@ -0,0 +1,66 @@ |
1164 | +/* FacebookOpenBoxesAction.cs |
1165 | + * |
1166 | + * GNOME Do is the legal property of its developers. Please refer to the |
1167 | + * COPYRIGHT file distributed with this |
1168 | + * source distribution. |
1169 | + * |
1170 | + * This program is free software: you can redistribute it and/or modify |
1171 | + * it under the terms of the GNU General Public License as published by |
1172 | + * the Free Software Foundation, either version 3 of the License, or |
1173 | + * (at your option) any later version. |
1174 | + * |
1175 | + * This program is distributed in the hope that it will be useful, |
1176 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1177 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1178 | + * GNU General Public License for more details. |
1179 | + * |
1180 | + * You should have received a copy of the GNU General Public License |
1181 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1182 | + */ |
1183 | + |
1184 | +using System; |
1185 | +using Do.Universe; |
1186 | +using Do.Platform; |
1187 | +using System.Linq; |
1188 | +using System.Collections.Generic; |
1189 | + |
1190 | +namespace Facebook |
1191 | +{ |
1192 | + |
1193 | + |
1194 | + public class FacebookOpenBoxesAction : Act |
1195 | + { |
1196 | + |
1197 | + public FacebookOpenBoxesAction() |
1198 | + { |
1199 | + } |
1200 | + |
1201 | + public override string Name |
1202 | + { |
1203 | + get { return "Boxes"; } |
1204 | + } |
1205 | + |
1206 | + public override string Description |
1207 | + { |
1208 | + get { return "Opens your friend's boxes in facebook"; } |
1209 | + } |
1210 | + |
1211 | + public override string Icon {get { return "Facebook_boxes.png@" + GetType ().Assembly.FullName; } } |
1212 | + |
1213 | + public override IEnumerable<Type> SupportedItemTypes { |
1214 | + get {yield return typeof (FacebookContactItem);} |
1215 | + } |
1216 | + |
1217 | + public override bool SupportsItem (Item item) |
1218 | + { |
1219 | + return (item is FacebookContactItem); |
1220 | + } |
1221 | + |
1222 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
1223 | + { |
1224 | + (items.First () as FacebookContactItem).OpenBoxes(); |
1225 | + yield break; |
1226 | + } |
1227 | + |
1228 | + } |
1229 | +} |
1230 | |
1231 | === added file 'Facebook/src/FacebookOpenFriendsInCommonAction.cs' |
1232 | --- Facebook/src/FacebookOpenFriendsInCommonAction.cs 1970-01-01 00:00:00 +0000 |
1233 | +++ Facebook/src/FacebookOpenFriendsInCommonAction.cs 2009-02-09 20:53:00 +0000 |
1234 | @@ -0,0 +1,66 @@ |
1235 | +/* FacebookOpenFriendsInCommonAction.cs |
1236 | + * |
1237 | + * GNOME Do is the legal property of its developers. Please refer to the |
1238 | + * COPYRIGHT file distributed with this |
1239 | + * source distribution. |
1240 | + * |
1241 | + * This program is free software: you can redistribute it and/or modify |
1242 | + * it under the terms of the GNU General Public License as published by |
1243 | + * the Free Software Foundation, either version 3 of the License, or |
1244 | + * (at your option) any later version. |
1245 | + * |
1246 | + * This program is distributed in the hope that it will be useful, |
1247 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1248 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1249 | + * GNU General Public License for more details. |
1250 | + * |
1251 | + * You should have received a copy of the GNU General Public License |
1252 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1253 | + */ |
1254 | + |
1255 | +using System; |
1256 | +using Do.Universe; |
1257 | +using Do.Platform; |
1258 | +using System.Linq; |
1259 | +using System.Collections.Generic; |
1260 | + |
1261 | +namespace Facebook |
1262 | +{ |
1263 | + |
1264 | + |
1265 | + public class FacebookFriendsInCommonAction : Act |
1266 | + { |
1267 | + |
1268 | + public FacebookFriendsInCommonAction() |
1269 | + { |
1270 | + } |
1271 | + |
1272 | + public override string Name |
1273 | + { |
1274 | + get { return "Friends in common"; } |
1275 | + } |
1276 | + |
1277 | + public override string Description |
1278 | + { |
1279 | + get { return "Your mutual friends"; } |
1280 | + } |
1281 | + |
1282 | + public override string Icon {get { return "Facebook_user.png@" + GetType ().Assembly.FullName; } } |
1283 | + |
1284 | + public override IEnumerable<Type> SupportedItemTypes { |
1285 | + get {yield return typeof (FacebookContactItem);} |
1286 | + } |
1287 | + |
1288 | + public override bool SupportsItem (Item item) |
1289 | + { |
1290 | + return (item is FacebookContactItem); |
1291 | + } |
1292 | + |
1293 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
1294 | + { |
1295 | + (items.First () as FacebookContactItem).OpenFriendsInCommon(); |
1296 | + yield break; |
1297 | + } |
1298 | + |
1299 | + } |
1300 | +} |
1301 | |
1302 | === added file 'Facebook/src/FacebookOpenVideosAction.cs' |
1303 | --- Facebook/src/FacebookOpenVideosAction.cs 1970-01-01 00:00:00 +0000 |
1304 | +++ Facebook/src/FacebookOpenVideosAction.cs 2009-02-09 20:53:00 +0000 |
1305 | @@ -0,0 +1,66 @@ |
1306 | +/* FacebookOpenVideosAction.cs |
1307 | + * |
1308 | + * GNOME Do is the legal property of its developers. Please refer to the |
1309 | + * COPYRIGHT file distributed with this |
1310 | + * source distribution. |
1311 | + * |
1312 | + * This program is free software: you can redistribute it and/or modify |
1313 | + * it under the terms of the GNU General Public License as published by |
1314 | + * the Free Software Foundation, either version 3 of the License, or |
1315 | + * (at your option) any later version. |
1316 | + * |
1317 | + * This program is distributed in the hope that it will be useful, |
1318 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1319 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1320 | + * GNU General Public License for more details. |
1321 | + * |
1322 | + * You should have received a copy of the GNU General Public License |
1323 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1324 | + */ |
1325 | + |
1326 | +using System; |
1327 | +using Do.Universe; |
1328 | +using Do.Platform; |
1329 | +using System.Linq; |
1330 | +using System.Collections.Generic; |
1331 | + |
1332 | +namespace Facebook |
1333 | +{ |
1334 | + |
1335 | + |
1336 | + public class FacebookOpenVideosAction : Act |
1337 | + { |
1338 | + |
1339 | + public FacebookOpenVideosAction() |
1340 | + { |
1341 | + } |
1342 | + |
1343 | + public override string Name |
1344 | + { |
1345 | + get { return "Videos"; } |
1346 | + } |
1347 | + |
1348 | + public override string Description |
1349 | + { |
1350 | + get { return "Opens your friend's videos in facebook"; } |
1351 | + } |
1352 | + |
1353 | + public override string Icon {get { return "Facebook_video.png@" + GetType ().Assembly.FullName; } } |
1354 | + |
1355 | + public override IEnumerable<Type> SupportedItemTypes { |
1356 | + get {yield return typeof (FacebookContactItem);} |
1357 | + } |
1358 | + |
1359 | + public override bool SupportsItem (Item item) |
1360 | + { |
1361 | + return (item is FacebookContactItem); |
1362 | + } |
1363 | + |
1364 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
1365 | + { |
1366 | + (items.First () as FacebookContactItem).OpenVideos(); |
1367 | + yield break; |
1368 | + } |
1369 | + |
1370 | + } |
1371 | +} |
1372 | |
1373 | === added file 'Facebook/src/FacebookOpenWallToWallAction.cs' |
1374 | --- Facebook/src/FacebookOpenWallToWallAction.cs 1970-01-01 00:00:00 +0000 |
1375 | +++ Facebook/src/FacebookOpenWallToWallAction.cs 2009-02-11 21:48:29 +0000 |
1376 | @@ -0,0 +1,76 @@ |
1377 | +/* FacebookOpenWallToWallAction.cs |
1378 | + * |
1379 | + * GNOME Do is the legal property of its developers. Please refer to the |
1380 | + * COPYRIGHT file distributed with this |
1381 | + * source distribution. |
1382 | + * |
1383 | + * This program is free software: you can redistribute it and/or modify |
1384 | + * it under the terms of the GNU General Public License as published by |
1385 | + * the Free Software Foundation, either version 3 of the License, or |
1386 | + * (at your option) any later version. |
1387 | + * |
1388 | + * This program is distributed in the hope that it will be useful, |
1389 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1390 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1391 | + * GNU General Public License for more details. |
1392 | + * |
1393 | + * You should have received a copy of the GNU General Public License |
1394 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1395 | + */ |
1396 | + |
1397 | +using System; |
1398 | +using Do.Universe; |
1399 | +using Do.Platform; |
1400 | +using System.Linq; |
1401 | +using System.Collections.Generic; |
1402 | + |
1403 | +namespace Facebook |
1404 | +{ |
1405 | + |
1406 | + |
1407 | + public class FacebookOpenWallToWallAction : Act |
1408 | + { |
1409 | + |
1410 | + public FacebookOpenWallToWallAction() |
1411 | + { |
1412 | + } |
1413 | + |
1414 | + public override string Name |
1415 | + { |
1416 | + get { return "Wall To Wall"; } |
1417 | + } |
1418 | + |
1419 | + public override string Description |
1420 | + { |
1421 | + get { return "Opens wall to wall"; } |
1422 | + } |
1423 | + |
1424 | + public override string Icon {get { return "Facebook_wall.png@" + GetType ().Assembly.FullName; } } |
1425 | + |
1426 | + public override IEnumerable<Type> SupportedItemTypes { |
1427 | + get |
1428 | + { |
1429 | + yield return typeof (FacebookContactItem); |
1430 | + yield return typeof (FacebookWallPostItem); |
1431 | + } |
1432 | + } |
1433 | + |
1434 | + public override bool SupportsItem (Item item) |
1435 | + { |
1436 | + return (item is FacebookContactItem || item is FacebookWallPostItem); |
1437 | + } |
1438 | + |
1439 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
1440 | + { |
1441 | + if(items.First () is FacebookWallPostItem) |
1442 | + { |
1443 | + FacebookContactItem friend = new FacebookContactItem((items.First () as FacebookWallPostItem).SenderID, Facebook.User.UserID); |
1444 | + friend.WallToWall(); |
1445 | + yield break; |
1446 | + } |
1447 | + (items.First () as FacebookContactItem).WallToWall(); |
1448 | + yield break; |
1449 | + } |
1450 | + |
1451 | + } |
1452 | +} |
1453 | |
1454 | === added file 'Facebook/src/FacebookOutBoxMessageItem.cs' |
1455 | --- Facebook/src/FacebookOutBoxMessageItem.cs 1970-01-01 00:00:00 +0000 |
1456 | +++ Facebook/src/FacebookOutBoxMessageItem.cs 2009-02-09 20:53:00 +0000 |
1457 | @@ -0,0 +1,79 @@ |
1458 | +/* FacebookOutBoxMessageItem.cs |
1459 | + * |
1460 | + * GNOME Do is the legal property of its developers. Please refer to the |
1461 | + * COPYRIGHT file distributed with this |
1462 | + * source distribution. |
1463 | + * |
1464 | + * This program is free software: you can redistribute it and/or modify |
1465 | + * it under the terms of the GNU General Public License as published by |
1466 | + * the Free Software Foundation, either version 3 of the License, or |
1467 | + * (at your option) any later version. |
1468 | + * |
1469 | + * This program is distributed in the hope that it will be useful, |
1470 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1471 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1472 | + * GNU General Public License for more details. |
1473 | + * |
1474 | + * You should have received a copy of the GNU General Public License |
1475 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1476 | + */ |
1477 | + |
1478 | +using System; |
1479 | +using Do.Universe; |
1480 | + |
1481 | +namespace Facebook |
1482 | +{ |
1483 | + |
1484 | + |
1485 | + public class FacebookOutBoxMessageItem : Item |
1486 | + { |
1487 | + protected string subject; |
1488 | + protected string description; |
1489 | + protected FacebookContactItem contact; |
1490 | + protected string body; |
1491 | + |
1492 | + public FacebookOutBoxMessageItem(FacebookContactItem contact, string subject) |
1493 | + { |
1494 | + this.contact = contact; |
1495 | + this.description = "Message for "+contact.Name; |
1496 | + this.subject = subject; |
1497 | + } |
1498 | + |
1499 | + public string Body |
1500 | + { |
1501 | + get { return this.body; } |
1502 | + set { this.body = value; } |
1503 | + } |
1504 | + |
1505 | + public FacebookContactItem Contact |
1506 | + { |
1507 | + get { return this.contact; } |
1508 | + } |
1509 | + |
1510 | + public string Subject |
1511 | + { |
1512 | + get { return this.subject; } |
1513 | + set { this.subject = value; } |
1514 | + } |
1515 | + |
1516 | + public override string Name |
1517 | + { |
1518 | + get { return "Subject: "+this.subject; } |
1519 | + } |
1520 | + |
1521 | + public override string Description |
1522 | + { |
1523 | + get { return description; } |
1524 | + } |
1525 | + |
1526 | + public override string Icon |
1527 | + { |
1528 | + get { return "Facebook_mail.png@" + GetType ().Assembly.FullName; } |
1529 | + } |
1530 | + |
1531 | + public void send() |
1532 | + { |
1533 | + Facebook.sendMail(this.contact.Id, this.subject, this.body); |
1534 | + } |
1535 | + } |
1536 | +} |
1537 | \ No newline at end of file |
1538 | |
1539 | === added file 'Facebook/src/FacebookPageItem.cs' |
1540 | --- Facebook/src/FacebookPageItem.cs 1970-01-01 00:00:00 +0000 |
1541 | +++ Facebook/src/FacebookPageItem.cs 2009-03-04 23:34:47 +0000 |
1542 | @@ -0,0 +1,112 @@ |
1543 | +/* FacebookPageItem.cs |
1544 | + * |
1545 | + * GNOME Do is the legal property of its developers. Please refer to the |
1546 | + * COPYRIGHT file distributed with this |
1547 | + * source distribution. |
1548 | + * |
1549 | + * This program is free software: you can redistribute it and/or modify |
1550 | + * it under the terms of the GNU General Public License as published by |
1551 | + * the Free Software Foundation, either version 3 of the License, or |
1552 | + * (at your option) any later version. |
1553 | + * |
1554 | + * This program is distributed in the hope that it will be useful, |
1555 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1556 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1557 | + * GNU General Public License for more details. |
1558 | + * |
1559 | + * You should have received a copy of the GNU General Public License |
1560 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1561 | + */ |
1562 | + |
1563 | +using System; |
1564 | +using Do.Universe; |
1565 | +using System.Collections.Generic; |
1566 | +using Do.Platform; |
1567 | + |
1568 | +namespace Facebook |
1569 | +{ |
1570 | + |
1571 | + |
1572 | + public class FacebookPageItem : Item, IUrlItem |
1573 | + { |
1574 | + |
1575 | + static Dictionary<string, string> icons; |
1576 | + static Dictionary<string, string> urls; |
1577 | + |
1578 | + protected string name; |
1579 | + protected string description; |
1580 | + protected long id; |
1581 | + |
1582 | + public FacebookPageItem(string name) |
1583 | + { |
1584 | + this.name = name; |
1585 | + this.id = Facebook.User.UserID; |
1586 | + |
1587 | + if(String.Equals(name, "bumper stickers")){ |
1588 | + this.description = String.Format("Browse the latest Facebook {0}" , name); |
1589 | + }else{ |
1590 | + this.description = String.Format("Your Facebook {0}", name); |
1591 | + } |
1592 | + } |
1593 | + |
1594 | + static FacebookPageItem(){ |
1595 | + //icons |
1596 | + icons = new Dictionary<string, string>(); |
1597 | + icons.Add("videos","Facebook_video.png@"); |
1598 | + icons.Add("photo albums","Facebook_albums.png@"); |
1599 | + icons.Add("boxes","Facebook_boxes.png@"); |
1600 | + icons.Add("home","Facebook_home.png@"); |
1601 | + icons.Add("profile","Facebook_profile.png@"); |
1602 | + icons.Add("bumper stickers","Facebook_bumper.png@"); |
1603 | + icons.Add("event requests","Facebook_events.png@"); |
1604 | + icons.Add("friend requests","Facebook_friend_request.png@"); |
1605 | + icons.Add("photo news","Facebook_albums.png@"); |
1606 | + icons.Add("inbox","Facebook_mail-inbox.png@"); |
1607 | + icons.Add("notifications","Facebook_notifications.png@"); |
1608 | + icons.Add("wall","Facebook_wall.png@"); |
1609 | + |
1610 | + //urls |
1611 | + urls = new Dictionary<string, string>(); |
1612 | + urls.Add("videos","http://www.facebook.com/video/?of={0}"); |
1613 | + urls.Add("photo albums","http://www.facebook.com/profile.php?id={0}&v=photos"); |
1614 | + urls.Add("boxes", "http://www.facebook.com/profile.php?id={0}&v=box_3"); |
1615 | + urls.Add("home", "http://www.facebook.com/home.php"); |
1616 | + urls.Add("profile", "http://www.facebook.com/profile.php?id={0}&ref=profile"); |
1617 | + urls.Add("bumper stickers", "http://apps.facebook.com/bumpersticker/recently_popular_stickers/list/1"); |
1618 | + urls.Add("event requests", "http://www.facebook.com/reqs.php#event"); |
1619 | + urls.Add("friend requests", "http://www.facebook.com/reqs.php#friend"); |
1620 | + urls.Add("photo news", "http://www.facebook.com/home.php?tab=4"); |
1621 | + urls.Add("inbox", "http://www.facebook.com/inbox/?ref=mb"); |
1622 | + urls.Add("notifications","http://www.facebook.com/notifications.php"); |
1623 | + urls.Add("wall", "http://www.facebook.com/profile.php?id={0}&ref=profile"); |
1624 | + } |
1625 | + |
1626 | + public override string Name |
1627 | + { |
1628 | + get { return name; } |
1629 | + } |
1630 | + |
1631 | + public override string Description |
1632 | + { |
1633 | + get { return description; } |
1634 | + } |
1635 | + |
1636 | + public override string Icon |
1637 | + { |
1638 | + get { return FacebookPageItem.icons[this.name] + GetType ().Assembly.FullName; } |
1639 | + } |
1640 | + |
1641 | + public string Url |
1642 | + { |
1643 | + get |
1644 | + { |
1645 | + try |
1646 | + { |
1647 | + return String.Format(FacebookPageItem.urls[name],this.id); |
1648 | + }catch(Exception e){ |
1649 | + return FacebookPageItem.urls[name]; |
1650 | + } |
1651 | + } |
1652 | + } |
1653 | + } |
1654 | +} |
1655 | |
1656 | === added file 'Facebook/src/FacebookPageItemSource.cs' |
1657 | --- Facebook/src/FacebookPageItemSource.cs 1970-01-01 00:00:00 +0000 |
1658 | +++ Facebook/src/FacebookPageItemSource.cs 2009-03-04 23:34:47 +0000 |
1659 | @@ -0,0 +1,67 @@ |
1660 | +/* FacebookPageItemSource.cs |
1661 | + * |
1662 | + * GNOME Do is the legal property of its developers. Please refer to the |
1663 | + * COPYRIGHT file distributed with this |
1664 | + * source distribution. |
1665 | + * |
1666 | + * This program is free software: you can redistribute it and/or modify |
1667 | + * it under the terms of the GNU General Public License as published by |
1668 | + * the Free Software Foundation, either version 3 of the License, or |
1669 | + * (at your option) any later version. |
1670 | + * |
1671 | + * This program is distributed in the hope that it will be useful, |
1672 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1673 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1674 | + * GNU General Public License for more details. |
1675 | + * |
1676 | + * You should have received a copy of the GNU General Public License |
1677 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1678 | + */ |
1679 | + |
1680 | +using System; |
1681 | +using Do.Universe; |
1682 | +using System.Collections.Generic; |
1683 | +using Do.Platform.Linux; |
1684 | + |
1685 | +namespace Facebook |
1686 | +{ |
1687 | + public class FacebookPageItemSource : ItemSource |
1688 | + { |
1689 | + |
1690 | + public FacebookPageItemSource() |
1691 | + { |
1692 | + } |
1693 | + |
1694 | + public override IEnumerable<Type> SupportedItemTypes |
1695 | + { |
1696 | + get {yield return typeof (FacebookPageItem);} |
1697 | + } |
1698 | + |
1699 | + public override string Name { get { return "Facebook Pages"; } } |
1700 | + public override string Description { get { return "Facebook Pages"; } } |
1701 | + public override string Icon {get { return "Facebook_pages.png@" + GetType ().Assembly.FullName; } } |
1702 | + |
1703 | + public override IEnumerable<Item> ChildrenOfItem (Item item) |
1704 | + { |
1705 | + if((item as FacebookPageItem).Name.Equals("wall")){ |
1706 | + foreach (Item i in Facebook.Wall) |
1707 | + yield return i; |
1708 | + } |
1709 | + if((item as FacebookPageItem).Name.Equals("inbox")){ |
1710 | + foreach (Item i in Facebook.Inbox) |
1711 | + yield return i; |
1712 | + } |
1713 | + yield break; |
1714 | + } |
1715 | + |
1716 | + public override IEnumerable<Do.Universe.Item> Items |
1717 | + { |
1718 | + get { return Facebook.Pages; } |
1719 | + } |
1720 | + |
1721 | + public override void UpdateItems() |
1722 | + { |
1723 | + Facebook.updatePages(); |
1724 | + } |
1725 | + } |
1726 | +} |
1727 | |
1728 | === added file 'Facebook/src/FacebookPokeFriendAction.cs' |
1729 | --- Facebook/src/FacebookPokeFriendAction.cs 1970-01-01 00:00:00 +0000 |
1730 | +++ Facebook/src/FacebookPokeFriendAction.cs 2009-02-09 20:53:00 +0000 |
1731 | @@ -0,0 +1,69 @@ |
1732 | +/* FacebookPokeFriendAction.cs |
1733 | + * |
1734 | + * GNOME Do is the legal property of its developers. Please refer to the |
1735 | + * COPYRIGHT file distributed with this |
1736 | + * source distribution. |
1737 | + * |
1738 | + * This program is free software: you can redistribute it and/or modify |
1739 | + * it under the terms of the GNU General Public License as published by |
1740 | + * the Free Software Foundation, either version 3 of the License, or |
1741 | + * (at your option) any later version. |
1742 | + * |
1743 | + * This program is distributed in the hope that it will be useful, |
1744 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1745 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1746 | + * GNU General Public License for more details. |
1747 | + * |
1748 | + * You should have received a copy of the GNU General Public License |
1749 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1750 | + */ |
1751 | + |
1752 | +using System; |
1753 | +using System.Collections.Generic; |
1754 | +using System.Linq; |
1755 | +using Mono.Unix; |
1756 | +using System.Threading; |
1757 | +using Do.Universe; |
1758 | + |
1759 | +namespace Facebook |
1760 | +{ |
1761 | + |
1762 | + |
1763 | + public class FacebookPokeFriendAction : Act |
1764 | + { |
1765 | + |
1766 | + public FacebookPokeFriendAction() |
1767 | + { |
1768 | + } |
1769 | + |
1770 | + public override string Name |
1771 | + { |
1772 | + get { return "Poke"; } |
1773 | + } |
1774 | + |
1775 | + public override string Description |
1776 | + { |
1777 | + get { return "Poke a friend!."; } |
1778 | + } |
1779 | + |
1780 | + public override string Icon {get { return "Facebook_poke.png@" + GetType ().Assembly.FullName; } } |
1781 | + |
1782 | + public override IEnumerable<Type> SupportedItemTypes { |
1783 | + get {yield return typeof (FacebookContactItem);} |
1784 | + } |
1785 | + |
1786 | + public override bool SupportsItem (Item item) |
1787 | + { |
1788 | + return (item is FacebookContactItem); |
1789 | + } |
1790 | + |
1791 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
1792 | + { |
1793 | + Thread thread = new Thread ((ThreadStart) ((items.First() as FacebookContactItem).Poke)); |
1794 | + thread.IsBackground = true; |
1795 | + thread.Start (); |
1796 | + yield break; |
1797 | + } |
1798 | + |
1799 | + } |
1800 | +} |
1801 | |
1802 | === added file 'Facebook/src/FacebookPostWallAction.cs' |
1803 | --- Facebook/src/FacebookPostWallAction.cs 1970-01-01 00:00:00 +0000 |
1804 | +++ Facebook/src/FacebookPostWallAction.cs 2009-02-09 20:53:00 +0000 |
1805 | @@ -0,0 +1,93 @@ |
1806 | +/* FacebookPostWallAction.cs |
1807 | + * |
1808 | + * GNOME Do is the legal property of its developers. Please refer to the |
1809 | + * COPYRIGHT file distributed with this |
1810 | + * source distribution. |
1811 | + * |
1812 | + * This program is free software: you can redistribute it and/or modify |
1813 | + * it under the terms of the GNU General Public License as published by |
1814 | + * the Free Software Foundation, either version 3 of the License, or |
1815 | + * (at your option) any later version. |
1816 | + * |
1817 | + * This program is distributed in the hope that it will be useful, |
1818 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1819 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1820 | + * GNU General Public License for more details. |
1821 | + * |
1822 | + * You should have received a copy of the GNU General Public License |
1823 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1824 | + */ |
1825 | + |
1826 | +using System; |
1827 | +using System.Collections.Generic; |
1828 | +using System.Linq; |
1829 | +using Mono.Unix; |
1830 | +using System.Threading; |
1831 | +using Do.Universe; |
1832 | + |
1833 | +namespace Facebook |
1834 | +{ |
1835 | + public class FacebookPostWallAction : Act |
1836 | + { |
1837 | + |
1838 | + public FacebookPostWallAction() |
1839 | + { |
1840 | + } |
1841 | + |
1842 | + public override string Name |
1843 | + { |
1844 | + get { return "Post wall"; } |
1845 | + } |
1846 | + |
1847 | + public override string Description |
1848 | + { |
1849 | + get { return "Post a message on your friend's wall."; } |
1850 | + } |
1851 | + |
1852 | + public override string Icon {get { return "Facebook_wall.png@" + GetType ().Assembly.FullName; } } |
1853 | + |
1854 | + public override IEnumerable<Type> SupportedItemTypes { |
1855 | + get {yield return typeof (FacebookContactItem);} |
1856 | + } |
1857 | + |
1858 | + public override bool SupportsItem (Item item) |
1859 | + { |
1860 | + return (item is FacebookContactItem); |
1861 | + } |
1862 | + |
1863 | + public override bool ModifierItemsOptional { |
1864 | + get { return false; } |
1865 | + } |
1866 | + |
1867 | + public override IEnumerable<Type> SupportedModifierItemTypes { |
1868 | + get { yield return typeof(ITextItem); } |
1869 | + } |
1870 | + |
1871 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
1872 | + { |
1873 | + Thread thread = new Thread ((ThreadStart) (new WriteOnWallThread((items.First() as FacebookContactItem).Id, (modItems.First () as ITextItem).Text)).WriteOnWall); |
1874 | + thread.IsBackground = true; |
1875 | + thread.Start (); |
1876 | + yield break; |
1877 | + } |
1878 | + |
1879 | + } |
1880 | + |
1881 | + class WriteOnWallThread |
1882 | + { |
1883 | + long id; |
1884 | + string msg; |
1885 | + |
1886 | + public WriteOnWallThread(long id, string msg) |
1887 | + { |
1888 | + this.id = id; |
1889 | + this.msg = msg; |
1890 | + } |
1891 | + |
1892 | + public void WriteOnWall(){ |
1893 | + Facebook.WriteOnWall(this.id, this.msg); |
1894 | + } |
1895 | + } |
1896 | + |
1897 | + |
1898 | +} |
1899 | |
1900 | === added file 'Facebook/src/FacebookReplyMessageAction.cs' |
1901 | --- Facebook/src/FacebookReplyMessageAction.cs 1970-01-01 00:00:00 +0000 |
1902 | +++ Facebook/src/FacebookReplyMessageAction.cs 2009-03-04 23:34:47 +0000 |
1903 | @@ -0,0 +1,80 @@ |
1904 | +/* FacebookReplyMessageAction.cs |
1905 | + * |
1906 | + * GNOME Do is the legal property of its developers. Please refer to the |
1907 | + * COPYRIGHT file distributed with this |
1908 | + * source distribution. |
1909 | + * |
1910 | + * This program is free software: you can redistribute it and/or modify |
1911 | + * it under the terms of the GNU General Public License as published by |
1912 | + * the Free Software Foundation, either version 3 of the License, or |
1913 | + * (at your option) any later version. |
1914 | + * |
1915 | + * This program is distributed in the hope that it will be useful, |
1916 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1917 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1918 | + * GNU General Public License for more details. |
1919 | + * |
1920 | + * You should have received a copy of the GNU General Public License |
1921 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1922 | + */ |
1923 | + |
1924 | +using System; |
1925 | +using Do.Universe; |
1926 | +using Do.Platform; |
1927 | +using System.Linq; |
1928 | +using System.Collections.Generic; |
1929 | + |
1930 | +namespace Facebook |
1931 | +{ |
1932 | + |
1933 | + |
1934 | + public class FacebookReplyMessageAction : Act |
1935 | + { |
1936 | + |
1937 | + public FacebookReplyMessageAction() |
1938 | + { |
1939 | + } |
1940 | + |
1941 | + public override string Name |
1942 | + { |
1943 | + get { return "Reply message"; } |
1944 | + } |
1945 | + |
1946 | + public override string Description |
1947 | + { |
1948 | + get { return "Reply"; } |
1949 | + } |
1950 | + |
1951 | + public override string Icon {get { return "Facebook_compose_mail.png@" + GetType ().Assembly.FullName; } } |
1952 | + |
1953 | + public override IEnumerable<Type> SupportedItemTypes { |
1954 | + get |
1955 | + { |
1956 | + yield return typeof (FacebookInboxMessageItem); |
1957 | + } |
1958 | + } |
1959 | + |
1960 | + public override bool ModifierItemsOptional { |
1961 | + get { return false; } |
1962 | + } |
1963 | + |
1964 | + public override bool SupportsItem (Item item) |
1965 | + { |
1966 | + return (item is FacebookInboxMessageItem); |
1967 | + } |
1968 | + |
1969 | + public override IEnumerable<Type> SupportedModifierItemTypes { |
1970 | + get { yield return typeof(ITextItem); } |
1971 | + } |
1972 | + |
1973 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
1974 | + { |
1975 | + long id = (items.First () as FacebookInboxMessageItem).ThreadID; |
1976 | + string msg = (modItems.First() as ITextItem).Text; |
1977 | + Log<Facebook>.Debug("replying message: id="+id+"-"+ msg); |
1978 | + Facebook.ReplyMailThread(id, msg); |
1979 | + yield break; |
1980 | + } |
1981 | + |
1982 | + } |
1983 | +} |
1984 | |
1985 | === added file 'Facebook/src/FacebookReplyWallAction.cs' |
1986 | --- Facebook/src/FacebookReplyWallAction.cs 1970-01-01 00:00:00 +0000 |
1987 | +++ Facebook/src/FacebookReplyWallAction.cs 2009-02-11 21:48:29 +0000 |
1988 | @@ -0,0 +1,79 @@ |
1989 | +/* FacebookReplyWallAction.cs |
1990 | + * |
1991 | + * GNOME Do is the legal property of its developers. Please refer to the |
1992 | + * COPYRIGHT file distributed with this |
1993 | + * source distribution. |
1994 | + * |
1995 | + * This program is free software: you can redistribute it and/or modify |
1996 | + * it under the terms of the GNU General Public License as published by |
1997 | + * the Free Software Foundation, either version 3 of the License, or |
1998 | + * (at your option) any later version. |
1999 | + * |
2000 | + * This program is distributed in the hope that it will be useful, |
2001 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2002 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2003 | + * GNU General Public License for more details. |
2004 | + * |
2005 | + * You should have received a copy of the GNU General Public License |
2006 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2007 | + */ |
2008 | + |
2009 | +using System; |
2010 | +using Do.Universe; |
2011 | +using Do.Platform; |
2012 | +using System.Linq; |
2013 | +using System.Collections.Generic; |
2014 | + |
2015 | +namespace Facebook |
2016 | +{ |
2017 | + |
2018 | + |
2019 | + public class FacebookReplyWallAction : Act |
2020 | + { |
2021 | + |
2022 | + public FacebookReplyWallAction() |
2023 | + { |
2024 | + } |
2025 | + |
2026 | + public override string Name |
2027 | + { |
2028 | + get { return "Reply wall"; } |
2029 | + } |
2030 | + |
2031 | + public override string Description |
2032 | + { |
2033 | + get { return "Reply by posting a wall"; } |
2034 | + } |
2035 | + |
2036 | + public override string Icon {get { return "Facebook_wall.png@" + GetType ().Assembly.FullName; } } |
2037 | + |
2038 | + public override IEnumerable<Type> SupportedItemTypes { |
2039 | + get |
2040 | + { |
2041 | + yield return typeof (FacebookWallPostItem); |
2042 | + } |
2043 | + } |
2044 | + |
2045 | + public override bool ModifierItemsOptional { |
2046 | + get { return false; } |
2047 | + } |
2048 | + |
2049 | + public override bool SupportsItem (Item item) |
2050 | + { |
2051 | + return (item is FacebookWallPostItem); |
2052 | + } |
2053 | + |
2054 | + public override IEnumerable<Type> SupportedModifierItemTypes { |
2055 | + get { yield return typeof(ITextItem); } |
2056 | + } |
2057 | + |
2058 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
2059 | + { |
2060 | + long id = (items.First () as FacebookWallPostItem).SenderID; |
2061 | + string msg = (modItems.First() as ITextItem).Text; |
2062 | + Facebook.WriteOnWall(id, msg); |
2063 | + yield break; |
2064 | + } |
2065 | + |
2066 | + } |
2067 | +} |
2068 | |
2069 | === added file 'Facebook/src/FacebookSendMailAction.cs' |
2070 | --- Facebook/src/FacebookSendMailAction.cs 1970-01-01 00:00:00 +0000 |
2071 | +++ Facebook/src/FacebookSendMailAction.cs 2009-03-04 23:34:47 +0000 |
2072 | @@ -0,0 +1,87 @@ |
2073 | +/* FacebookSendMailAction.cs |
2074 | + * |
2075 | + * GNOME Do is the legal property of its developers. Please refer to the |
2076 | + * COPYRIGHT file distributed with this |
2077 | + * source distribution. |
2078 | + * |
2079 | + * This program is free software: you can redistribute it and/or modify |
2080 | + * it under the terms of the GNU General Public License as published by |
2081 | + * the Free Software Foundation, either version 3 of the License, or |
2082 | + * (at your option) any later version. |
2083 | + * |
2084 | + * This program is distributed in the hope that it will be useful, |
2085 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2086 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2087 | + * GNU General Public License for more details. |
2088 | + * |
2089 | + * You should have received a copy of the GNU General Public License |
2090 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2091 | + */ |
2092 | + |
2093 | +using System; |
2094 | +using System.Collections.Generic; |
2095 | +using System.Linq; |
2096 | +using Mono.Unix; |
2097 | +using Do.Universe; |
2098 | +using System.Threading; |
2099 | + |
2100 | +namespace Facebook |
2101 | +{ |
2102 | + public class FacebookSendMailAction : Act |
2103 | + { |
2104 | + |
2105 | + public FacebookSendMailAction() |
2106 | + { |
2107 | + } |
2108 | + |
2109 | + public override string Name |
2110 | + { |
2111 | + get { return "Send mail message"; } |
2112 | + } |
2113 | + |
2114 | + public override string Description |
2115 | + { |
2116 | + get { return "Compose a message for your friend."; } |
2117 | + } |
2118 | + |
2119 | + public override string Icon {get { return "Facebook_compose_mail.png@" + GetType ().Assembly.FullName; } } |
2120 | + |
2121 | + public override IEnumerable<Type> SupportedItemTypes { |
2122 | + get |
2123 | + { |
2124 | + yield return typeof (FacebookContactItem); |
2125 | + yield return typeof (FacebookOutBoxMessageItem); |
2126 | + } |
2127 | + } |
2128 | + |
2129 | + public override bool SupportsItem (Item item) |
2130 | + { |
2131 | + return (item is FacebookContactItem || item is FacebookOutBoxMessageItem); |
2132 | + } |
2133 | + |
2134 | + public override bool ModifierItemsOptional { |
2135 | + get { return false; } |
2136 | + } |
2137 | + |
2138 | + public override IEnumerable<Type> SupportedModifierItemTypes { |
2139 | + get { yield return typeof(ITextItem); } |
2140 | + } |
2141 | + |
2142 | + public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems) |
2143 | + { |
2144 | + if (items.First() is FacebookContactItem) |
2145 | + { |
2146 | + yield return (new FacebookOutBoxMessageItem((items.First () as FacebookContactItem), (modItems.First () as ITextItem).Text)); |
2147 | + } |
2148 | + else |
2149 | + { |
2150 | + FacebookOutBoxMessageItem mail = (items.First() as FacebookOutBoxMessageItem); |
2151 | + mail.Body = (modItems.First () as ITextItem).Text; |
2152 | + Thread thread = new Thread ((ThreadStart)mail.send); |
2153 | + thread.IsBackground = true; |
2154 | + thread.Start (); |
2155 | + yield break; |
2156 | + } |
2157 | + } |
2158 | + } |
2159 | +} |
2160 | \ No newline at end of file |
2161 | |
2162 | === added file 'Facebook/src/FacebookWallPostItem.cs' |
2163 | --- Facebook/src/FacebookWallPostItem.cs 1970-01-01 00:00:00 +0000 |
2164 | +++ Facebook/src/FacebookWallPostItem.cs 2009-02-11 21:48:29 +0000 |
2165 | @@ -0,0 +1,69 @@ |
2166 | +/* FacebookWallPostItem.cs |
2167 | + * |
2168 | + * GNOME Do is the legal property of its developers. Please refer to the |
2169 | + * COPYRIGHT file distributed with this |
2170 | + * source distribution. |
2171 | + * |
2172 | + * This program is free software: you can redistribute it and/or modify |
2173 | + * it under the terms of the GNU General Public License as published by |
2174 | + * the Free Software Foundation, either version 3 of the License, or |
2175 | + * (at your option) any later version. |
2176 | + * |
2177 | + * This program is distributed in the hope that it will be useful, |
2178 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2179 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2180 | + * GNU General Public License for more details. |
2181 | + * |
2182 | + * You should have received a copy of the GNU General Public License |
2183 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2184 | + */ |
2185 | + |
2186 | +using System; |
2187 | +using Do.Universe; |
2188 | +using Do.Platform; |
2189 | +using GoogleCode.FacebookCSharp; |
2190 | + |
2191 | +namespace Facebook |
2192 | +{ |
2193 | + |
2194 | + |
2195 | + public class FacebookWallPostItem : Item, IUrlItem |
2196 | + { |
2197 | + protected string content; |
2198 | + protected long senderId; |
2199 | + protected string description; |
2200 | + protected BaseUserInformation sender; |
2201 | + |
2202 | + public FacebookWallPostItem(BaseUserInformation sender, string content) |
2203 | + { |
2204 | + this.senderId = sender.UserID; |
2205 | + this.content = content; |
2206 | + this.sender = sender; |
2207 | + } |
2208 | + |
2209 | + public override string Name |
2210 | + { |
2211 | + get { return "From: "+this.sender.Name; } |
2212 | + } |
2213 | + |
2214 | + public override string Description |
2215 | + { |
2216 | + get { return content; } |
2217 | + } |
2218 | + |
2219 | + public long SenderID |
2220 | + { |
2221 | + get { return this.senderId ;} |
2222 | + } |
2223 | + |
2224 | + public override string Icon |
2225 | + { |
2226 | + get { return "Facebook_wall.png@" + GetType ().Assembly.FullName; } |
2227 | + } |
2228 | + |
2229 | + public string Url |
2230 | + { |
2231 | + get{ return "http://www.facebook.com/profile.php?id="+Facebook.User.UserID+"&ref=profile"; } |
2232 | + } |
2233 | + } |
2234 | +} |
2235 | \ No newline at end of file |
2236 | |
2237 | === added file 'Facebook/src/Notifications.cs' |
2238 | --- Facebook/src/Notifications.cs 1970-01-01 00:00:00 +0000 |
2239 | +++ Facebook/src/Notifications.cs 2009-02-12 18:06:50 +0000 |
2240 | @@ -0,0 +1,163 @@ |
2241 | +/* Notifications.cs |
2242 | + * |
2243 | + * GNOME Do is the legal property of its developers. Please refer to the |
2244 | + * COPYRIGHT file distributed with this |
2245 | + * source distribution. |
2246 | + * |
2247 | + * This program is free software: you can redistribute it and/or modify |
2248 | + * it under the terms of the GNU General Public License as published by |
2249 | + * the Free Software Foundation, either version 3 of the License, or |
2250 | + * (at your option) any later version. |
2251 | + * |
2252 | + * This program is distributed in the hope that it will be useful, |
2253 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2254 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2255 | + * GNU General Public License for more details. |
2256 | + * |
2257 | + * You should have received a copy of the GNU General Public License |
2258 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2259 | + */ |
2260 | + |
2261 | +using System; |
2262 | +using Mono.Unix; |
2263 | +using Do.Platform; |
2264 | + |
2265 | +namespace Facebook |
2266 | +{ |
2267 | + |
2268 | + |
2269 | + public class ChatMessageNotification : Notification |
2270 | + { |
2271 | + readonly string NewMessageFormat = Catalog.GetString ("{0} says:"); |
2272 | + |
2273 | + string user; |
2274 | + |
2275 | + public ChatMessageNotification (string user, string message) |
2276 | + : base ("", message, "") |
2277 | + { |
2278 | + this.user = user; |
2279 | + } |
2280 | + |
2281 | + public override string Title { |
2282 | + get |
2283 | + { |
2284 | + return string.Format (NewMessageFormat, user); |
2285 | + } |
2286 | + } |
2287 | + |
2288 | + public override string Icon { |
2289 | + get { return "Facebook_wall.png@" + GetType ().Assembly.FullName; } |
2290 | + } |
2291 | + } |
2292 | + |
2293 | + public class LoginNotification : Notification |
2294 | + { |
2295 | + public LoginNotification (string user) |
2296 | + : base ("", "Connected as "+user, "") |
2297 | + { |
2298 | + } |
2299 | + |
2300 | + public override string Title { |
2301 | + get { return "Login Succeded!"; } |
2302 | + } |
2303 | + |
2304 | + public override string Icon { |
2305 | + get { return "Facebook.png@" + GetType ().Assembly.FullName; } |
2306 | + } |
2307 | + } |
2308 | + |
2309 | + public class PokeNotification : Notification |
2310 | + { |
2311 | + public PokeNotification () |
2312 | + : base ("", "You have new pokes", "" ) |
2313 | + { |
2314 | + } |
2315 | + |
2316 | + public override string Title { |
2317 | + get { return "Facebook Pokes"; } |
2318 | + } |
2319 | + |
2320 | + public override string Icon { |
2321 | + get { return "Facebook_poke.png@" + GetType ().Assembly.FullName; } |
2322 | + } |
2323 | + } |
2324 | + |
2325 | + public class StatusChangedNotification : Notification |
2326 | + { |
2327 | + public StatusChangedNotification (string user, string status) |
2328 | + : base ("", user+" "+status, "") |
2329 | + { |
2330 | + } |
2331 | + |
2332 | + public override string Title { |
2333 | + get { return "Status changed"; } |
2334 | + } |
2335 | + |
2336 | + public override string Icon { |
2337 | + get { return "Facebook_notifications.png@" + GetType ().Assembly.FullName; } |
2338 | + } |
2339 | + } |
2340 | + |
2341 | + public class WallNotification : Notification |
2342 | + { |
2343 | + readonly string NewMessageFormat = Catalog.GetString ("{0} posted in your wall:"); |
2344 | + |
2345 | + string user; |
2346 | + |
2347 | + public WallNotification (string user, string message) |
2348 | + : base ("", message, "") |
2349 | + { |
2350 | + this.user = user; |
2351 | + } |
2352 | + |
2353 | + public override string Title { |
2354 | + get |
2355 | + { |
2356 | + return string.Format (NewMessageFormat, user); |
2357 | + } |
2358 | + } |
2359 | + |
2360 | + public override string Icon { |
2361 | + get { return "Facebook_wall.png@" + GetType ().Assembly.FullName; } |
2362 | + } |
2363 | + } |
2364 | + |
2365 | + public class NewInboxNotification : Notification |
2366 | + { |
2367 | + readonly string NewMessageFormat = Catalog.GetString ("New mail! Subject: {0}"); |
2368 | + string subject; |
2369 | + |
2370 | + public NewInboxNotification (string user, string subject, string message) |
2371 | + : base ("", message+"\nSent by: "+user, "") |
2372 | + { |
2373 | + this.subject = subject; |
2374 | + } |
2375 | + |
2376 | + public override string Title { |
2377 | + get |
2378 | + { |
2379 | + return string.Format (NewMessageFormat, subject); |
2380 | + } |
2381 | + } |
2382 | + |
2383 | + public override string Icon { |
2384 | + get { return "Facebook_mail.png@" + GetType ().Assembly.FullName; } |
2385 | + } |
2386 | + } |
2387 | + |
2388 | + |
2389 | + |
2390 | + public class Notifications |
2391 | + { |
2392 | + |
2393 | + public Notifications () |
2394 | + { |
2395 | + } |
2396 | + |
2397 | + public void Notify (Notification notification) |
2398 | + { |
2399 | + Services.Notifications.Notify (notification); |
2400 | + } |
2401 | + } |
2402 | + |
2403 | +} |
2404 | |
2405 | === added file 'Facebook/src/Preferences.cs' |
2406 | --- Facebook/src/Preferences.cs 1970-01-01 00:00:00 +0000 |
2407 | +++ Facebook/src/Preferences.cs 2009-02-09 20:53:00 +0000 |
2408 | @@ -0,0 +1,49 @@ |
2409 | +/* Preferences.cs |
2410 | + * |
2411 | + * GNOME Do is the legal property of its developers. Please refer to the |
2412 | + * COPYRIGHT file distributed with this |
2413 | + * source distribution. |
2414 | + * |
2415 | + * This program is free software: you can redistribute it and/or modify |
2416 | + * it under the terms of the GNU General Public License as published by |
2417 | + * the Free Software Foundation, either version 3 of the License, or |
2418 | + * (at your option) any later version. |
2419 | + * |
2420 | + * This program is distributed in the hope that it will be useful, |
2421 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2422 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2423 | + * GNU General Public License for more details. |
2424 | + * |
2425 | + * You should have received a copy of the GNU General Public License |
2426 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2427 | + */ |
2428 | + |
2429 | +using System; |
2430 | +using Mono.Unix; |
2431 | +using Do.Platform; |
2432 | + |
2433 | +namespace Facebook |
2434 | +{ |
2435 | + public class FacebookPreferences |
2436 | + { |
2437 | + const string UsernameKey = "Username"; |
2438 | + const string PasswordKey = "Password"; |
2439 | + |
2440 | + IPreferences prefs; |
2441 | + |
2442 | + public FacebookPreferences() |
2443 | + { |
2444 | + prefs = Services.Preferences.Get<FacebookPreferences> (); |
2445 | + } |
2446 | + |
2447 | + public string Username { |
2448 | + get { return prefs.Get<string> (UsernameKey, ""); } |
2449 | + set { prefs.Set<string> (UsernameKey, value); } |
2450 | + } |
2451 | + |
2452 | + public string Password { |
2453 | + get { return prefs.GetSecure (PasswordKey, ""); } |
2454 | + set { prefs.SetSecure (PasswordKey, value); } |
2455 | + } |
2456 | + } |
2457 | +} |
2458 | \ No newline at end of file |
2459 | |
2460 | === modified file 'Makefile.am' |
2461 | --- Makefile.am 2009-02-06 19:37:09 +0000 |
2462 | +++ Makefile.am 2009-02-07 08:23:21 +0000 |
2463 | @@ -18,6 +18,7 @@ |
2464 | EOG-Slideshow \ |
2465 | Epiphany \ |
2466 | Evolution \ |
2467 | + Facebook \ |
2468 | File \ |
2469 | Firefox \ |
2470 | Flickr \ |
2471 | |
2472 | === modified file 'configure.ac' |
2473 | --- configure.ac 2009-02-06 19:37:09 +0000 |
2474 | +++ configure.ac 2009-02-07 08:23:21 +0000 |
2475 | @@ -133,6 +133,7 @@ |
2476 | EOG-Slideshow/Makefile |
2477 | Epiphany/Makefile |
2478 | Evolution/Makefile |
2479 | +Facebook/Makefile |
2480 | File/Makefile |
2481 | Firefox/Makefile |
2482 | Flickr/Makefile |
Indexes Facebook contacts
Fetches Inbox
Send wall posts, send mail, poke friends, and more