void MessengerClient::chatRoomLeft() { _inChatRoom = false; clearRoomUsers(); delete _clientLinker; _clientLinker = NULL; }
// Update the rooms info void ClientManager::chatRoomUpdate() { roomOn = true; clearRoomUsers(); chatRoomName = serverSocket->readMsg(); int countofmemebers = serverSocket->readCommand(); for (int i = 0 ; i< countofmemebers;i++) { string user = serverSocket->readMsg(); string ip = serverSocket->readMsg(); int port = serverSocket->readCommand(); addRoomUser(user,ip,port); } cout<<"Chat room "<< chatRoomName<<" updated"<<endl; }
void MessengerClient::chatRoomUpdate() { _inChatRoom = true; clearRoomUsers(); _chatRoomName = MessengerClient::readDataFromPeer(_serverSocket); int numOfMemebers = MessengerClient::readCommandFromPeer(_serverSocket); for (int i = 0; i < numOfMemebers; i++) { string user = MessengerClient::readDataFromPeer(_serverSocket); string ip = MessengerClient::readDataFromPeer(_serverSocket); int port = MessengerClient::readCommandFromPeer(_serverSocket); addChatRoomUser(user, ip, port); } cout << "Chat room " << _chatRoomName << " updated" << endl; }
// Update the user details after leaving a room void ClientManager::chatRoomLeaved() { roomOn = false; clearRoomUsers(); delete(clientLinker); }