From 12866cd73521774bbac22654b43650bdf30b065f Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 30 Nov 2015 20:51:47 -0500 Subject: [PATCH] fixed a few bugs in new distant chat --- libretroshare/src/chat/distantchat.cc | 2 ++ libretroshare/src/gxstunnel/p3gxstunnel.cc | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/chat/distantchat.cc b/libretroshare/src/chat/distantchat.cc index eee035197..e311b9233 100644 --- a/libretroshare/src/chat/distantchat.cc +++ b/libretroshare/src/chat/distantchat.cc @@ -157,6 +157,8 @@ void DistantChatService::receiveData(const RsGxsTunnelService::RsGxsTunnelId &tu if(item != NULL) { + item->PeerId(RsPeerId(tunnel_id)) ; // just in case, but normally this is already done. + handleIncomingItem(item) ; RsServer::notify()->notifyListChange(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, NOTIFY_TYPE_ADD); } diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.cc b/libretroshare/src/gxstunnel/p3gxstunnel.cc index 2460bb9aa..af333ad45 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.cc +++ b/libretroshare/src/gxstunnel/p3gxstunnel.cc @@ -896,6 +896,7 @@ void p3GxsTunnelService::handleRecvDHPublicKey(RsGxsTunnelDHPublicKeyItem *item) pinfo.virtual_peer_id = vpid ; pinfo.direction = it->second.direction ; pinfo.own_gxs_id = own_id ; + pinfo.to_gxs_id = item->signature.keyId; // this is already set for client side but not for server side. // note: the hash might still be nn initialised on server side. @@ -1433,7 +1434,7 @@ bool p3GxsTunnelService::closeExistingTunnel(const RsGxsTunnelId& tunnel_id, uin RsGxsTunnelStatusItem *cs = new RsGxsTunnelStatusItem ; cs->status = RS_GXS_TUNNEL_FLAG_CLOSING_DISTANT_CONNECTION; - cs->PeerId(vpid) ; + cs->PeerId(RsPeerId(tunnel_id)) ; locked_sendEncryptedTunnelData(cs) ; // that needs to be done off-mutex and before we close the tunnel also ignoring failure.