r7235 - dumbhippo/trunk/openfire/src/plugins/hippo/src/java/com/dumbhippo/jive



Author: otaylor
Date: 2008-01-17 22:50:58 -0600 (Thu, 17 Jan 2008)
New Revision: 7235

Modified:
   dumbhippo/trunk/openfire/src/plugins/hippo/src/java/com/dumbhippo/jive/XmppFetchVisitor.java
Log:
Fix a problem where we sometimes missed sending the defaultChildren for a feed property

Modified: dumbhippo/trunk/openfire/src/plugins/hippo/src/java/com/dumbhippo/jive/XmppFetchVisitor.java
===================================================================
--- dumbhippo/trunk/openfire/src/plugins/hippo/src/java/com/dumbhippo/jive/XmppFetchVisitor.java	2008-01-18 02:30:36 UTC (rev 7234)
+++ dumbhippo/trunk/openfire/src/plugins/hippo/src/java/com/dumbhippo/jive/XmppFetchVisitor.java	2008-01-18 04:50:58 UTC (rev 7235)
@@ -84,10 +84,18 @@
 	
 	private Element addPropertyElement(DMPropertyHolder propertyHolder, boolean incremental) {
 		Element element = currentResourceElement.addElement(createQName(propertyHolder.getName(), propertyHolder.getNameSpace()));
+		boolean seen = seenProperties.contains(propertyHolder);
 		
-		if (incremental || seenProperties.contains(propertyHolder)) {
+		if (incremental || seen) {
 			element.addAttribute(UPDATE_QNAME, "add");
-		} else {
+		} 
+		
+		if (!seen) {
+			// In the 'incremental' case, where we are sending additional feed items, we already
+			// sent the type with the initial 'clear', but we may not have sent the default children
+			// yet. For simplicity, we just send both for the first time we reference a property
+			// within a single resource.
+			
 			element.addAttribute(TYPE_QNAME, propertyHolder.getTypeString());
 			if (propertyHolder.getDefaultInclude()) {
 				String defaultChildren = propertyHolder.getDefaultChildrenString();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]