removed getVirtualPeerId method from rsmsgs lobby interface.

It is not neccesary anymore to have the virtual peer id exposed to the GUI layer.
This commit is contained in:
electron128 2016-01-10 14:22:06 +01:00
parent 67e1495d9a
commit 09ed1ea22c
4 changed files with 6 additions and 16 deletions

View File

@ -464,9 +464,11 @@ virtual void getOwnAvatarData(unsigned char *& data,int& size) = 0 ;
/****************************************/
virtual bool joinVisibleChatLobby(const ChatLobbyId& lobby_id,const RsGxsId& own_id) = 0 ;
virtual bool getVirtualPeerId(const ChatLobbyId& lobby_id,RsPeerId& vpid) = 0;
/// get ids of subscribed lobbies
virtual void getChatLobbyList(std::list<ChatLobbyId>& cl_list) = 0;
/// get lobby info of a subscribed chat lobby. Returns true if lobby id is valid.
virtual bool getChatLobbyInfo(const ChatLobbyId& id,ChatLobbyInfo& info) = 0 ;
/// get info about all lobbies, subscribed and unsubscribed
virtual void getListOfNearbyChatLobbies(std::vector<VisibleChatLobbyRecord>& public_lobbies) = 0 ;
virtual void invitePeerToLobby(const ChatLobbyId& lobby_id,const RsPeerId& peer_id) = 0;
virtual bool acceptLobbyInvite(const ChatLobbyId& id,const RsGxsId& identity) = 0 ;

View File

@ -444,11 +444,6 @@ void p3Msgs::setCustomStateString(const std::string& state_string)
mChatSrv->setOwnCustomStateString(state_string) ;
}
bool p3Msgs::getVirtualPeerId(const ChatLobbyId& id,RsPeerId& peer_id)
{
return mChatSrv->getVirtualPeerId(id,peer_id) ;
}
bool p3Msgs::getChatLobbyInfo(const ChatLobbyId& id,ChatLobbyInfo& linfo)
{
return mChatSrv->getChatLobbyInfo(id,linfo) ;

View File

@ -138,7 +138,6 @@ class p3Msgs: public RsMsgs
virtual bool joinVisibleChatLobby(const ChatLobbyId& id, const RsGxsId &own_id) ;
virtual void getListOfNearbyChatLobbies(std::vector<VisibleChatLobbyRecord>& public_lobbies) ;
virtual bool getVirtualPeerId(const ChatLobbyId& id,RsPeerId& vpid) ;
virtual void getChatLobbyList(std::list<ChatLobbyId>& cl_list) ;
virtual bool getChatLobbyInfo(const ChatLobbyId& id,ChatLobbyInfo& info) ;
virtual void invitePeerToLobby(const ChatLobbyId&, const RsPeerId&) ;

View File

@ -501,10 +501,7 @@ void ChatLobbyWidget::updateDisplay()
#endif
bool subscribed = false;
if (rsMsgs->getVirtualPeerId(lobby.lobby_id, vpid)) {
subscribed = true;
}
bool subscribed = std::find(lobbies.begin(), lobbies.end(), lobby.lobby_id) != lobbies.end();
QTreeWidgetItem *item = NULL;
QTreeWidgetItem *lobby_item =NULL;
@ -1101,13 +1098,10 @@ void ChatLobbyWidget::readChatLobbyInvites()
continue ;
}
rsMsgs->acceptLobbyInvite((*it).lobby_id,chosen_id);
RsPeerId vpid;
if(rsMsgs->getVirtualPeerId((*it).lobby_id,vpid ))
if(rsMsgs->acceptLobbyInvite((*it).lobby_id,chosen_id))
ChatDialog::chatFriend(ChatId((*it).lobby_id),true);
else
std::cerr << "No lobby known with id 0x" << std::hex << (*it).lobby_id << std::dec << std::endl;
std::cerr << "Can't join lobby with id 0x" << std::hex << (*it).lobby_id << std::dec << std::endl;
}
}