diff --git a/retroshare-gui/src/gui/MessengerWindow.cpp b/retroshare-gui/src/gui/MessengerWindow.cpp index ca2a5530e..28db4a7ee 100644 --- a/retroshare-gui/src/gui/MessengerWindow.cpp +++ b/retroshare-gui/src/gui/MessengerWindow.cpp @@ -95,8 +95,8 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WindowFlags flags) ui.avatar->setOwnId(); connect(ui.messagelineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(savestatusmessage())); - connect(NotifyQt::getInstance(), SIGNAL(ownStatusMessageChanged()), this, SLOT(loadmystatusmessage())); + //connect(NotifyQt::getInstance(), SIGNAL(ownStatusMessageChanged()), this, SLOT(loadmystatusmessage())); //connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(updateOwnStatus(QString,int))); mEventHandlerId = 0; @@ -105,10 +105,17 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WindowFlags flags) RsQThreadUtils::postToObject([=](){ auto fe = dynamic_cast(e.get()); - if(!fe || fe->mEventCode != RsFriendListEventCode::NODE_STATUS_CHANGED) - return; + if(!fe) return; - updateOwnStatus(QString::fromStdString(fe->mSslId.toStdString()),fe->mStatus); + switch(fe->mEventCode) + { + case RsFriendListEventCode::NODE_STATUS_CHANGED: updateOwnStatus(QString::fromStdString(fe->mSslId.toStdString()),fe->mStatus); + break; + case RsFriendListEventCode::OWN_STATUS_CHANGED: loadmystatusmessage(); + break; + default: + break; + } }, this ); },mEventHandlerId,RsEventType::FRIEND_LIST); diff --git a/retroshare-gui/src/gui/common/AvatarWidget.cpp b/retroshare-gui/src/gui/common/AvatarWidget.cpp index afb4c883c..75ac697f5 100644 --- a/retroshare-gui/src/gui/common/AvatarWidget.cpp +++ b/retroshare-gui/src/gui/common/AvatarWidget.cpp @@ -49,8 +49,8 @@ AvatarWidget::AvatarWidget(QWidget *parent) : QLabel(parent), ui(new Ui::AvatarW setFrameType(NO_FRAME); /* connect signals */ - connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&))); - connect(NotifyQt::getInstance(), SIGNAL(ownAvatarChanged()), this, SLOT(updateOwnAvatar())); + //connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&))); + //connect(NotifyQt::getInstance(), SIGNAL(ownAvatarChanged()), this, SLOT(updateOwnAvatar())); mEventHandlerId = 0; @@ -61,7 +61,19 @@ AvatarWidget::AvatarWidget(QWidget *parent) : QLabel(parent), ui(new Ui::AvatarW const RsFriendListEvent *e = dynamic_cast(event.get()); if(!e) return; - updateStatus(QString::fromStdString(e->mSslId.toStdString()),e->mStatus); + + switch(e->mEventCode) + { + case RsFriendListEventCode::OWN_AVATAR_CHANGED: + case RsFriendListEventCode::NODE_AVATAR_CHANGED: updateAvatar(QString::fromStdString(e->mSslId.toStdString())); + break; + case RsFriendListEventCode::OWN_STATUS_CHANGED: + case RsFriendListEventCode::NODE_STATUS_CHANGED: updateStatus(QString::fromStdString(e->mSslId.toStdString()),e->mStatus); + default: + break; + } + + }, this ); }, mEventHandlerId, RsEventType::FRIEND_LIST ); diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index e2b920ec1..94381859c 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -203,7 +203,7 @@ NewFriendList::NewFriendList(QWidget */*parent*/) : /* RsAutoUpdatePage(5000,par rsEvents->registerEventsHandler( [this](std::shared_ptr e) { handleEvent(e); }, mEventHandlerId_peer, RsEventType::FRIEND_LIST ); rsEvents->registerEventsHandler( [this](std::shared_ptr e) { handleEvent(e); }, mEventHandlerId_gssp, RsEventType::GOSSIP_DISCOVERY ); - connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(QString)), this, SLOT(forceUpdateDisplay())); +// connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(QString)), this, SLOT(forceUpdateDisplay())); // connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(forceUpdateDisplay())); mModel = new RsFriendListModel(ui->peerTreeWidget); diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp index aa0da0b12..3c415b115 100644 --- a/retroshare-gui/src/gui/notifyqt.cpp +++ b/retroshare-gui/src/gui/notifyqt.cpp @@ -133,6 +133,7 @@ void NotifyQt::notifyChatMessage(const ChatMessage &msg) emit chatMessageReceived(msg); } +#ifdef TO_REMOVE void NotifyQt::notifyOwnAvatarChanged() { { @@ -146,6 +147,7 @@ void NotifyQt::notifyOwnAvatarChanged() #endif emit ownAvatarChanged() ; } +#endif class SignatureEventData { @@ -365,7 +367,6 @@ void NotifyQt::notifyPeerStatusChangedSummary() emit peerStatusChangedSummary(); } -#endif void NotifyQt::notifyOwnStatusMessageChanged() { @@ -393,6 +394,7 @@ void NotifyQt::notifyPeerHasNewAvatar(std::string peer_id) #endif emit peerHasNewAvatar(QString::fromStdString(peer_id)) ; } +#endif void NotifyQt::notifyCustomState(const std::string& peer_id, const std::string& status_string) { diff --git a/retroshare-gui/src/gui/notifyqt.h b/retroshare-gui/src/gui/notifyqt.h index fd3d51e7f..c2c2a831a 100644 --- a/retroshare-gui/src/gui/notifyqt.h +++ b/retroshare-gui/src/gui/notifyqt.h @@ -71,12 +71,12 @@ class NotifyQt: public QObject, public NotifyClient // virtual void notifyTurtleSearchResult(const RsPeerId &pid, uint32_t search_id, const std::list& found_files); //#endif // virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list& found_groups); - virtual void notifyPeerHasNewAvatar(std::string peer_id) ; - virtual void notifyOwnAvatarChanged() ; -// virtual void notifyChatLobbyEvent(uint64_t /* lobby id */, uint32_t /* event type */, const RsGxsId & /*nickname*/, const std::string& /* any string */) ; +// virtual void notifyPeerHasNewAvatar(std::string peer_id) ; +// virtual void notifyOwnAvatarChanged() ; +// virtual void notifyChatLobbyEvent(uint64_t /* lobby id */, uint32_t /* event type */, const RsGxsId & /*nickname*/, const std::string& /* any string */) ; // virtual void notifyChatLobbyTimeShift(int time_shift) ; - virtual void notifyOwnStatusMessageChanged() ; +// virtual void notifyOwnStatusMessageChanged() ; // virtual void notifyDiskFull(uint32_t loc,uint32_t size_in_mb) ; /* peer has changed the state */ // virtual void notifyPeerStatusChanged(const std::string& peer_id, uint32_t state); @@ -117,9 +117,9 @@ class NotifyQt: public QObject, public NotifyClient void chatStatusChanged(const ChatId&,const QString&) const ; void chatCleared(const ChatId&) const ; void peerHasNewCustomStateString(const QString& /* peer_id */, const QString& /* status_string */) const ; - void peerHasNewAvatar(const QString& peer_id) const ; - void ownAvatarChanged() const ; - void ownStatusMessageChanged() const ; +// void peerHasNewAvatar(const QString& peer_id) const ; +// void ownAvatarChanged() const ; +// void ownStatusMessageChanged() const ; void errorOccurred(int,int,const QString&) const ; void diskFull(int,int) const ; // void peerStatusChanged(const QString& /* peer_id */, int /* status */); diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index 71daf5271..9a30fb464 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -734,7 +734,7 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO); // QObject::connect(notify,SIGNAL(neighboursChanged()) ,w->friendsDialog->networkDialog ,SLOT(securedUpdateDisplay())) ; QObject::connect(notify,SIGNAL(chatStatusChanged(const QString&,const QString&,bool)),w->friendsDialog,SLOT(updatePeerStatusString(const QString&,const QString&,bool))); - QObject::connect(notify,SIGNAL(ownStatusMessageChanged()),w->friendsDialog,SLOT(loadmypersonalstatus())); +// QObject::connect(notify,SIGNAL(ownStatusMessageChanged()),w->friendsDialog,SLOT(loadmypersonalstatus())); // QObject::connect(notify,SIGNAL(logInfoChanged(const QString&)) ,w->friendsDialog->networkDialog,SLOT(setLogInfo(QString))) ; QObject::connect(notify,SIGNAL(discInfoChanged()) ,w->friendsDialog->networkView,SLOT(update()),Qt::QueuedConnection) ;