From 00ab6640ebeb4b48759841db3e0e047d693957f7 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Mon, 12 Jul 2010 14:16:34 +0000 Subject: [PATCH] Quotes in replies --- Builder/IISMainHandler/build.txt | 2 +- .../handlers/response/PMReplyToPostHandler.cs | 11 ++++++++++- IISMainHandler/handlers/response/ReplyHandler.cs | 11 ++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 35d2965..a5a504b 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -791 \ No newline at end of file +799 \ No newline at end of file diff --git a/IISMainHandler/handlers/response/PMReplyToPostHandler.cs b/IISMainHandler/handlers/response/PMReplyToPostHandler.cs index 2654e3b..ca8a865 100644 --- a/IISMainHandler/handlers/response/PMReplyToPostHandler.cs +++ b/IISMainHandler/handlers/response/PMReplyToPostHandler.cs @@ -19,14 +19,23 @@ namespace FLocal.IISHandler.handlers.response { } override protected XElement[] getSpecificData(WebContext context) { + 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[] { post.thread.board.exportToXml(context, false), post.thread.exportToXml(context, false), post.exportToXmlWithoutThread(context, false), new XElement("receiver", Account.LoadByUser(post.poster).exportToXml(context)), - new XElement("quoted", context.httprequest.Form["data"]), + new XElement("quoted", quoted), }; } } diff --git a/IISMainHandler/handlers/response/ReplyHandler.cs b/IISMainHandler/handlers/response/ReplyHandler.cs index fdbd8d8..61972dc 100644 --- a/IISMainHandler/handlers/response/ReplyHandler.cs +++ b/IISMainHandler/handlers/response/ReplyHandler.cs @@ -19,8 +19,17 @@ namespace FLocal.IISHandler.handlers.response { } override protected XElement[] getSpecificData(WebContext context) { + 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[] { post.thread.board.exportToXml(context, false), post.thread.exportToXml(context, false), @@ -28,7 +37,7 @@ namespace FLocal.IISHandler.handlers.response { new XElement("layers", from layer in PostLayer.allLayers select layer.exportToXml(context) ), - new XElement("quoted", context.httprequest.Form["data"]), + new XElement("quoted", quoted), }; } }