mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Merge pull request #874 from G10h4ck/silent_initiate_distant_chat_api
libresapi: silent /chat/initiate_distant_chat
This commit is contained in:
commit
a29bc4408e
4 changed files with 29 additions and 17 deletions
|
@ -414,16 +414,18 @@ void ChatHandler::tick()
|
|||
}
|
||||
}
|
||||
else if(msg.chat_id.isDistantChatId())
|
||||
{
|
||||
RsIdentityDetails details;
|
||||
DistantChatPeerInfo dcpinfo ;
|
||||
|
||||
if(!gxs_id_failed && rsMsgs->getDistantChatStatus(msg.chat_id.toDistantChatId(),dcpinfo)
|
||||
&& mRsIdentity->getIdDetails(msg.incoming? dcpinfo.to_id: dcpinfo.own_id, details))
|
||||
{
|
||||
info.remote_author_id = details.mId.toStdString();
|
||||
info.remote_author_name = details.mNickname;
|
||||
}
|
||||
{
|
||||
RsIdentityDetails details;
|
||||
DistantChatPeerInfo dcpinfo;
|
||||
|
||||
if( !gxs_id_failed &&
|
||||
rsMsgs->getDistantChatStatus(
|
||||
msg.chat_id.toDistantChatId(), dcpinfo ) &&
|
||||
mRsIdentity->getIdDetails(dcpinfo.to_id, details) )
|
||||
{
|
||||
info.remote_author_id = details.mId.toStdString();
|
||||
info.remote_author_name = details.mNickname;
|
||||
}
|
||||
else
|
||||
{
|
||||
gxs_id_failed = true;
|
||||
|
@ -1199,9 +1201,9 @@ void ChatHandler::handleInitiateDistantChatConnexion(Request& req, Response& res
|
|||
DistantChatPeerId distant_chat_id;
|
||||
uint32_t error_code;
|
||||
|
||||
if(mRsMsgs->initiateDistantChatConnexion(receiver_id, sender_id,
|
||||
distant_chat_id, error_code))
|
||||
resp.setOk();
|
||||
if(mRsMsgs->initiateDistantChatConnexion( receiver_id, sender_id,
|
||||
distant_chat_id, error_code,
|
||||
false )) resp.setOk();
|
||||
else resp.setFail("Failed to initiate distant chat");
|
||||
|
||||
ChatId chat_id(distant_chat_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue