moved more peer connection notifications to rsEvents

This commit is contained in:
csoler 2019-12-07 21:43:28 +01:00
parent 9790b98605
commit f118b4656e
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
5 changed files with 57 additions and 35 deletions

View file

@ -473,30 +473,20 @@ void p3LinkMgrIMPL::tickMonitors()
#endif
/* notify GUI */
if (peer.actions & RS_PEER_CONNECTED)
{
p3Notify *notify = RsServer::notify();
if (notify)
{
auto e = std::make_shared<RsConnectionEvent>() ;
e->mConnectionType = RsConnectionEvent::PEER_CONNECTED;
e->mSslId = peer.id;
rsEvents->postEvent(e);
// normally these this below should disappear: there's no notion of popup in libretroshare.
// all GUI-type display features should be chosen in NotifyQt.
notify->AddPopupMessage(RS_POPUP_CONNECT, peer.id.toStdString(),"", "Online: ");
}
}
if (peer.actions & RS_PEER_DISCONNECTED)
if (rsEvents && (peer.actions & RS_PEER_CONNECTED))
{
auto e = std::make_shared<RsConnectionEvent>() ;
e->mConnectionType = RsConnectionEvent::PEER_DISCONNECTED;
e->mConnectionInfoCode = RsConnectionEvent::PEER_CONNECTED;
e->mSslId = peer.id;
rsEvents->postEvent(e);
}
if (rsEvents && (peer.actions & RS_PEER_DISCONNECTED))
{
auto e = std::make_shared<RsConnectionEvent>() ;
e->mConnectionInfoCode = RsConnectionEvent::PEER_DISCONNECTED;
e->mSslId = peer.id;
rsEvents->postEvent(e);