diff --git a/libretroshare/src/chat/p3chatservice.cc b/libretroshare/src/chat/p3chatservice.cc index 51adc8d3e..67ca8f210 100644 --- a/libretroshare/src/chat/p3chatservice.cc +++ b/libretroshare/src/chat/p3chatservice.cc @@ -417,10 +417,10 @@ bool p3ChatService::sendChat(ChatId destination, std::string msg) RsServer::notify()->notifyChatMessage(message); - // cyril: history is temporarily diabled for distant chat, since we need to store the full tunnel ID, but then + // cyril: history is temporarily disabled for distant chat, since we need to store the full tunnel ID, but then // at loading time, the ID is not known so that chat window shows 00000000 as a peer. - if(!message.chat_id.isDistantChatId()) + //if(!message.chat_id.isDistantChatId()) mHistoryMgr->addMessage(message); checkSizeAndSendMessage(ci); @@ -876,10 +876,6 @@ bool p3ChatService::handleRecvChatMsgItem(RsChatMsgItem *& ci) cm.online = true; RsServer::notify()->notifyChatMessage(cm); - // cyril: history is temporarily diabled for distant chat, since we need to store the full tunnel ID, but then - // at loading time, the ID is not known so that chat window shows 00000000 as a peer. - - if(!cm.chat_id.isDistantChatId()) mHistoryMgr->addMessage(cm); return true ; diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.cc b/libretroshare/src/gxstunnel/p3gxstunnel.cc index 69b0f3f96..5f75c633b 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.cc +++ b/libretroshare/src/gxstunnel/p3gxstunnel.cc @@ -113,7 +113,7 @@ int p3GxsTunnelService::tick() flush() ; - rstime::rs_usleep(1000*200); + rstime::rs_usleep(1000*500); return 0 ; } diff --git a/libretroshare/src/pqi/p3historymgr.cc b/libretroshare/src/pqi/p3historymgr.cc index fba1711ce..c31762385 100644 --- a/libretroshare/src/pqi/p3historymgr.cc +++ b/libretroshare/src/pqi/p3historymgr.cc @@ -103,7 +103,21 @@ void p3HistoryMgr::addMessage(const ChatMessage& cm) { DistantChatPeerInfo dcpinfo; if (rsMsgs->getDistantChatStatus(cm.chat_id.toDistantChatId(), dcpinfo)) - peerName = cm.chat_id.toPeerId().toStdString(); + { + RsIdentityDetails det; + RsGxsId writer_id = cm.incoming?(dcpinfo.to_id):(dcpinfo.own_id); + + if(rsIdentity->getIdDetails(writer_id,det)) + peerName = det.mNickname; + else + peerName = writer_id.toStdString(); + } + else + { + RsErr() << "Cannot retrieve friend name for distant chat " << cm.chat_id.toDistantChatId() << std::endl; + peerName = ""; + } + enabled = true; }