Some small changes
This commit is contained in:
@@ -3251,7 +3251,6 @@ CommandResult ConnectedClient::handleCommandSendTextMessage(Command &cmd) {
|
||||
target->notifyTextMessage(ChatMessageMode::TEXTMODE_PRIVATE, _this.lock(), target->getClientId(), 0, cmd["msg"].string());
|
||||
this->notifyTextMessage(ChatMessageMode::TEXTMODE_PRIVATE, _this.lock(), target->getClientId(), 0, cmd["msg"].string());
|
||||
} else if (cmd["targetmode"] == ChatMessageMode::TEXTMODE_CHANNEL) {
|
||||
CACHED_PERM_CHECK(permission::b_client_channel_textmessage_send, 1, false);
|
||||
if(!cmd[0].has("cid"))
|
||||
cmd["cid"] = 0;
|
||||
RESOLVE_CHANNEL_R(cmd["cid"], false);
|
||||
@@ -3265,6 +3264,13 @@ CommandResult ConnectedClient::handleCommandSendTextMessage(Command &cmd) {
|
||||
return CommandResult::Success;
|
||||
}
|
||||
|
||||
if(!this->permissionGranted(permission::PERMTEST_ORDERED, permission::b_client_channel_textmessage_send, 1, channel, false))
|
||||
return CommandResultPermissionError{permission::b_client_channel_textmessage_send};
|
||||
if(channel != this->currentChannel) {
|
||||
if(!this->calculate_and_get_join_state(channel))
|
||||
return CommandResultPermissionError{permission::unknown}; /* You're not allowed to send messages :) */
|
||||
}
|
||||
|
||||
auto message = cmd["msg"].string();
|
||||
auto _this = this->_this.lock();
|
||||
auto client_id = this->getClientId();
|
||||
@@ -3401,6 +3407,7 @@ CommandResult ConnectedClient::handleCommandFTGetFileList(Command &cmd) {
|
||||
this->sendCommand(fileListFinished);
|
||||
} else {
|
||||
this->sendCommand(fileList);
|
||||
this->sendCommand(fileListFinished);
|
||||
}
|
||||
return CommandResult::Success;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user