kestasjk/webDiplomacy — pull request #38 by TimothyJones (2014-07-30 13:46:49+00:00)
Title: No pm send while silenced

At JMO's request, here are some code changes to prevent users sending a PM while they are silenced.

##### New functionality

When a silenced user tries to send a PM, the PM will not send, and instead of seeing "Message sent successfully" they see "Private message could not be sent. You may be silenced or muted.". They also get a notice in their notices feed saying "Could not deliver message, you are currently silenced".

This behaviour is pretty much the same as what happens when the recipient has muted the sender.

##### Additional fixes

There are some small related fixes in this patch:

* The "Message sent successfully" sentence no longer appears when trying to send to a user who has muted you - you now get the same new error message.
* The admin CP would complain that there wasn't a reason for the silence when the reason was less than 10 characters. It now says that the reason needs to be more than 10 characters.
* The silencing error message now has an entry in the translation table.

There are no Italian translations this time - but all new and modified messages have entries in the translation table.

##### Test cases performed:

* normal user can send PM to normal user via profile PASS
* normal user can send PM to normal user via reply on notices page PASS
* normal user can send PM to silenced user via profile PASS
* normal user can send PM to silenced user via reply on notices page PASS
* Silenced user cannot send PM to normal user via profile PASS
* Silenced user cannot send PM to normal user via reply on notices page PASS
* Once un-silenced, previously silenced user can send PM to normal users via profile PASS
* Once un-silenced, previously silenced user can send PM to normal users via reply on notices page PASS