Moderators can punish their own posts

main
Inga 🏳‍🌈 14 years ago
parent 00dd5628ba
commit 52f26baa20
  1. 4
      Common/dataobjects/Post.cs
  2. 1
      IISMainHandler/handlers/response/PunishHandler.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(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.Punish_Locker) {
lock(this.thread.locker) { lock(this.thread.locker) {
@ -561,7 +559,7 @@ namespace FLocal.Common.dataobjects {
} catch(NotFoundInDBException) { } catch(NotFoundInDBException) {
} }
if(posterAccount != null) { if((posterAccount != null) && (posterAccount.id != account.id)) {
PMMessage newMessage = PMConversation.SendPMMessage( PMMessage newMessage = PMConversation.SendPMMessage(
account, account,
posterAccount, posterAccount,

@ -22,7 +22,6 @@ namespace FLocal.IISHandler.handlers.response {
Post post = Post.LoadById(int.Parse(context.requestParts[1])); 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(!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[] { return new XElement[] {
post.thread.board.exportToXml(context, Board.SubboardsOptions.None), post.thread.board.exportToXml(context, Board.SubboardsOptions.None),

Loading…
Cancel
Save