Quotes in replies

main
Inga 🏳‍🌈 15 years ago
parent 387b9f2725
commit 00ab6640eb
  1. 2
      Builder/IISMainHandler/build.txt
  2. 11
      IISMainHandler/handlers/response/PMReplyToPostHandler.cs
  3. 11
      IISMainHandler/handlers/response/ReplyHandler.cs

@ -19,14 +19,23 @@ namespace FLocal.IISHandler.handlers.response {
} }
override protected XElement[] getSpecificData(WebContext context) { override protected XElement[] getSpecificData(WebContext context) {
Post post = Post.LoadById(int.Parse(context.requestParts[1])); Post post = Post.LoadById(int.Parse(context.requestParts[1]));
string quoted = context.httprequest.Form["data"];
if(quoted != null) quoted = quoted.Trim();
if(quoted == null || quoted == "") {
if(post.revision.HasValue) {
quoted = post.latestRevision.body.Trim();
}
}
return new XElement[] { return new XElement[] {
post.thread.board.exportToXml(context, false), post.thread.board.exportToXml(context, false),
post.thread.exportToXml(context, false), post.thread.exportToXml(context, false),
post.exportToXmlWithoutThread(context, false), post.exportToXmlWithoutThread(context, false),
new XElement("receiver", Account.LoadByUser(post.poster).exportToXml(context)), new XElement("receiver", Account.LoadByUser(post.poster).exportToXml(context)),
new XElement("quoted", context.httprequest.Form["data"]), new XElement("quoted", quoted),
}; };
} }
} }

@ -19,8 +19,17 @@ namespace FLocal.IISHandler.handlers.response {
} }
override protected XElement[] getSpecificData(WebContext context) { override protected XElement[] getSpecificData(WebContext context) {
Post post = Post.LoadById(int.Parse(context.requestParts[1])); Post post = Post.LoadById(int.Parse(context.requestParts[1]));
string quoted = context.httprequest.Form["data"];
if(quoted != null) quoted = quoted.Trim();
if(quoted == null || quoted == "") {
if(post.revision.HasValue) {
quoted = post.latestRevision.body.Trim();
}
}
return new XElement[] { return new XElement[] {
post.thread.board.exportToXml(context, false), post.thread.board.exportToXml(context, false),
post.thread.exportToXml(context, false), post.thread.exportToXml(context, false),
@ -28,7 +37,7 @@ namespace FLocal.IISHandler.handlers.response {
new XElement("layers", new XElement("layers",
from layer in PostLayer.allLayers select layer.exportToXml(context) from layer in PostLayer.allLayers select layer.exportToXml(context)
), ),
new XElement("quoted", context.httprequest.Form["data"]), new XElement("quoted", quoted),
}; };
} }
} }

Loading…
Cancel
Save