Merge pull request #67 from AttorneyOnline/tsulike-antispam
Use per-area antispam rather than per-client, allow for multiple subsequent blankposts
This commit is contained in:
commit
74f171f139
@ -53,7 +53,7 @@ class AOClient : public QObject {
|
||||
AOClient(Server* p_server, QTcpSocket* p_socket, QObject* parent = nullptr, int user_id = 0)
|
||||
: QObject(parent), id(user_id), remote_ip(p_socket->peerAddress()), password(""),
|
||||
joined(false), current_area(0), current_char(""), socket(p_socket), server(p_server),
|
||||
is_partial(false), last_wtce_time(0), last_message("") {};
|
||||
is_partial(false), last_wtce_time(0) {};
|
||||
|
||||
/**
|
||||
* @brief Destructor for the AOClient instance.
|
||||
|
@ -433,15 +433,15 @@ AOPacket AOClient::validateIcPacket(AOPacket packet)
|
||||
|
||||
// message text
|
||||
QString incoming_msg = dezalgo(incoming_args[4].toString().trimmed());
|
||||
if (incoming_msg == last_message)
|
||||
if (!area->last_ic_message.isEmpty()
|
||||
&& incoming_msg == area->last_ic_message[4]
|
||||
&& incoming_msg != "")
|
||||
return invalid;
|
||||
|
||||
if (incoming_msg == "" && area->blankposting_allowed == false) {
|
||||
sendServerMessage("Blankposting has been forbidden in this area.");
|
||||
return invalid;
|
||||
}
|
||||
|
||||
last_message = incoming_msg;
|
||||
args.append(incoming_msg);
|
||||
|
||||
// side
|
||||
|
Loading…
Reference in New Issue
Block a user