A lot of music updates
This commit is contained in:
@@ -225,6 +225,8 @@ command_result ConnectedClient::handleCommand(Command &cmd) {
|
||||
else if (command == "playlistlist") return this->handleCommandPlaylistList(cmd);
|
||||
else if (command == "playlistcreate") return this->handleCommandPlaylistCreate(cmd);
|
||||
else if (command == "playlistdelete") return this->handleCommandPlaylistDelete(cmd);
|
||||
else if (command == "playlistsetsubscription") return this->handleCommandPlaylistSetSubscription(cmd);
|
||||
|
||||
else if (command == "playlistpermlist") return this->handleCommandPlaylistPermList(cmd);
|
||||
else if (command == "playlistaddperm") return this->handleCommandPlaylistAddPerm(cmd);
|
||||
else if (command == "playlistdelperm") return this->handleCommandPlaylistDelPerm(cmd);
|
||||
@@ -235,6 +237,7 @@ command_result ConnectedClient::handleCommand(Command &cmd) {
|
||||
else if (command == "playlistedit") return this->handleCommandPlaylistEdit(cmd);
|
||||
|
||||
else if (command == "playlistsonglist") return this->handleCommandPlaylistSongList(cmd);
|
||||
else if (command == "playlistsongsetcurrent") return this->handleCommandPlaylistSongSetCurrent(cmd);
|
||||
else if (command == "playlistsongadd") return this->handleCommandPlaylistSongAdd(cmd);
|
||||
else if (command == "playlistsongreorder" || command == "playlistsongmove") return this->handleCommandPlaylistSongReorder(cmd);
|
||||
else if (command == "playlistsongremove") return this->handleCommandPlaylistSongRemove(cmd);
|
||||
@@ -557,40 +560,7 @@ command_result ConnectedClient::handleCommandSendTextMessage(Command &cmd) {
|
||||
return command_result{permission::b_client_channel_textmessage_send}; /* You're not allowed to send messages :) */
|
||||
}
|
||||
|
||||
auto message = cmd["msg"].string();
|
||||
auto _this = this->_this.lock();
|
||||
auto client_id = this->getClientId();
|
||||
|
||||
auto flag_password = channel->properties()[property::CHANNEL_FLAG_PASSWORD].as<bool>();
|
||||
for(const auto& client : this->server->getClients()) {
|
||||
if(client->connectionState() != ConnectionState::CONNECTED)
|
||||
continue;
|
||||
|
||||
auto type = client->getType();
|
||||
if(type == ClientType::CLIENT_INTERNAL || type == ClientType::CLIENT_MUSIC)
|
||||
continue;
|
||||
|
||||
auto own_channel = client->currentChannel == this->currentChannel;
|
||||
if(conversation_private && !own_channel)
|
||||
continue;
|
||||
|
||||
if(type != ClientType::CLIENT_TEAMSPEAK || own_channel) {
|
||||
if(!own_channel && &*client != this) {
|
||||
if(flag_password)
|
||||
continue; /* TODO: Send notification about new message. The client then could request messages via message history */
|
||||
|
||||
if(!client->calculate_and_get_join_state(channel))
|
||||
continue;
|
||||
}
|
||||
client->notifyTextMessage(ChatMessageMode::TEXTMODE_CHANNEL, _this, client_id, channel_id, timestamp, message);
|
||||
}
|
||||
}
|
||||
|
||||
if(!conversation_private) {
|
||||
auto conversations = this->server->conversation_manager();
|
||||
auto conversation = conversations->get_or_create(channel->channelId());
|
||||
conversation->register_message(this->getClientDatabaseId(), this->getUid(), this->getDisplayName(), timestamp, cmd["msg"].string());
|
||||
}
|
||||
this->server->send_text_message(channel, this->ref(), cmd["msg"].string());
|
||||
} else if (cmd["targetmode"] == ChatMessageMode::TEXTMODE_SERVER) {
|
||||
ACTION_REQUIRES_GLOBAL_PERMISSION(permission::b_client_server_textmessage_send, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user