diff --git a/libretroshare/src/tests/network_simulator/gui/NetworkViewer.cpp b/libretroshare/src/tests/network_simulator/gui/NetworkViewer.cpp index 64797c991..dede5caa8 100644 --- a/libretroshare/src/tests/network_simulator/gui/NetworkViewer.cpp +++ b/libretroshare/src/tests/network_simulator/gui/NetworkViewer.cpp @@ -564,6 +564,23 @@ void NetworkViewer::contextMenu(QPoint p) contextMnu.addAction(action_ProvideGRKey); + std::set provided_keys ; + + for(uint32_t i=0;i<_network.n_nodes();++i) + if(i != _current_acted_node) + provided_keys.insert( _network.node(i).providedGRKeys().begin(), _network.node(i).providedGRKeys().end()) ; + + if(!provided_keys.empty()) + { + QMenu *Mnu2 = contextMnu.addMenu("Send message to Key") ; + + for(std::set::const_iterator it(provided_keys.begin());it!=provided_keys.end();++it) + { + QAction* send_message_action = new QAction(QString::fromStdString((*it).toStdString()), Mnu2); + connect(send_message_action, SIGNAL(triggered()), this, SLOT(actionSendToGRKey())); + Mnu2->addAction(send_message_action); + } + } // Execute! contextMnu.exec(mapToGlobal(p)); diff --git a/libretroshare/src/tests/network_simulator/nscore/PeerNode.cpp b/libretroshare/src/tests/network_simulator/nscore/PeerNode.cpp index 623345cde..a2249d5bb 100644 --- a/libretroshare/src/tests/network_simulator/nscore/PeerNode.cpp +++ b/libretroshare/src/tests/network_simulator/nscore/PeerNode.cpp @@ -22,7 +22,12 @@ PeerNode::PeerNode(const RsPeerId& id,const std::list& friends) ctrl->updateServicePermissions(RS_SERVICE_TYPE_TURTLE,perms) ; - // Turtle business + perms.mDefaultAllowed = true ; + perms.mServiceId = RS_SERVICE_TYPE_GROUTER ; + + ctrl->updateServicePermissions(RS_SERVICE_TYPE_GROUTER,perms) ; + + // Turtle business _service_server->addService(_turtle = new p3turtle(ctrl,link_mgr),true) ; _turtle_client = new MonitoredTurtleClient ; @@ -73,7 +78,8 @@ void PeerNode::sendToGRKey(const GRouterKeyId& key_id) } void PeerNode::provideGRKey(const GRouterKeyId& key_id) { - _grouter_client->provideKey(key_id) ; + _grouter_client->provideKey(key_id) ; + _provided_keys.insert(key_id); } void PeerNode::getTrafficInfo(NodeTrafficInfo& info) {