incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r792713 - in /incubator/esme/trunk/server/src/main: scala/org/apache/esme/model/Mailbox.scala webapp/templates-hidden/message.html
Date Thu, 09 Jul 2009 21:34:42 GMT
Author: vdichev
Date: Thu Jul  9 21:34:41 2009
New Revision: 792713

URL: http://svn.apache.org/viewvc?rev=792713&view=rev
Log:
ESME-77 Display nickname of sender in message resend reason.

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala
    incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala?rev=792713&r1=792712&r2=792713&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala Thu Jul
 9 21:34:41 2009
@@ -25,6 +25,7 @@
 import mapper._
 import util._
 import net.liftweb.http.js.JE._
+import net.liftweb.http.js.JsExp
 
 import scala.xml._
 
@@ -67,11 +68,16 @@
   def attr: MetaData
   def asJs = attr match {
     case Null => JsNull
-    case _ => JsObj((attr.key, Str(attr.value.toString)))
+    case _ => JsObj((attr.key, attrValueAsJs(attr.value)))
   }
+  def attrValueAsJs(value: Seq[Node]): JsExp = Str(value.toString)
 }
+
 case class ResendReason(fromUserId: Long) extends MailboxReason {
   def attr = new UnprefixedAttribute("resent_from", fromUserId.toString, Null)
+  
+  override def attrValueAsJs(value: Seq[Node]) =
+    User.find(fromUserId).map(_.asJs) openOr JsNull
 }
 case object NoReason extends MailboxReason {
   def attr = Null

Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html?rev=792713&r1=792712&r2=792713&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html Thu Jul  9 21:34:41
2009
@@ -55,7 +55,13 @@
             if (cometMsg.pool) msgPool = cometMsg.pool.name;
             var msgSource = cometMsg.source;
             var msgReason = ""
-            for (r in cometReason) {var msgReason = r; break}
+            for (r in cometReason) {
+              if (r == "resent_from")
+                msgReason = "resent:" + cometReason[r].nickname;
+              else
+                msgReason = r;
+              break
+            }
             var msgTags = jQuery(cometMsg.text).find('tags > tag').get();
             for (var tagIndex=0; tagIndex < msgTags.length; tagIndex++) {
               // Replace each tag element with the plain tag text



Mime
View raw message