libresapi: stop assuming first chat message is own

This commit is contained in:
Gioacchino Mazzurco 2017-06-07 21:37:03 +02:00
parent 528317d374
commit edd82d0ef2

View File

@ -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;