incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r750621 - /incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala
Date Thu, 05 Mar 2009 22:02:17 GMT
Author: vdichev
Date: Thu Mar  5 22:02:16 2009
New Revision: 750621

URL: http://svn.apache.org/viewvc?rev=750621&view=rev
Log:
Twitter API: end session method

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala?rev=750621&r1=750620&r2=750621&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala Thu Mar
 5 22:02:16 2009
@@ -94,8 +94,7 @@
     case Req(l: List[String], this.method, GetRequest) if l == ApiPath ::: "friendships"
:: "exists" :: Nil => existsFriendship
 
     case Req(l: List[String], this.method, GetRequest) if l == ApiPath ::: "account" :: "verify_credentials"
:: Nil => verifyCredentials
-    // case Req(l: List[String], this.method, GetRequest) if l == ApiPath ::: "account" ::
"end_session" :: Nil => endSession
-    // case Req(l: List[String], this.method, GetRequest) if l == ApiPath ::: "account" ::
"rate_limit_status" :: Nil => rateLimitStatus
+    case Req(l: List[String], this.method, PostRequest) if l == ApiPath ::: "account" ::
"end_session" :: Nil => endSession
     // case Req(l: List[String], this.method, GetRequest) if l == ApiPath ::: "update_profile"
:: Nil => updateProfile
 
   }
@@ -288,6 +287,13 @@
     yield Right(Map("friends" -> user_a.following_?(user_b)))
   }
   
+  def endSession(): Box[TwitterResponse] = {
+    calcUser map { _ =>
+      User.logUserOut
+      Right(Map("hash" -> Map("error" -> "User logged out.")))
+    }
+  }
+  
   private def calcUser(): Box[User] = 
     LiftRules.authentication match {
       case basicAuth: HttpBasicAuthentication =>



Mime
View raw message