History

add canKick to USI, revert constants to production

Stephen Birarda committed 10 years ago

Commit 4cdc9821 parent 39e6ac04 files · +26 −0Browse files

Showing the changes to libraries/script-engine/src/UsersScriptingInterface.cpp (1 of 4 files). Show all

Unified · Split

libraries/script-engine/src/UsersScriptingInterface.cpp+11−0
@@ -13,6 +13,12 @@ · 12 unmodified lines
13 13
14#include <NodeList.h>14#include <NodeList.h>
15 15
16UsersScriptingInterface::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
16void UsersScriptingInterface::ignore(const QUuid& nodeID) {22void 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 ID28 // 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
32bool UsersScriptingInterface::getCanKick() {
33 // ask the NodeList to return our ability to kick
34 return DependencyManager::get<NodeList>()->getThisNodeCanKick();
35}