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));
+                               }
+                       }
+               }
        }
        
        


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to