Some small changes
This commit is contained in:
parent
e38199e6c7
commit
dcd55275b5
@ -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 {
|
||||
|
2
shared
2
shared
@ -1 +1 @@
|
||||
Subproject commit 9f2181c18b4579de2957347c3b788f81a4de987a
|
||||
Subproject commit 290b915074eb27e33901a0a7bd6808220a6e60eb
|
Loading…
Reference in New Issue
Block a user