From 52f26baa2056e48690899972811a237ef851e648 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Fri, 3 Sep 2010 17:17:59 +0000 Subject: [PATCH] Moderators can punish their own posts --- Common/dataobjects/Post.cs | 4 +--- IISMainHandler/handlers/response/PunishHandler.cs | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Common/dataobjects/Post.cs b/Common/dataobjects/Post.cs index 2bd6a83..c5bd62c 100644 --- a/Common/dataobjects/Post.cs +++ b/Common/dataobjects/Post.cs @@ -368,8 +368,6 @@ namespace FLocal.Common.dataobjects { if(transferInfo.HasValue && !transferInfo.Value.newBoard.isTransferTarget) throw new FLocalException("You cannot transfer in '" + transferInfo.Value.newBoard.name + "'"); } - if(account.user.id == this.poster.id) throw new FLocalException("You cannot punish your own posts"); - lock(this.Punish_Locker) { lock(this.thread.locker) { @@ -561,7 +559,7 @@ namespace FLocal.Common.dataobjects { } catch(NotFoundInDBException) { } - if(posterAccount != null) { + if((posterAccount != null) && (posterAccount.id != account.id)) { PMMessage newMessage = PMConversation.SendPMMessage( account, posterAccount, diff --git a/IISMainHandler/handlers/response/PunishHandler.cs b/IISMainHandler/handlers/response/PunishHandler.cs index 284ce5c..5ff59ba 100644 --- a/IISMainHandler/handlers/response/PunishHandler.cs +++ b/IISMainHandler/handlers/response/PunishHandler.cs @@ -22,7 +22,6 @@ namespace FLocal.IISHandler.handlers.response { Post post = Post.LoadById(int.Parse(context.requestParts[1])); if(!Moderator.isModerator(context.account, post.thread)) throw new FLocalException(context.account.id + " is not a moderator in board " + post.thread.board.id); - if(context.account.user.id == post.poster.id) throw new FLocalException("You cannot punish your own posts"); return new XElement[] { post.thread.board.exportToXml(context, Board.SubboardsOptions.None),