Merge pull request #2222 from PhenomRetroShare/Fix_DistantChatAvatarStatusUpdate

Fix Distant Chat Avatar Status Update
This commit is contained in:
csoler 2021-01-14 13:44:25 +01:00 committed by GitHub
commit f26d5ebc2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,7 +228,15 @@ void AvatarWidget::refreshStatus()
DistantChatPeerInfo dcpinfo ; DistantChatPeerInfo dcpinfo ;
if(rsMsgs->getDistantChatStatus(mId.toDistantChatId(),dcpinfo)) if(rsMsgs->getDistantChatStatus(mId.toDistantChatId(),dcpinfo))
status = dcpinfo.status ; {
switch (dcpinfo.status)
{
case RS_DISTANT_CHAT_STATUS_CAN_TALK : status = RS_STATUS_ONLINE ; break;
case RS_DISTANT_CHAT_STATUS_UNKNOWN : // Fall-through
case RS_DISTANT_CHAT_STATUS_TUNNEL_DN : // Fall-through
case RS_DISTANT_CHAT_STATUS_REMOTELY_CLOSED : status = RS_STATUS_OFFLINE;
}
}
else else
std::cerr << "(EE) cannot get distant chat status for ID=" << mId.toDistantChatId() << std::endl; std::cerr << "(EE) cannot get distant chat status for ID=" << mId.toDistantChatId() << std::endl;
} }