alter antispam to function more like tsu3
This commit is contained in:
parent
036c2907a1
commit
a621ae6113
@ -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.
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user