mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
added chat lobby creation window
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ChatLobby@4709 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a0e3522273
commit
71a079b55f
10 changed files with 552 additions and 12 deletions
|
@ -229,6 +229,7 @@ virtual void setOwnAvatarData(const unsigned char *data,int size) = 0 ;
|
|||
virtual void getOwnAvatarData(unsigned char *& data,int& size) = 0 ;
|
||||
|
||||
virtual bool isLobbyId(const std::string& virtual_peer_id,ChatLobbyId& lobby_id) = 0;
|
||||
virtual bool getVirtualPeerId(const ChatLobbyId& lobby_id,std::string& vpid) = 0;
|
||||
virtual void getChatLobbyList(std::list<ChatLobbyInfo>& cl_info) = 0;
|
||||
virtual void invitePeerToLobby(const ChatLobbyId& lobby_id,const std::string& peer_id) = 0;
|
||||
virtual bool acceptLobbyInvite(const ChatLobbyId& id) = 0 ;
|
||||
|
|
|
@ -260,6 +260,10 @@ void p3Msgs::setCustomStateString(const std::string& state_string)
|
|||
mChatSrv->setOwnCustomStateString(state_string) ;
|
||||
}
|
||||
|
||||
bool p3Msgs::getVirtualPeerId(const ChatLobbyId& id,std::string& peer_id)
|
||||
{
|
||||
return mChatSrv->getVirtualPeerId(id,peer_id) ;
|
||||
}
|
||||
bool p3Msgs::isLobbyId(const std::string& peer_id,ChatLobbyId& id)
|
||||
{
|
||||
return mChatSrv->isLobbyId(peer_id,id) ;
|
||||
|
|
|
@ -168,6 +168,7 @@ class p3Msgs: public RsMsgs
|
|||
/****************************************/
|
||||
|
||||
|
||||
virtual bool getVirtualPeerId(const ChatLobbyId& id,std::string& vpid) ;
|
||||
virtual bool isLobbyId(const std::string& virtual_peer_id,ChatLobbyId& lobby_id) ;
|
||||
virtual void getChatLobbyList(std::list<ChatLobbyInfo, std::allocator<ChatLobbyInfo> >&) ;
|
||||
virtual void invitePeerToLobby(const ChatLobbyId&, const std::string&) ;
|
||||
|
|
|
@ -226,6 +226,19 @@ void p3ChatService::checkSizeAndSendMessage(RsChatMsgItem *msg)
|
|||
sendItem(msg) ;
|
||||
}
|
||||
|
||||
bool p3ChatService::getVirtualPeerId(const ChatLobbyId& id,std::string& vpid)
|
||||
{
|
||||
RsStackMutex stack(mChatMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
std::map<ChatLobbyId,ChatLobbyEntry>::const_iterator it(_chat_lobbys.find(id)) ;
|
||||
|
||||
if(it == _chat_lobbys.end())
|
||||
return false ;
|
||||
|
||||
vpid = it->second.virtual_peer_id ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
void p3ChatService::locked_printDebugInfo() const
|
||||
{
|
||||
std::cerr << "Recorded lobbies: " << std::endl;
|
||||
|
@ -260,9 +273,6 @@ bool p3ChatService::isLobbyId(const std::string& id,ChatLobbyId& lobby_id)
|
|||
|
||||
locked_printDebugInfo() ; // debug
|
||||
|
||||
for( std::map<std::string,ChatLobbyId>::const_iterator it(_lobby_ids.begin()) ;it!=_lobby_ids.end();++it)
|
||||
std::cerr << "Testing \"" << id << "\" against \"" << it->first << "\" result=" << (it->first == id) << std::endl;
|
||||
|
||||
std::map<std::string,ChatLobbyId>::const_iterator it(_lobby_ids.find(id)) ;
|
||||
|
||||
if(it != _lobby_ids.end())
|
||||
|
|
|
@ -153,6 +153,7 @@ class p3ChatService: public p3Service, public p3Config, public pqiMonitor
|
|||
*/
|
||||
bool clearPrivateChatQueue(bool incoming, const std::string &id);
|
||||
|
||||
bool getVirtualPeerId(const ChatLobbyId&, std::string& virtual_peer_id) ;
|
||||
bool isLobbyId(const std::string&, ChatLobbyId&) ;
|
||||
void getChatLobbyList(std::list<ChatLobbyInfo, std::allocator<ChatLobbyInfo> >&) ;
|
||||
bool acceptLobbyInvite(const ChatLobbyId& id) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue