Showing the changes to libraries/script-engine/src/UsersScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -13,6 +13,12 @@ · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | #include <NodeList.h> | 14 | #include <NodeList.h> |
| 15 | 15 | ||
| 16 | UsersScriptingInterface::UsersScriptingInterface() { | ||
| 17 | // emit a signal when kick permissions have changed | ||
| 18 | auto nodeList = DependencyManager::get<NodeList>(); | ||
| 19 | connect(nodeList.data(), &LimitedNodeList::canKickChanged, this, &UsersScriptingInterface::canKickChanged); | ||
| 20 | } | ||
| 21 | |||
| 16 | void UsersScriptingInterface::ignore(const QUuid& nodeID) { | 22 | void UsersScriptingInterface::ignore(const QUuid& nodeID) { |
| 17 | // ask the NodeList to ignore this user (based on the session ID of their node) | 23 | // ask the NodeList to ignore this user (based on the session ID of their node) |
| 18 | DependencyManager::get<NodeList>()->ignoreNodeBySessionID(nodeID); | 24 | DependencyManager::get<NodeList>()->ignoreNodeBySessionID(nodeID); |
| @@ -22,3 +28,8 @@ void UsersScriptingInterface::kick(const QUuid& nodeID) { · 3 unmodified lines | |||
| 22 | // ask the NodeList to kick the user with the given session ID | 28 | // ask the NodeList to kick the user with the given session ID |
| 23 | DependencyManager::get<NodeList>()->kickNodeBySessionID(nodeID); | 29 | DependencyManager::get<NodeList>()->kickNodeBySessionID(nodeID); |
| 24 | } | 30 | } |
| 31 | |||
| 32 | bool UsersScriptingInterface::getCanKick() { | ||
| 33 | // ask the NodeList to return our ability to kick | ||
| 34 | return DependencyManager::get<NodeList>()->getThisNodeCanKick(); | ||
| 35 | } | ||