mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-30 19:15:08 +01:00
Send data to clients only if they are authenticated.
This commit is contained in:
parent
8251b53411
commit
53813ae04c
@ -125,6 +125,10 @@ void OutgoingDataCreator::SendAllPlaylists() {
|
||||
}
|
||||
|
||||
void OutgoingDataCreator::ActiveChanged(Playlist* playlist) {
|
||||
// Send the tracks of the active playlist
|
||||
SendPlaylistSongs(playlist->id());
|
||||
|
||||
// Send the changed message after sending the playlist songs
|
||||
pb::remote::Message msg;
|
||||
msg.set_type(pb::remote::ACTIVE_PLAYLIST_CHANGED);
|
||||
msg.mutable_response_active_changed()->set_id(playlist->id());
|
||||
|
@ -131,6 +131,7 @@ void RemoteClient::DisconnectClient(pb::remote::ReasonDisconnect reason) {
|
||||
}
|
||||
|
||||
void RemoteClient::SendData(pb::remote::Message *msg) {
|
||||
if (authenticated_) {
|
||||
// Serialize the message
|
||||
std::string data = msg->SerializeAsString();
|
||||
|
||||
@ -146,6 +147,7 @@ void RemoteClient::SendData(pb::remote::Message *msg) {
|
||||
} else {
|
||||
client_->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QAbstractSocket::SocketState RemoteClient::State() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user