Some small changes

This commit is contained in:
WolverinDEV 2019-07-28 18:30:40 +02:00
parent e38199e6c7
commit dcd55275b5
2 changed files with 9 additions and 2 deletions

View File

@ -3251,7 +3251,6 @@ CommandResult ConnectedClient::handleCommandSendTextMessage(Command &cmd) {
target->notifyTextMessage(ChatMessageMode::TEXTMODE_PRIVATE, _this.lock(), target->getClientId(), 0, cmd["msg"].string()); 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()); this->notifyTextMessage(ChatMessageMode::TEXTMODE_PRIVATE, _this.lock(), target->getClientId(), 0, cmd["msg"].string());
} else if (cmd["targetmode"] == ChatMessageMode::TEXTMODE_CHANNEL) { } else if (cmd["targetmode"] == ChatMessageMode::TEXTMODE_CHANNEL) {
CACHED_PERM_CHECK(permission::b_client_channel_textmessage_send, 1, false);
if(!cmd[0].has("cid")) if(!cmd[0].has("cid"))
cmd["cid"] = 0; cmd["cid"] = 0;
RESOLVE_CHANNEL_R(cmd["cid"], false); RESOLVE_CHANNEL_R(cmd["cid"], false);
@ -3265,6 +3264,13 @@ CommandResult ConnectedClient::handleCommandSendTextMessage(Command &cmd) {
return CommandResult::Success; 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 message = cmd["msg"].string();
auto _this = this->_this.lock(); auto _this = this->_this.lock();
auto client_id = this->getClientId(); auto client_id = this->getClientId();
@ -3401,6 +3407,7 @@ CommandResult ConnectedClient::handleCommandFTGetFileList(Command &cmd) {
this->sendCommand(fileListFinished); this->sendCommand(fileListFinished);
} else { } else {
this->sendCommand(fileList); this->sendCommand(fileList);
this->sendCommand(fileListFinished);
} }
return CommandResult::Success; return CommandResult::Success;
} else { } else {

2
shared

@ -1 +1 @@
Subproject commit 9f2181c18b4579de2957347c3b788f81a4de987a Subproject commit 290b915074eb27e33901a0a7bd6808220a6e60eb