diff --git a/libretroshare/src/services/p3chatservice.cc b/libretroshare/src/services/p3chatservice.cc index db228e7f0..51395267f 100644 --- a/libretroshare/src/services/p3chatservice.cc +++ b/libretroshare/src/services/p3chatservice.cc @@ -2932,7 +2932,7 @@ void p3ChatService::addVirtualPeer(const TurtleFileHash& hash,const TurtleVirtua } rsicontrol->getNotify().notifyChatStatus(hash,"tunnel is up again!",true) ; - rsicontrol->getNotify().notifyPeerStatusChanged(hash,RS_STATUS_ONLINE) ; + //rsicontrol->getNotify().notifyPeerStatusChanged(hash,RS_STATUS_ONLINE) ; } void p3ChatService::removeVirtualPeer(const TurtleFileHash& hash,const TurtleVirtualPeerId& virtual_peer_id) @@ -3053,6 +3053,8 @@ void p3ChatService::receiveTurtleData( RsTurtleGenericTunnelItem *gitem,const st // Setup the virtual peer to be the origin, and pass it on. // citem->PeerId(hash) ; + //rsicontrol->getNotify().notifyPeerStatusChanged(hash,RS_STATUS_ONLINE) ; + handleIncomingItem(citem) ; // Treats the item, and deletes it } diff --git a/retroshare-gui/src/gui/chat/ChatDialog.cpp b/retroshare-gui/src/gui/chat/ChatDialog.cpp index ec23b79ab..a4c82b7a1 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatDialog.cpp @@ -306,7 +306,12 @@ bool ChatDialog::hasNewMessages() return false; } - +void ChatDialog::setPeerStatus(uint32_t status) +{ + ChatWidget *cw = getChatWidget(); + if (cw) + cw->updateStatus(QString::fromStdString(getPeerId()), status); +} int ChatDialog::getPeerStatus() { ChatWidget *cw = getChatWidget(); diff --git a/retroshare-gui/src/gui/chat/ChatDialog.h b/retroshare-gui/src/gui/chat/ChatDialog.h index 32cbe4f83..2b56f0326 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.h +++ b/retroshare-gui/src/gui/chat/ChatDialog.h @@ -60,6 +60,7 @@ public: void insertChatMsgs(); int getPeerStatus(); + void setPeerStatus(uint32_t state); void focusDialog(); diff --git a/retroshare-gui/src/gui/chat/ChatWidget.h b/retroshare-gui/src/gui/chat/ChatWidget.h index a7aff6b15..b16d556ce 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.h +++ b/retroshare-gui/src/gui/chat/ChatWidget.h @@ -79,12 +79,13 @@ public: void setDefaultExtraFileFlags(TransferRequestFlags f) ; void pasteText(const QString&); +public slots: + void updateStatus(const QString &peer_id, int status); private slots: void pasteCreateMsgLink() ; void clearChatHistory(); void deleteChatHistory(); void messageHistory(); - void updateStatus(const QString &peer_id, int status); void resetStatusBar() ; signals: diff --git a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp index 7a1826180..eedebfd6e 100644 --- a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp @@ -23,6 +23,8 @@ #include #include +#include + #include "RsAutoUpdatePage.h" #include "PopupDistantChatDialog.h" @@ -79,6 +81,7 @@ void PopupDistantChatDialog::updateDisplay() case RS_DISTANT_CHAT_STATUS_UNKNOWN: std::cerr << "Unknown hash. Error!" << std::endl; _status_label->setPixmap(QPixmap(IMAGE_GRY_LED)) ; _status_label->setToolTip(QObject::tr("Hash error")) ; + setPeerStatus(RS_STATUS_OFFLINE) ; break ; case RS_DISTANT_CHAT_STATUS_REMOTELY_CLOSED: std::cerr << "Chat remotely closed. " << std::endl; _status_label->setPixmap(QPixmap(IMAGE_RED_LED)) ; @@ -86,18 +89,23 @@ void PopupDistantChatDialog::updateDisplay() QMessageBox::warning(NULL,tr("Distant chat terminated"),tr("The person you're talking to has deleted the secured chat tunnel. You may remove the chat window now.")) ; _update_timer->stop() ; + setPeerStatus(RS_STATUS_OFFLINE) ; + break ; case RS_DISTANT_CHAT_STATUS_TUNNEL_DN: std::cerr << "Tunnel asked. Waiting for reponse. " << std::endl; _status_label->setPixmap(QPixmap(IMAGE_RED_LED)) ; _status_label->setToolTip(QObject::tr("Tunnel is pending...")) ; + setPeerStatus(RS_STATUS_OFFLINE) ; break ; case RS_DISTANT_CHAT_STATUS_TUNNEL_OK: std::cerr << "Tunnel is ok. " << std::endl; _status_label->setPixmap(QPixmap(IMAGE_YEL_LED)) ; _status_label->setToolTip(QObject::tr("Secured tunnel established!")) ; + setPeerStatus(RS_STATUS_ONLINE) ; break ; case RS_DISTANT_CHAT_STATUS_CAN_TALK: std::cerr << "Tunnel is ok and data is transmitted." << std::endl; _status_label->setPixmap(QPixmap(IMAGE_GRN_LED)) ; _status_label->setToolTip(QObject::tr("Secured tunnel is working")) ; + setPeerStatus(RS_STATUS_ONLINE) ; break ; } } diff --git a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h index e391265be..973a687c3 100644 --- a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h +++ b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h @@ -40,7 +40,6 @@ class PopupDistantChatDialog: public PopupChatDialog virtual ~PopupDistantChatDialog(); virtual void init(const std::string& _hash, const QString &title); - virtual void updateStatus(int /*status*/) {} virtual void closeEvent(QCloseEvent *e) ; protected slots: