incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r885756 - in /incubator/esme/trunk/server/src/main/scala/org/apache/esme: actor/HttpSender.scala actor/UserActor.scala api/TwitterAPI.scala external/RssFeed.scala model/Action.scala model/Message.scala
Date Tue, 01 Dec 2009 12:51:56 GMT
Author: vdichev
Date: Tue Dec  1 12:51:55 2009
New Revision: 885756

URL: http://svn.apache.org/viewvc?rev=885756&view=rev
Log:
ESME-131 Fix appended tags to HTTP POST action, Twitter API, RSS feed and RestAPI's get_text_msgs

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/HttpSender.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/HttpSender.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/HttpSender.scala?rev=885756&r1=885755&r2=885756&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/HttpSender.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/HttpSender.scala Tue
Dec  1 12:51:55 2009
@@ -91,7 +91,7 @@
     replace("%f", followerName).
     replace("%i", user.imageUrl).
     replace("%w", user.wholeName).
-    replace("%s", msg.getText).
+    replace("%s", msg.body).
     replace("%t", msg.getTags).
     replace("%d", msg.getWhen.toString)
   }

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala?rev=885756&r1=885755&r2=885756&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala Tue Dec
 1 12:51:55 2009
@@ -284,7 +284,7 @@
 
             case ScalaInterpret => logger.info("Scala interpreter is disabled!")
             /*if (msg.source.is != "scala")
-              ScalaInterpreter ! ScalaInterpreter.ScalaExcerpt(userId, msg.id.is, msg.pool.is,
msg.getText)
+              ScalaInterpreter ! ScalaInterpreter.ScalaExcerpt(userId, msg.id.is, msg.pool.is,
msg.body)
             */
 
             case PerformFilter => Stats incr "messagesFiltered" // IGNORE

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=885756&r1=885755&r2=885756&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 Tue Dec
 1 12:51:55 2009
@@ -128,7 +128,7 @@
   def msgAttributes(msg: Message) = {
     Map("created_at" -> tf.format(new java.util.Date(msg.when.is)),
     "id" -> msg.id.is,
-    "text" -> msg.getText.trim,
+    "text" -> msg.body.trim,
     "source" -> msg.source,
     "truncated" -> false,
     "favorited" -> false,

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala?rev=885756&r1=885755&r2=885756&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala Tue
Dec  1 12:51:55 2009
@@ -76,10 +76,10 @@
         // a hack to format text identically- difference in urls & trailing whitespace
         val lastMessageText = 
           Message.create.setTextAndTags(message.text, Nil, Empty).
-            get.getText.trim
+            get.body.trim
         msgs.takeWhile{ msg =>
           Message.create.setTextAndTags(msg.text, Nil, Empty).
-            get.getText.trim != lastMessageText
+            get.body.trim != lastMessageText
         }
       case None => msgs
     }

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala?rev=885756&r1=885755&r2=885756&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala Tue Dec
 1 12:51:55 2009
@@ -203,7 +203,7 @@
             val lastMsg = if (msgList.isEmpty) None 
               else {
                 val m = msgList.first
-                Some(Distributor.UserCreatedMessage(user, m.getText, m.tags, m.when, Empty,
m.source, Full(m.replyTo), None))
+                Some(Distributor.UserCreatedMessage(user, m.body, m.tags, m.when, Empty,
m.source, Full(m.replyTo), None))
               }
 
             val feed = a match {

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala?rev=885756&r1=885755&r2=885756&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala Tue Dec
 1 12:51:55 2009
@@ -245,14 +245,7 @@
      }
    }
  
-  lazy val body: String = {
-  	val org = originalXml
-
-    (org \ "body").map(_.child map {
-      case e: Elem => e.text
-      case x => x.text
-    }).first.first
-  }
+  lazy val body: String = originalXml \ "body" text
 
   lazy val metaData: String = {
     val org = originalXml
@@ -363,7 +356,7 @@
   
   lazy val toXHTML = transformBody(digestedXHTML)
     
-  lazy val toPlainTextBody = transformBody(Text(getText))
+  lazy val toPlainTextBody = transformBody(Text(body))
 
   private [model] def saveTheTags() = synchronized {
     for (tag <- tagIds) {



Mime
View raw message