incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r745644 - /incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala
Date Wed, 18 Feb 2009 20:51:43 GMT
Author: vdichev
Date: Wed Feb 18 20:51:42 2009
New Revision: 745644

URL: http://svn.apache.org/viewvc?rev=745644&view=rev
Log:
ESME-31 fix bug of missing or duplicate status messages after posting.

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=745644&r1=745643&r2=745644&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 Wed Feb
18 20:51:42 2009
@@ -178,21 +178,13 @@
   
   def update(params: HasParams, req: Req): Box[TwitterResponse] = {
     for (user <- calcUser(req) ?~ "User not found";
-         msg <- req.param("status") ?~ "Message not included")
+         text <- req.param("status") ?~ "Message not included";
+         msg <- Message.create.author(user.id.is).when(millis).
+                               source(req.param("source") openOr "twitterapi").
+                               setTextAndTags(text, Nil, None))
     yield {
-      val from: String = req.param("source") openOr "twitterapi"
-
-      Distributor !
-      Distributor.UserCreatedMessage(user.id.is, msg, Nil,
-                                     millis,
-                                     Empty,
-                                     from,
-                                     req.param("replyto").map(toLong))
-      Right(Map("status" ->
-        msgData(Message.create.author(user.id.is).when(millis).
-          source(from).
-          setTextAndTags(msg, Nil, None).get)
-      ))
+      Distributor ! Distributor.AddMessageToMailbox(user.id.is, msg.saveMe, NoReason)
+      Right(Map("status" -> msgData(msg)))
     }
   }
 



Mime
View raw message