remove node when one leaves
diff --git a/chatdialog.cpp b/chatdialog.cpp
index 322c947..58bdd90 100644
--- a/chatdialog.cpp
+++ b/chatdialog.cpp
@@ -85,6 +85,7 @@
{
if (m_sock != NULL)
{
+ m_sock->remove(m_user.getPrefix().toStdString());
delete m_sock;
m_sock = NULL;
}
@@ -261,6 +262,14 @@
void
ChatDialog::processRemove(std::string prefix)
{
+#ifdef __DEBUG
+ std::cout << "<<< remove node for prefix" << prefix << std::endl;
+#endif
+ bool removed = m_scene->removeNode(QString(prefix.c_str()));
+ if (removed)
+ {
+ m_scene->plot(m_sock->getRootDigest().c_str());
+ }
}
void