mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-31 11:54:22 -04:00
Libresapi: Extended ChatInfo class to contain own identity used in chat
This commit is contained in:
parent
96e75074a8
commit
4026040b49
2 changed files with 14 additions and 5 deletions
|
@ -113,6 +113,8 @@ StreamBase& operator << (StreamBase& left, ChatHandler::ChatInfo& info)
|
||||||
{
|
{
|
||||||
left << makeKeyValueReference("remote_author_id", info.remote_author_id)
|
left << makeKeyValueReference("remote_author_id", info.remote_author_id)
|
||||||
<< makeKeyValueReference("remote_author_name", info.remote_author_name)
|
<< makeKeyValueReference("remote_author_name", info.remote_author_name)
|
||||||
|
<< makeKeyValueReference("own_author_id", info.own_author_id)
|
||||||
|
<< makeKeyValueReference("own_author_name", info.own_author_name)
|
||||||
<< makeKeyValueReference("is_broadcast", info.is_broadcast)
|
<< makeKeyValueReference("is_broadcast", info.is_broadcast)
|
||||||
<< makeKeyValueReference("is_distant_chat_id", info.is_distant_chat_id)
|
<< makeKeyValueReference("is_distant_chat_id", info.is_distant_chat_id)
|
||||||
<< makeKeyValueReference("is_lobby", info.is_lobby)
|
<< makeKeyValueReference("is_lobby", info.is_lobby)
|
||||||
|
@ -435,16 +437,21 @@ void ChatHandler::tick()
|
||||||
}
|
}
|
||||||
else if(msg.chat_id.isDistantChatId())
|
else if(msg.chat_id.isDistantChatId())
|
||||||
{
|
{
|
||||||
RsIdentityDetails details;
|
RsIdentityDetails detailsRemoteIdentity;
|
||||||
|
RsIdentityDetails detailsOwnIdentity;
|
||||||
DistantChatPeerInfo dcpinfo;
|
DistantChatPeerInfo dcpinfo;
|
||||||
|
|
||||||
if( !gxs_id_failed &&
|
if( !gxs_id_failed &&
|
||||||
rsMsgs->getDistantChatStatus(
|
rsMsgs->getDistantChatStatus(
|
||||||
msg.chat_id.toDistantChatId(), dcpinfo ) &&
|
msg.chat_id.toDistantChatId(), dcpinfo )
|
||||||
mRsIdentity->getIdDetails(dcpinfo.to_id, details) )
|
&& mRsIdentity->getIdDetails(dcpinfo.to_id, detailsRemoteIdentity)
|
||||||
|
&& mRsIdentity->getIdDetails(dcpinfo.own_id, detailsOwnIdentity))
|
||||||
{
|
{
|
||||||
info.remote_author_id = details.mId.toStdString();
|
info.remote_author_id = detailsRemoteIdentity.mId.toStdString();
|
||||||
info.remote_author_name = details.mNickname;
|
info.remote_author_name = detailsRemoteIdentity.mNickname;
|
||||||
|
|
||||||
|
info.own_author_id = detailsOwnIdentity.mId.toStdString();
|
||||||
|
info.own_author_name = detailsOwnIdentity.mNickname;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,6 +104,8 @@ public:
|
||||||
bool is_distant_chat_id;
|
bool is_distant_chat_id;
|
||||||
bool is_lobby;
|
bool is_lobby;
|
||||||
bool is_peer;
|
bool is_peer;
|
||||||
|
std::string own_author_id;
|
||||||
|
std::string own_author_name;
|
||||||
std::string remote_author_id;
|
std::string remote_author_id;
|
||||||
std::string remote_author_name;
|
std::string remote_author_name;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue