|
|
@ -221,7 +221,7 @@ namespace FLocal.Common.dataobjects { |
|
|
|
return new XElement("post", |
|
|
|
return new XElement("post", |
|
|
|
new XElement("id", this.id), |
|
|
|
new XElement("id", this.id), |
|
|
|
new XElement("poster", this.poster.exportToXmlForViewing(context)), |
|
|
|
new XElement("poster", this.poster.exportToXmlForViewing(context)), |
|
|
|
new XElement("bodyShort", context.isPostVisible(this) ? this.bodyShort : ""), |
|
|
|
new XElement("bodyShort", context.isPostVisible(this) == PostVisibilityEnum.VISIBLE ? this.bodyShort : ""), |
|
|
|
new XElement("title", this.title) |
|
|
|
new XElement("title", this.title) |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
@ -232,9 +232,19 @@ namespace FLocal.Common.dataobjects { |
|
|
|
|
|
|
|
|
|
|
|
public XElement exportToXml(UserContext context, params XElement[] additional) { |
|
|
|
public XElement exportToXml(UserContext context, params XElement[] additional) { |
|
|
|
|
|
|
|
|
|
|
|
if(!context.isPostVisible(this)) return null; |
|
|
|
XElement result = null; |
|
|
|
|
|
|
|
|
|
|
|
XElement result = new XElement("post", |
|
|
|
switch(context.isPostVisible(this)) { |
|
|
|
|
|
|
|
case PostVisibilityEnum.UNVISIBLE: |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
case PostVisibilityEnum.HIDDEN: |
|
|
|
|
|
|
|
result = new XElement("post", |
|
|
|
|
|
|
|
new XElement("hidden"), |
|
|
|
|
|
|
|
new XElement("id", this.id) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case PostVisibilityEnum.VISIBLE: |
|
|
|
|
|
|
|
result = new XElement("post", |
|
|
|
new XElement("id", this.id), |
|
|
|
new XElement("id", this.id), |
|
|
|
new XElement("poster", |
|
|
|
new XElement("poster", |
|
|
|
this.poster.exportToXmlForViewing( |
|
|
|
this.poster.exportToXmlForViewing( |
|
|
@ -268,6 +278,8 @@ namespace FLocal.Common.dataobjects { |
|
|
|
if(this.parentPostId.HasValue) { |
|
|
|
if(this.parentPostId.HasValue) { |
|
|
|
result.Add(new XElement("parentPost", this.parentPost.exportToXmlBase(context))); |
|
|
|
result.Add(new XElement("parentPost", this.parentPost.exportToXmlBase(context))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
if(additional.Length > 0) { |
|
|
|
if(additional.Length > 0) { |
|
|
|
result.Add(additional); |
|
|
|
result.Add(additional); |
|
|
|
} |
|
|
|
} |
|
|
|