mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-01 11:21:25 -05:00
enabled buffering for distant chat, so that msgs are sent when the tunnel is ok
This commit is contained in:
parent
bae85aac53
commit
09343e9179
@ -341,7 +341,7 @@ bool p3ChatService::sendChat(ChatId destination, std::string msg)
|
|||||||
message.incoming = false;
|
message.incoming = false;
|
||||||
message.online = true;
|
message.online = true;
|
||||||
|
|
||||||
if(!isOnline(vpid))
|
if(!isOnline(vpid) && !destination.isDistantChatId())
|
||||||
{
|
{
|
||||||
message.online = false;
|
message.online = false;
|
||||||
RsServer::notify()->notifyChatMessage(message);
|
RsServer::notify()->notifyChatMessage(message);
|
||||||
@ -352,11 +352,15 @@ bool p3ChatService::sendChat(ChatId destination, std::string msg)
|
|||||||
|
|
||||||
RsGxsTransId tId = RSRandom::random_u64();
|
RsGxsTransId tId = RSRandom::random_u64();
|
||||||
|
|
||||||
|
#ifdef SUSPENDED_CODE
|
||||||
|
// this part of the code was formerly used to send the traffic over GxsTransport. The problem is that
|
||||||
|
// gxstunnel takes care of reaching the peer already, so GxsTransport would only be needed when the
|
||||||
|
// current peer is offline. So we need to fin a way to quickly push the items to friends when quitting RS.
|
||||||
|
|
||||||
if(destination.isDistantChatId())
|
if(destination.isDistantChatId())
|
||||||
{
|
{
|
||||||
RS_STACK_MUTEX(mDGMutex);
|
RS_STACK_MUTEX(mDGMutex);
|
||||||
DIDEMap::const_iterator it =
|
DIDEMap::const_iterator it = mDistantGxsMap.find(destination.toDistantChatId());
|
||||||
mDistantGxsMap.find(destination.toDistantChatId());
|
|
||||||
if(it != mDistantGxsMap.end())
|
if(it != mDistantGxsMap.end())
|
||||||
{
|
{
|
||||||
const DistantEndpoints& de(it->second);
|
const DistantEndpoints& de(it->second);
|
||||||
@ -371,6 +375,7 @@ bool p3ChatService::sendChat(ChatId destination, std::string msg)
|
|||||||
<< "chat id in mDistantGxsMap this is unxpected!"
|
<< "chat id in mDistantGxsMap this is unxpected!"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// peer is offline, add to outgoing list
|
// peer is offline, add to outgoing list
|
||||||
{
|
{
|
||||||
|
@ -113,6 +113,8 @@ int p3GxsTunnelService::tick()
|
|||||||
|
|
||||||
flush() ;
|
flush() ;
|
||||||
|
|
||||||
|
rstime::rs_usleep(1000*200);
|
||||||
|
|
||||||
return 0 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1294,8 +1296,7 @@ bool p3GxsTunnelService::locked_sendEncryptedTunnelData(RsGxsTunnelItem *item)
|
|||||||
}
|
}
|
||||||
if(it->second.status != RS_GXS_TUNNEL_STATUS_CAN_TALK)
|
if(it->second.status != RS_GXS_TUNNEL_STATUS_CAN_TALK)
|
||||||
{
|
{
|
||||||
std::cerr << "(EE) Cannot talk to tunnel id " << tunnel_id
|
std::cerr << "(EE) Cannot talk to tunnel id " << tunnel_id << ". Tunnel status is: " << it->second.status << std::endl;
|
||||||
<< ". Tunnel status is: " << it->second.status << std::endl;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,8 +435,8 @@ ChatWidget::ChatType ChatWidget::chatType()
|
|||||||
void ChatWidget::blockSending(QString msg)
|
void ChatWidget::blockSending(QString msg)
|
||||||
{
|
{
|
||||||
#ifndef RS_ASYNC_CHAT
|
#ifndef RS_ASYNC_CHAT
|
||||||
sendingBlocked = true;
|
// sendingBlocked = true;
|
||||||
ui->sendButton->setEnabled(false);
|
// ui->sendButton->setEnabled(false);
|
||||||
#endif
|
#endif
|
||||||
ui->sendButton->setToolTip(msg);
|
ui->sendButton->setToolTip(msg);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user