Alert on PM creation for account that needs migration

main
Inga 🏳‍🌈 14 years ago
parent 52f26baa20
commit 8cb8d49b2d
  1. 2
      Builder/IISMainHandler/build.txt
  2. 2
      Common/dataobjects/Post.cs
  3. 3
      IISMainHandler/handlers/request/SendPMHandler.cs
  4. 4
      IISMainHandler/handlers/response/PMReplyToPostHandler.cs
  5. 5
      IISMainHandler/handlers/response/PMSendHandler.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,

@ -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,

@ -21,6 +21,8 @@ namespace FLocal.IISHandler.handlers.response {
override protected IEnumerable<XElement> 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),
};
}

@ -20,9 +20,10 @@ namespace FLocal.IISHandler.handlers.response {
override protected IEnumerable<XElement> 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];

Loading…
Cancel
Save