labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ber...@apache.org
Subject svn commit: r653502 - in /labs/vysper/src/main/java/org/apache/vysper: mina/MinaBackedSessionContext.java util/ xmpp/modules/core/base/handler/PresenceHandler.java xmpp/writer/DenseStanzaLogRenderer.java xmpp/xmlfragment/XMLText.java
Date Mon, 05 May 2008 15:35:17 GMT
Author: berndf
Date: Mon May  5 08:35:16 2008
New Revision: 653502

URL: http://svn.apache.org/viewvc?rev=653502&view=rev
Log:
[vysper] minor changes

Removed:
    labs/vysper/src/main/java/org/apache/vysper/util/
Modified:
    labs/vysper/src/main/java/org/apache/vysper/mina/MinaBackedSessionContext.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/core/base/handler/PresenceHandler.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/writer/DenseStanzaLogRenderer.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/xmlfragment/XMLText.java

Modified: labs/vysper/src/main/java/org/apache/vysper/mina/MinaBackedSessionContext.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/mina/MinaBackedSessionContext.java?rev=653502&r1=653501&r2=653502&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/mina/MinaBackedSessionContext.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/mina/MinaBackedSessionContext.java Mon May
 5 08:35:16 2008
@@ -28,6 +28,7 @@
 import org.apache.vysper.xmpp.writer.StanzaWriter;
 
 /**
+ * connects MINA frontend to the vysper backend
  */
 public class MinaBackedSessionContext extends AbstractSessionContext implements StanzaWriter
{
     private IoSession minaSession;

Modified: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/core/base/handler/PresenceHandler.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/core/base/handler/PresenceHandler.java?rev=653502&r1=653501&r2=653502&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/core/base/handler/PresenceHandler.java
(original)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/core/base/handler/PresenceHandler.java
Mon May  5 08:35:16 2008
@@ -482,11 +482,11 @@
 				null);
 	}
 
-	private void relayStanza(Entity reviever, Stanza stanza,
+	private void relayStanza(Entity receiver, Stanza stanza,
 			SessionContext sessionContext) {
 		try {
 			sessionContext.getServerRuntimeContext().getStanzaRelay().relay(
-					reviever, stanza);
+					receiver, stanza);
 		} catch (DeliveryException e) {
 			e.printStackTrace();
 		}

Modified: labs/vysper/src/main/java/org/apache/vysper/xmpp/writer/DenseStanzaLogRenderer.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/writer/DenseStanzaLogRenderer.java?rev=653502&r1=653501&r2=653502&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/writer/DenseStanzaLogRenderer.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/writer/DenseStanzaLogRenderer.java Mon
May  5 08:35:16 2008
@@ -117,8 +117,33 @@
     }
 
     private static void renderPresence(StringBuilder stringBuilder, XMLElement stanza, XMLElement
firstInnerElement) {
-        renderAttribute(stringBuilder, stanza, "from");
         renderAttribute(stringBuilder, stanza, "type");
+        renderAttribute(stringBuilder, stanza, "from");
+        renderAttribute(stringBuilder, stanza, "to");
+
+        try {
+            XMLElement show = stanza.getSingleInnerElementsNamed("show");
+            if (show != null) {
+                XMLText showText = show.getSingleInnerText();
+                if (showText != null) {
+                    stringBuilder.append(ELEMENT_SEPARATOR);
+                    stringBuilder.append("show").append(EQUALS);
+                    stringBuilder.append(ATTR_QUOTE).append(showText).append(ATTR_QUOTE);
+                }
+            }
+            XMLElement status = stanza.getSingleInnerElementsNamed("status");
+            if (status != null) {
+                XMLText statusText = status.getSingleInnerText();
+                if (statusText != null) {
+                    stringBuilder.append(ELEMENT_SEPARATOR);
+                    stringBuilder.append("status").append(EQUALS);
+                    stringBuilder.append(ATTR_QUOTE).append(statusText).append(ATTR_QUOTE);
+                }
+            }
+        } catch (XMLSemanticError xmlSemanticError) {
+            stringBuilder.append("*error*");
+        }
+
     }
 
     private static void renderAttribute(StringBuilder stringBuilder, XMLElement element,
String attributeName) {

Modified: labs/vysper/src/main/java/org/apache/vysper/xmpp/xmlfragment/XMLText.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/xmlfragment/XMLText.java?rev=653502&r1=653501&r2=653502&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/xmlfragment/XMLText.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/xmlfragment/XMLText.java Mon May  5 08:35:16
2008
@@ -45,4 +45,8 @@
     public int hashCode() {
         return (text != null ? text.hashCode() : 0);
     }
+
+    public String toString() {
+        return getText();
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message