incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r992087 - /incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala
Date Thu, 02 Sep 2010 19:53:47 GMT
Author: vdichev
Date: Thu Sep  2 19:53:47 2010
New Revision: 992087

URL: http://svn.apache.org/viewvc?rev=992087&view=rev
Log:
ESME-267 Links in messages in pools don't redirect through the shortened URL to disable popularity
stats

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala

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=992087&r1=992086&r2=992087&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 Thu Sep
 2 19:53:47 2010
@@ -392,9 +392,16 @@ class Message extends LongKeyedMapper[Me
 
         case e: Elem if e.label == "url" =>
           e.attribute("url").flatMap(url =>
-            e.attribute("uniqueId").map(id =>
-              <xml:group> <a class="tiplelement" href={"/u/"+id} target="_blank"
title={url}>{url.toString.substring(0,20)}...</a> </xml:group>)).
-          getOrElse(Text("") )
+            e.attribute("uniqueId").map { id =>
+              val href =
+                if (pool.defined_?)
+                  // disable shortener to avoid popularity statistics
+                  url.toString
+                else
+                  "/u/" + id
+              <xml:group> <a class="tiplelement" href={href} target="_blank" title={url}>{url.toString.substring(0,20)}...</a>
</xml:group>
+            }
+          ).getOrElse(Text("") )
 
         case e: Elem if e.label == "em" =>
           e.attribute("text").map(text =>



Mime
View raw message