diff --git a/libretroshare/src/retroshare/rsmsgs.h b/libretroshare/src/retroshare/rsmsgs.h index a8524759b..d60511f48 100644 --- a/libretroshare/src/retroshare/rsmsgs.h +++ b/libretroshare/src/retroshare/rsmsgs.h @@ -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& 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& 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 ; diff --git a/libretroshare/src/rsserver/p3msgs.cc b/libretroshare/src/rsserver/p3msgs.cc index 50d842f83..e54c0730d 100644 --- a/libretroshare/src/rsserver/p3msgs.cc +++ b/libretroshare/src/rsserver/p3msgs.cc @@ -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) ; diff --git a/libretroshare/src/rsserver/p3msgs.h b/libretroshare/src/rsserver/p3msgs.h index 4e5efc5b6..691759bed 100644 --- a/libretroshare/src/rsserver/p3msgs.h +++ b/libretroshare/src/rsserver/p3msgs.h @@ -138,7 +138,6 @@ class p3Msgs: public RsMsgs virtual bool joinVisibleChatLobby(const ChatLobbyId& id, const RsGxsId &own_id) ; virtual void getListOfNearbyChatLobbies(std::vector& public_lobbies) ; - virtual bool getVirtualPeerId(const ChatLobbyId& id,RsPeerId& vpid) ; virtual void getChatLobbyList(std::list& cl_list) ; virtual bool getChatLobbyInfo(const ChatLobbyId& id,ChatLobbyInfo& info) ; virtual void invitePeerToLobby(const ChatLobbyId&, const RsPeerId&) ; diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index 9e960f364..5eff6908c 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -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; } }