labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ber...@apache.org
Subject svn commit: r657577 - in /labs/vysper/src/main/java/org/apache/vysper/xmpp: modules/core/base/handler/PresenceHandler.java stanza/StanzaBuilder.java
Date Sun, 18 May 2008 16:11:23 GMT
Author: berndf
Date: Sun May 18 09:11:22 2008
New Revision: 657577

URL: http://svn.apache.org/viewvc?rev=657577&view=rev
Log:
[vysper] fix presence handling unavailabe test

Modified:
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/core/base/handler/PresenceHandler.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/stanza/StanzaBuilder.java

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=657577&r1=657576&r2=657577&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
Sun May 18 09:11:22 2008
@@ -175,6 +175,14 @@
     }
 
     private void handleInboundUnavailable(PresenceStanza presenceStanza, SessionContext sessionContext)
{
+        ResourceRegistry registry = sessionContext.getServerRuntimeContext().getResourceRegistry();
+
+        String firstResource = registry.getFirstResourceForSession(sessionContext);
+        if (firstResource != null) {
+            registry.setResourceState(firstResource, ResourceState.UNAVAILABLE);
+        }
+        // TODO propagate to _all_ resources for this entity.
+        
         System.out.println("C: has become unavailable");
     }
 

Modified: labs/vysper/src/main/java/org/apache/vysper/xmpp/stanza/StanzaBuilder.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/stanza/StanzaBuilder.java?rev=657577&r1=657576&r2=657577&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/stanza/StanzaBuilder.java (original)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/stanza/StanzaBuilder.java Sun May 18
09:11:22 2008
@@ -53,6 +53,7 @@
         if (from != null) stanzaBuilder.addAttribute("from", from.getFullQualifiedName());
         if (to != null) stanzaBuilder.addAttribute("to", to.getFullQualifiedName());
         if (lang != null) stanzaBuilder.addAttribute("xml:lang", lang);
+        if (type != null) stanzaBuilder.addAttribute("type", type.value());
         if (show != null) {
             stanzaBuilder.startInnerElement("show").addText(show).endInnerElement();
         }



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


Mime
View raw message