Author: jerome
Date: 2009-10-12 15:33:20 +0200 (Mon, 12 Oct 2009)
New Revision: 5635

Modified:
   
software_suite_v3/software/plugin/plugin-twitter/branches/october_release/plugin-twitter/src/TwitterPlugin.java
Log:
* Added tts exception for first check cycle.

Modified: 
software_suite_v3/software/plugin/plugin-twitter/branches/october_release/plugin-twitter/src/TwitterPlugin.java
===================================================================
--- 
software_suite_v3/software/plugin/plugin-twitter/branches/october_release/plugin-twitter/src/TwitterPlugin.java
     2009-10-12 11:42:51 UTC (rev 5634)
+++ 
software_suite_v3/software/plugin/plugin-twitter/branches/october_release/plugin-twitter/src/TwitterPlugin.java
     2009-10-12 13:33:20 UTC (rev 5635)
@@ -21,8 +21,6 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Vector;
 
@@ -211,8 +209,8 @@
                {
                        this.throwed = true;
                        this.throwResult(true);
+                       this.throwMessage("Twitter");
                }
-               this.throwMessage("Twitter");
        }
        
        
@@ -222,6 +220,8 @@
                //Creating / getting sav context.
                savedStruct = new 
TwitterDatasStruct(this.configuration().getUsername());
                
+               boolean secondCycle = ( 
this.getCommand().equalsIgnoreCase("check") && savedStruct.isFirstCycle() ) ? 
false : true;
+               
                /***
                 * Getting connected to twitter and setting update source ( 
here TuxDroid ).
                 ***/ 
@@ -240,23 +240,28 @@
                                if(this.configuration().getCheckFriends())
                                {
                                        int updateCount = 
getNewFriendStatusesCount(twitter);
-               
-                                       if ( updateCount == 1 )
+                
+                                       //First check insilent mode.
+                                       
if(this.getCommand().equalsIgnoreCase("run") || secondCycle)
                                        {
-                                               throwRes();
-                                               throwMessage("You have a new 
friend update");
-                                       }
-                                       else if ( updateCount > 1 )
-                                       {
-                                               throwRes();
-                                               throwMessage("You have {0} 
friend updates", String.valueOf(updateCount));
-                                       }
-                                       else
-                                       {
-                                               if ( ! 
this.getCommand().equalsIgnoreCase("check") )
+                                               
+                                               if ( updateCount == 1 )
                                                {
-                                                   throwMessage("You don't 
have any friend updates.");
+                                                       throwRes();
+                                                       throwMessage("You have 
a new friend update");
                                                }
+                                               else if ( updateCount > 1 )
+                                               {
+                                                       throwRes();
+                                                       throwMessage("You have 
{0} friend updates", String.valueOf(updateCount));
+                                               }
+                                               else
+                                               {
+                                                       if ( ! 
this.getCommand().equalsIgnoreCase("check") )
+                                                       {
+                                                           throwMessage("You 
don't have any friend updates.");
+                                                       }
+                                               }
                                        }
                                }
                                
@@ -269,10 +274,13 @@
                                {
                                    if ( getPrivateMessagesCount(twitter) > 0 )
                                    {
-                                       
-                                       this.sort(this.messagesList);
-                               //Counting by name and throwing messages.
-                                       this.getByNames(this.messagesList, 
MESSAGE);
+                        //First check insilent mode.
+                                               
if(this.getCommand().equalsIgnoreCase("run") || secondCycle)
+                                               {
+                                           this.sort(this.messagesList);
+                                   //Counting by name and throwing messages.
+                                           this.getByNames(this.messagesList, 
MESSAGE);
+                                               }
                                    }
                                    else
                                    {
@@ -285,9 +293,13 @@
                                    //Getting and sorting new user replies.
                                    if ( getPublicMessagesCount(twitter) > 0 )
                                    {
-                                       this.sort(this.repliesList);
-                                       //Counting by name and throwing 
messages.
-                                       this.getByNames(this.repliesList, 
REPLY);
+                        //First check insilent mode.
+                                               
if(this.getCommand().equalsIgnoreCase("run") || secondCycle)
+                                               {
+                                           this.sort(this.repliesList);
+                                           //Counting by name and throwing 
messages.
+                                           this.getByNames(this.repliesList, 
REPLY);
+                                               }
                                    }
                                    else
                                    {


------------------------------------------------------------------------------
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