Author: vdichev
Date: Sat Feb 28 22:29:21 2009
New Revision: 748928
URL: http://svn.apache.org/viewvc?rev=748928&view=rev
Log:
ESME-33 Info about a single message in Twitter API
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=748928&r1=748927&r2=748928&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
Sat Feb 28 22:29:21 2009
@@ -79,7 +79,7 @@
case Req(l: List[String], this.method, GetRequest) if l == ApiPath :::
"direct_messages" :: Nil => directMessages
case Req(l: List[String], this.method, GetRequest) if l == ApiPath :::
"statuses" :: "friends_timeline" :: Nil => friendsTimeline
case Req(l: List[String], this.method, GetRequest) if l == ApiPath :::
"statuses" :: "user_timeline" :: Nil => userTimeline
- // case Req(l: List[String], this.method, GetRequest) if l == ApiPath :::
"statuses" :: "show" :: Nil => showStatus
+ case Req(l: List[String], this.method, GetRequest) if l == ApiPath :::
"statuses" :: "show" :: l.last :: Nil => () => showStatus(l last)
case Req(l: List[String], this.method, PostRequest) if l == ApiPath :::
"statuses" :: "update" :: Nil => update
case Req(l: List[String], this.method, GetRequest) if l == ApiPath :::
"statuses" :: "friends" :: Nil => friends
@@ -233,6 +233,11 @@
yield Right(Map("user" -> extendedUserData(user)))
}
+ def showStatus(statusId: String): Box[TwitterResponse] = {
+ for (status <- Message.find(statusId) ?~ "Message not found")
+ yield Right(Map("status" -> msgData(status)))
+ }
+
private def calcUser(): Box[User] =
LiftRules.authentication match {
case basicAuth: HttpBasicAuthentication =>