[tuxdroid-svn] r5754 - software_suite_v3/software/plugin/plugin-facebook/branches/october_release/s
Status: Beta
Brought to you by:
ks156
|
From: jerome <c2m...@c2...> - 2009-10-20 15:29:22
|
Author: jerome
Date: 2009-10-20 17:29:04 +0200 (Tue, 20 Oct 2009)
New Revision: 5754
Modified:
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java
Log:
* Throwing emails by sender ( cf: Twitter Plugin).
Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java 2009-10-20 15:16:34 UTC (rev 5753)
+++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java 2009-10-20 15:29:04 UTC (rev 5754)
@@ -57,9 +57,7 @@
{
if (this.getCommand().equalsIgnoreCase("configure"))
{
- //Prompt web browser for facebook permissions.
- FacebookConnection.promptAuthorizations();
- //TODO check actual permissions.
+ this.doConfigure();
}
else
{
@@ -69,6 +67,17 @@
/**
+ * Configure facebook account access rights.
+ */
+ public void doConfigure()
+ {
+ //Prompt web browser for facebook permissions.
+ FacebookConnection.promptAuthorizations();
+ //TODO check actual permissions.
+ }
+
+
+ /**
* Start run or check command.
*/
public void RunOrCheck()
@@ -165,7 +174,27 @@
this.throwMessage("You don't have any messages");
}
}
- //TODO throwing emails by sender.
+
+ if(inbox.size() > 0)
+ {
+ //Throwing emails by sender.
+ Hashtable<String, Integer> emailsBySender = new Hashtable<String, Integer>();
+ emailsBySender = functions.getByNames(inbox);
+
+ Vector<String> senders = new Vector<String>(emailsBySender.keySet());
+
+ for(String sender : senders)
+ {
+ if (emailsBySender.get(sender).intValue() == 1)
+ {
+ this.throwMessage("One from {0}", functions.getFacebookName(sender));
+ }
+ else
+ {
+ this.throwMessage("{0} messages from {1}", functions.getFacebookName(sender), emailsBySender.get(sender));
+ }
+ }
+ }
}
|