mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-23 15:37:25 -08:00
Added server private message functionality to allow server based PM notifications.
Ban based notification to other online moderators is the first form implemented by this PR.
This commit is contained in:
@@ -262,6 +262,18 @@ void Server::removeClient(Server_ProtocolHandler *client)
|
||||
qDebug() << "Server::removeClient: removed" << (void *) client << ";" << clients.size() << "clients; " << users.size() << "users left";
|
||||
}
|
||||
|
||||
QList<QString> Server::getOnlineModeratorList()
|
||||
{
|
||||
QList<QString> results;
|
||||
QReadLocker clientsLocker(&clientsLock);
|
||||
for (int i = 0; i < clients.size(); ++i) {
|
||||
ServerInfo_User *data = clients[i]->getUserInfo();
|
||||
if (data->user_level() & ServerInfo_User::IsModerator || data->user_level() & ServerInfo_User::IsAdmin) //TODO: this line should be updated in the event there is any type of new user level created
|
||||
results << QString::fromStdString(data->name()).simplified();
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
void Server::externalUserJoined(const ServerInfo_User &userInfo)
|
||||
{
|
||||
// This function is always called from the main thread via signal/slot.
|
||||
@@ -617,4 +629,4 @@ void Server::sendIsl_RoomCommand(const CommandContainer &item, int serverId, qin
|
||||
cont->set_room_id(roomId);
|
||||
|
||||
emit sigSendIslMessage(msg, serverId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user