mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-23 21:25:22 -04:00
merged with upstream/master
This commit is contained in:
commit
5d9272055f
2052 changed files with 8495 additions and 3638 deletions
|
@ -65,11 +65,11 @@ ChatId::ChatId(RsPeerId id):
|
|||
peer_id = id;
|
||||
}
|
||||
|
||||
ChatId::ChatId(RsGxsId id):
|
||||
ChatId::ChatId(DistantChatPeerId id):
|
||||
lobby_id(0)
|
||||
{
|
||||
type = TYPE_PRIVATE_DISTANT;
|
||||
gxs_id = id;
|
||||
distant_chat_id = id;
|
||||
}
|
||||
|
||||
ChatId::ChatId(ChatLobbyId id):
|
||||
|
@ -93,7 +93,7 @@ ChatId::ChatId(std::string str):
|
|||
else if(str[0] == 'D')
|
||||
{
|
||||
type = TYPE_PRIVATE_DISTANT;
|
||||
gxs_id == GXSId(str.substr(1));
|
||||
distant_chat_id == DistantChatPeerId(str.substr(1));
|
||||
}
|
||||
else if(str[0] == 'L')
|
||||
{
|
||||
|
@ -143,7 +143,7 @@ std::string ChatId::toStdString() const
|
|||
else if(type == TYPE_PRIVATE_DISTANT)
|
||||
{
|
||||
str += "D";
|
||||
str += gxs_id.toStdString();
|
||||
str += distant_chat_id.toStdString();
|
||||
}
|
||||
else if(type == TYPE_LOBBY)
|
||||
{
|
||||
|
@ -186,7 +186,7 @@ bool ChatId::operator <(const ChatId& other) const
|
|||
case TYPE_PRIVATE:
|
||||
return peer_id < other.peer_id;
|
||||
case TYPE_PRIVATE_DISTANT:
|
||||
return gxs_id < other.gxs_id;
|
||||
return distant_chat_id < other.distant_chat_id;
|
||||
case TYPE_LOBBY:
|
||||
return lobby_id < other.lobby_id;
|
||||
case TYPE_BROADCAST:
|
||||
|
@ -210,7 +210,7 @@ bool ChatId::isSameEndpoint(const ChatId &other) const
|
|||
case TYPE_PRIVATE:
|
||||
return peer_id == other.peer_id;
|
||||
case TYPE_PRIVATE_DISTANT:
|
||||
return gxs_id == other.gxs_id;
|
||||
return distant_chat_id == other.distant_chat_id;
|
||||
case TYPE_LOBBY:
|
||||
return lobby_id == other.lobby_id;
|
||||
case TYPE_BROADCAST:
|
||||
|
@ -229,7 +229,7 @@ bool ChatId::isPeerId() const
|
|||
{
|
||||
return type == TYPE_PRIVATE;
|
||||
}
|
||||
bool ChatId::isGxsId() const
|
||||
bool ChatId::isDistantChatId() const
|
||||
{
|
||||
return type == TYPE_PRIVATE_DISTANT;
|
||||
}
|
||||
|
@ -251,14 +251,15 @@ RsPeerId ChatId::toPeerId() const
|
|||
return RsPeerId();
|
||||
}
|
||||
}
|
||||
RsGxsId ChatId::toGxsId() const
|
||||
|
||||
DistantChatPeerId ChatId::toDistantChatId() const
|
||||
{
|
||||
if(type == TYPE_PRIVATE_DISTANT)
|
||||
return gxs_id;
|
||||
return distant_chat_id;
|
||||
else
|
||||
{
|
||||
std::cerr << "ChatId Warning: conversation to RsGxsId requested, but type is different. Current value=\"" << toStdString() << "\"" << std::endl;
|
||||
return RsGxsId();
|
||||
std::cerr << "ChatId Warning: conversation to DistantChatPeerId requested, but type is different. Current value=\"" << toStdString() << "\"" << std::endl;
|
||||
return DistantChatPeerId();
|
||||
}
|
||||
}
|
||||
ChatLobbyId ChatId::toLobbyId() const
|
||||
|
@ -524,15 +525,15 @@ void p3Msgs::getPendingChatLobbyInvites(std::list<ChatLobbyInvite>& invites)
|
|||
{
|
||||
mChatSrv->getPendingChatLobbyInvites(invites) ;
|
||||
}
|
||||
bool p3Msgs::initiateDistantChatConnexion(const RsGxsId& to_gxs_id,const RsGxsId& from_gxs_id,uint32_t& error_code)
|
||||
bool p3Msgs::initiateDistantChatConnexion(const RsGxsId& to_gxs_id,const RsGxsId& from_gxs_id,DistantChatPeerId& pid,uint32_t& error_code)
|
||||
{
|
||||
return mChatSrv->initiateDistantChatConnexion(to_gxs_id,from_gxs_id,error_code) ;
|
||||
return mChatSrv->initiateDistantChatConnexion(to_gxs_id,from_gxs_id,pid,error_code) ;
|
||||
}
|
||||
bool p3Msgs::getDistantChatStatus(const RsGxsId &gxs_id,uint32_t &status,RsGxsId *from_gxs_id)
|
||||
bool p3Msgs::getDistantChatStatus(const DistantChatPeerId& pid,DistantChatPeerInfo& info)
|
||||
{
|
||||
return mChatSrv->getDistantChatStatus(gxs_id,status,from_gxs_id) ;
|
||||
return mChatSrv->getDistantChatStatus(pid,info) ;
|
||||
}
|
||||
bool p3Msgs::closeDistantChatConnexion(const RsGxsId& pid)
|
||||
bool p3Msgs::closeDistantChatConnexion(const DistantChatPeerId &pid)
|
||||
{
|
||||
return mChatSrv->closeDistantChatConnexion(pid) ;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue