labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ber...@apache.org
Subject svn commit: r709557 - in /labs/vysper/src: main/java/org/apache/vysper/xmpp/modules/roster/handler/ main/java/org/apache/vysper/xmpp/resourcebinding/ test/java/org/apache/vysper/xmpp/resourcebinding/
Date Fri, 31 Oct 2008 20:25:58 GMT
Author: berndf
Date: Fri Oct 31 13:25:58 2008
New Revision: 709557

URL: http://svn.apache.org/viewvc?rev=709557&view=rev
Log:
[vysper] allow roster set for new entry, i.e. without subscribption

Removed:
    labs/vysper/src/main/java/org/apache/vysper/xmpp/resourcebinding/BindException.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/resourcebinding/ResourceRegistry.java
    labs/vysper/src/main/java/org/apache/vysper/xmpp/resourcebinding/ResourceState.java
    labs/vysper/src/test/java/org/apache/vysper/xmpp/resourcebinding/ResourceRegistryTestCase.java
Modified:
    labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/roster/handler/RosterIQHandler.java

Modified: labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/roster/handler/RosterIQHandler.java
URL: http://svn.apache.org/viewvc/labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/roster/handler/RosterIQHandler.java?rev=709557&r1=709556&r2=709557&view=diff
==============================================================================
--- labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/roster/handler/RosterIQHandler.java
(original)
+++ labs/vysper/src/main/java/org/apache/vysper/xmpp/modules/roster/handler/RosterIQHandler.java
Fri Oct 31 13:25:58 2008
@@ -171,7 +171,12 @@
         } /* else: all other subscription types are ignored in a roster set */
 
         if (existingItem == null) {
-            return ServerErrorResponses.getInstance().getStanzaError(StanzaErrorCondition.BAD_REQUEST,
stanza, StanzaErrorType.CANCEL, "roster item contact not (yet) in roster: " + setRosterItem.getJid().getBareJID(),
null, null);
+            existingItem = new RosterItem(user.getBareJID(), SubscriptionType.NONE);
+            try {
+                rosterManager.addContact(user.getBareJID(), existingItem);
+            } catch (RosterException e) {
+                return ServerErrorResponses.getInstance().getStanzaError(StanzaErrorCondition.BAD_REQUEST,
stanza, StanzaErrorType.CANCEL, "roster item contact not (yet) in roster: " + setRosterItem.getJid().getBareJID(),
null, null);
+            }
         }
 
         synchronized (existingItem) {



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


Mime
View raw message