mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-14 08:59:50 -05:00
fixed load/save of chat history for distant chat
This commit is contained in:
parent
09343e9179
commit
b3156223af
@ -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 ;
|
||||
|
@ -113,7 +113,7 @@ int p3GxsTunnelService::tick()
|
||||
|
||||
flush() ;
|
||||
|
||||
rstime::rs_usleep(1000*200);
|
||||
rstime::rs_usleep(1000*500);
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user