[tuxdroid-svn] r5965 - software_suite_v3/software/plugin/plugin-twitter/trunk/src
Status: Beta
Brought to you by:
ks156
From: jerome <c2m...@c2...> - 2009-12-09 14:37:47
|
Author: jerome Date: 2009-12-09 15:37:28 +0100 (Wed, 09 Dec 2009) New Revision: 5965 Modified: software_suite_v3/software/plugin/plugin-twitter/trunk/src/TwitterPlugin.java Log: * Added a protection in case of empty messages / replies / updates list. Modified: software_suite_v3/software/plugin/plugin-twitter/trunk/src/TwitterPlugin.java =================================================================== --- software_suite_v3/software/plugin/plugin-twitter/trunk/src/TwitterPlugin.java 2009-12-09 13:00:01 UTC (rev 5964) +++ software_suite_v3/software/plugin/plugin-twitter/trunk/src/TwitterPlugin.java 2009-12-09 14:37:28 UTC (rev 5965) @@ -343,7 +343,7 @@ throwMessage(pickSentence(newMultipleTweetSentences), String.valueOf(updateCount)); } - else if(this.configuration().getReadTweets()) + else if(this.configuration().getReadTweets() && updateCount > 0) { throwRes(); int i = 0; @@ -394,16 +394,19 @@ else { //Readong tweet content. - this.throwRes(); - - int i = 0; - while( i != this.privateMessages.size()) - { - Hashtable<String, String> hash = this.privateMessages.get( i ); - throwMessage("Message from {0}, {1}", hash.get("name"), hash.get("value")); - i++; - } - this.privateMessages.clear(); + if (msCount > 0) + { + this.throwRes(); + + int i = 0; + while( i != this.privateMessages.size()) + { + Hashtable<String, String> hash = this.privateMessages.get( i ); + throwMessage("Message from {0}, {1}", hash.get("name"), hash.get("value")); + i++; + } + this.privateMessages.clear(); + } } } } @@ -437,16 +440,19 @@ else { //Reading tweet content. - this.throwRes(); - - int i = 0; - while( i != this.publicMessages.size()) - { - Hashtable<String, String> hash = this.publicMessages.get( i ); - throwMessage("Reply from {0}, {1}", hash.get("name"), hash.get("value")); - i++; - } - this.publicMessages.clear(); + if (rpCount > 0) + { + this.throwRes(); + + int i = 0; + while( i != this.publicMessages.size()) + { + Hashtable<String, String> hash = this.publicMessages.get( i ); + throwMessage("Reply from {0}, {1}", hash.get("name"), hash.get("value")); + i++; + } + this.publicMessages.clear(); + } } } } |