Author: jerome
Date: 2009-10-23 16:48:13 +0200 (Fri, 23 Oct 2009)
New Revision: 5767
Modified:
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/connection/FacebookSessionUtils.java
Log:
* Fixed a bug with the session when a new user get logged in.
Modified:
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java
===================================================================
---
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java
2009-10-23 14:28:44 UTC (rev 5766)
+++
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java
2009-10-23 14:48:13 UTC (rev 5767)
@@ -37,11 +37,22 @@
/**
* Try to get connected to fb with the old registered session.
*/
- private boolean connectOldSession()
+ private boolean connectOldSession(String username, String password)
{
try
{
FacebookSessionUtils.loadSession();
+
+ //Checking username.
+ if(!
username.equalsIgnoreCase(FacebookSessionUtils.getMail()))
+ {
+ if(!
password.equalsIgnoreCase(FacebookSessionUtils.getPass()))
+ {
+ //then a new user has logged in.
+ return false;
+ }
+ }
+
String sessionKey =
FacebookSessionUtils.getSessionKey();
String sessionSecret =
FacebookSessionUtils.getSessionSecret();
@@ -73,7 +84,7 @@
try
{
//Returning if old session was still valid.
- if(this.connectOldSession())
+ if(this.connectOldSession(username, password))
{
return true;
}
Modified:
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/connection/FacebookSessionUtils.java
===================================================================
---
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/connection/FacebookSessionUtils.java
2009-10-23 14:28:44 UTC (rev 5766)
+++
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/connection/FacebookSessionUtils.java
2009-10-23 14:48:13 UTC (rev 5767)
@@ -60,6 +60,8 @@
{
sessionUtils.add("0");
sessionUtils.add("1");
+ sessionUtils.add(mail);
+ sessionUtils.add(pass);
}
public static void setMail(String eMail)
@@ -126,7 +128,28 @@
}
+
/**
+ * Return last used mail.
+ * @return
+ */
+ public static String getMail()
+ {
+ return sessionUtils.get( 2 );
+ }
+
+
+ /**
+ * Return last used pass.
+ * @return
+ */
+ public static String getPass()
+ {
+ return sessionUtils.get( 3 );
+ }
+
+
+ /**
* Register the last known session key.
* @param aSessionKey
*/
------------------------------------------------------------------------------
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