alter antispam to function more like tsu3

This commit is contained in:
in1tiate 2021-04-09 03:05:15 -05:00
parent 036c2907a1
commit a621ae6113
2 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ class AOClient : public QObject {
AOClient(Server* p_server, QTcpSocket* p_socket, QObject* parent = nullptr, int user_id = 0) 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(""), : QObject(parent), id(user_id), remote_ip(p_socket->peerAddress()), password(""),
joined(false), current_area(0), current_char(""), socket(p_socket), server(p_server), 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. * @brief Destructor for the AOClient instance.

View File

@ -433,15 +433,15 @@ AOPacket AOClient::validateIcPacket(AOPacket packet)
// message text // message text
QString incoming_msg = dezalgo(incoming_args[4].toString().trimmed()); 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; return invalid;
if (incoming_msg == "" && area->blankposting_allowed == false) { if (incoming_msg == "" && area->blankposting_allowed == false) {
sendServerMessage("Blankposting has been forbidden in this area."); sendServerMessage("Blankposting has been forbidden in this area.");
return invalid; return invalid;
} }
last_message = incoming_msg;
args.append(incoming_msg); args.append(incoming_msg);
// side // side