- derived new class of PopupChatDialog to handle chat lobbies

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ChatLobby@4694 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-11-27 21:04:10 +00:00
parent f4e41b3247
commit 6c93253050
11 changed files with 209 additions and 913 deletions

View file

@ -1378,3 +1378,43 @@ void p3ChatService::createChatLobby(const std::string& lobby_name,const std::lis
invitePeerToLobby(lobby_id,*it) ;
}
void p3ChatService::unsubscribeChatLobby(const ChatLobbyId& id)
{
RsStackMutex stack(mChatMtx); /********** STACK LOCKED MTX ******/
// send a lobby leaving packet. To be implemented.
}
bool p3ChatService::getNickNameForChatLobby(const ChatLobbyId& lobby_id,std::string& nick)
{
RsStackMutex stack(mChatMtx); /********** STACK LOCKED MTX ******/
std::cerr << "getting nickname for chat lobby "<< std::hex << lobby_id << std::dec << std::endl;
std::map<ChatLobbyId,ChatLobbyEntry>::iterator it = _chat_lobbys.find(lobby_id) ;
if(it == _chat_lobbys.end())
{
std::cerr << " (EE) lobby does not exist!!" << std::endl;
return false ;
}
nick = it->second.nick_name ;
return true ;
}
bool p3ChatService::setNickNameForChatLobby(const ChatLobbyId& lobby_id,const std::string& nick)
{
RsStackMutex stack(mChatMtx); /********** STACK LOCKED MTX ******/
std::cerr << "Changing nickname for chat lobby " << std::hex << lobby_id << std::dec << " to " << nick << std::endl;
std::map<ChatLobbyId,ChatLobbyEntry>::iterator it = _chat_lobbys.find(lobby_id) ;
if(it == _chat_lobbys.end())
{
std::cerr << " (EE) lobby does not exist!!" << std::endl;
return false;
}
it->second.nick_name = nick ;
return true ;
}

View file

@ -156,9 +156,9 @@ class p3ChatService: public p3Service, public p3Config, public pqiMonitor
bool sendLobbyChat(const std::wstring&, const ChatLobbyId&) ;
void getChatLobbyList(std::list<ChatLobbyInfo, std::allocator<ChatLobbyInfo> >&) ;
void invitePeerToLobby(const ChatLobbyId&, const std::string&) ;
void setLobbyNickName(const ChatLobbyNickName&) ;
const ChatLobbyNickName& lobbyNickName() const ;
bool setNickNameForChatLobby(const ChatLobbyId& lobby_id,const std::string& nick) ;
void unsubscribeChatLobby(const ChatLobbyId& lobby_id) ;
bool getNickNameForChatLobby(const ChatLobbyId& lobby_id,std::string& nick) ;
protected:
/************* from p3Config *******************/