diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 337488c..03c4ecb 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -1042 \ No newline at end of file +1044 \ No newline at end of file diff --git a/Common/dataobjects/Post.cs b/Common/dataobjects/Post.cs index c5bd62c..88ed8ad 100644 --- a/Common/dataobjects/Post.cs +++ b/Common/dataobjects/Post.cs @@ -559,7 +559,7 @@ namespace FLocal.Common.dataobjects { } catch(NotFoundInDBException) { } - if((posterAccount != null) && (posterAccount.id != account.id)) { + if((posterAccount != null) && (posterAccount.id != account.id) && !posterAccount.needsMigration) { PMMessage newMessage = PMConversation.SendPMMessage( account, posterAccount, diff --git a/IISMainHandler/handlers/request/SendPMHandler.cs b/IISMainHandler/handlers/request/SendPMHandler.cs index 4205e4b..4cb8a65 100644 --- a/IISMainHandler/handlers/request/SendPMHandler.cs +++ b/IISMainHandler/handlers/request/SendPMHandler.cs @@ -24,6 +24,9 @@ namespace FLocal.IISHandler.handlers.request { } else { throw new ApplicationException("receiverId/receiverName not passed"); } + + if(receiver.needsMigration) throw new ApplicationException("User is not migrated"); + PMMessage newMessage = PMConversation.SendPMMessage( context.account, receiver, diff --git a/IISMainHandler/handlers/response/PMReplyToPostHandler.cs b/IISMainHandler/handlers/response/PMReplyToPostHandler.cs index 4441b18..648d67a 100644 --- a/IISMainHandler/handlers/response/PMReplyToPostHandler.cs +++ b/IISMainHandler/handlers/response/PMReplyToPostHandler.cs @@ -21,6 +21,8 @@ namespace FLocal.IISHandler.handlers.response { override protected IEnumerable getSpecificNewMessageData(WebContext context) { Post post = Post.LoadById(int.Parse(context.requestParts[1])); + Account receiver = Account.LoadByUser(post.poster); + if(receiver.needsMigration) throw new ApplicationException("User is not migrated"); string quoted = context.httprequest.Form["data"]; if(quoted != null) quoted = quoted.Trim(); @@ -34,7 +36,7 @@ namespace FLocal.IISHandler.handlers.response { post.thread.board.exportToXml(context, Board.SubboardsOptions.None), post.thread.exportToXml(context), post.exportToXml(context), - new XElement("receiver", Account.LoadByUser(post.poster).exportToXml(context)), + new XElement("receiver", receiver.exportToXml(context)), new XElement("quoted", quoted), }; } diff --git a/IISMainHandler/handlers/response/PMSendHandler.cs b/IISMainHandler/handlers/response/PMSendHandler.cs index a1d2b60..5ceb8e1 100644 --- a/IISMainHandler/handlers/response/PMSendHandler.cs +++ b/IISMainHandler/handlers/response/PMSendHandler.cs @@ -20,9 +20,10 @@ namespace FLocal.IISHandler.handlers.response { override protected IEnumerable getSpecificNewMessageData(WebContext context) { if(context.requestParts.Length > 1) { - Account account = Account.LoadById(int.Parse(context.requestParts[1])); + Account receiver = Account.LoadById(int.Parse(context.requestParts[1])); + if(receiver.needsMigration) throw new ApplicationException("User is not migrated"); return new XElement[] { - new XElement("receiver", account.exportToXml(context)), + new XElement("receiver", receiver.exportToXml(context)), }; } return new XElement[0];