Added numer of currently logged in users
This commit is contained in:
@@ -27,7 +27,7 @@ void Broadcast::connect(Client *client, const std::function<void ()> &fct) {
|
||||
auto userlistBroadcast = createUserList();
|
||||
auto newUserBroadcast = Wt::Json::Object{
|
||||
{"type", "newuser"},
|
||||
{"data", client->json()}
|
||||
{"data", client->json()},
|
||||
};
|
||||
for (auto &connection: connections_) {
|
||||
connection->addBroadcast(userlistBroadcast);
|
||||
@@ -455,6 +455,7 @@ Wt::Json::Object Broadcast::createUserList() {
|
||||
Wt::Json::Object data;
|
||||
data["data"] = userList;
|
||||
data["type"] = "userlist";
|
||||
data["count"] = (int)userList.size();
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user