- added/fixed patch from defnax to allow setting up a topic for each chat lobby. The topic is displayed to friends.

- handled backward compatibility by keeping/sending old LobbyList item. Should be remove in the near future.
- removed constraint to have at least one friends invited when creating a new lobby.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5024 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-03-16 22:47:49 +00:00
parent 42372c4223
commit 65cde95fba
11 changed files with 346 additions and 169 deletions

View file

@ -157,6 +157,7 @@ class ChatLobbyInvite
ChatLobbyId lobby_id ;
std::string peer_id ;
std::string lobby_name ;
std::string lobby_topic ;
uint32_t lobby_privacy_level ;
};
class PublicChatLobbyRecord
@ -166,6 +167,7 @@ class PublicChatLobbyRecord
ChatLobbyId lobby_id ; // unique id of the lobby
std::string lobby_name ; // name to use for this lobby
std::string lobby_topic ; // topic to use for this lobby
std::set<std::string> participating_friends ; // list of direct friend who participate.
uint32_t total_number_of_peers ; // total number of particpating peers. Might not be
@ -176,6 +178,7 @@ class ChatLobbyInfo
public:
ChatLobbyId lobby_id ; // unique id of the lobby
std::string lobby_name ; // name to use for this lobby
std::string lobby_topic ; // topic to use for this lobby
std::set<std::string> participating_friends ; // list of direct friend who participate. Used to broadcast sent messages.
std::string nick_name ; // nickname to use for this lobby
@ -206,7 +209,7 @@ virtual bool getMessageSummaries(std::list<MsgInfoSummary> &msgList) = 0;
virtual bool getMessage(const std::string &mId, MessageInfo &msg) = 0;
virtual void getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxNew, unsigned int *pnOutbox, unsigned int *pnDraftbox, unsigned int *pnSentbox, unsigned int *pnTrashbox) = 0;
virtual bool MessageSend(MessageInfo &info) = 0;
virtual bool MessageSend(MessageInfo &info) = 0;
virtual bool MessageToDraft(MessageInfo &info, const std::string &msgParentId) = 0;
virtual bool MessageToTrash(const std::string &mid, bool bTrash) = 0;
virtual bool getMsgParentId(const std::string &msgId, std::string &msgParentId) = 0;
@ -267,7 +270,7 @@ virtual bool setNickNameForChatLobby(const ChatLobbyId& lobby_id,const std::stri
virtual bool getNickNameForChatLobby(const ChatLobbyId& lobby_id,std::string& nick) = 0 ;
virtual bool setDefaultNickNameForChatLobby(const std::string& nick) = 0;
virtual bool getDefaultNickNameForChatLobby(std::string& nick) = 0 ;
virtual ChatLobbyId createChatLobby(const std::string& lobby_name,const std::list<std::string>& invited_friends,uint32_t lobby_privacy_type) = 0 ;
virtual ChatLobbyId createChatLobby(const std::string& lobby_name,const std::string& lobby_topic,const std::list<std::string>& invited_friends,uint32_t lobby_privacy_type) = 0 ;
/****************************************/

View file

@ -309,9 +309,9 @@ void p3Msgs::getListOfNearbyChatLobbies(std::vector<PublicChatLobbyRecord>& publ
mChatSrv->getListOfNearbyChatLobbies(public_lobbies) ;
}
ChatLobbyId p3Msgs::createChatLobby(const std::string& lobby_name,const std::list<std::string>& invited_friends,uint32_t privacy_type)
ChatLobbyId p3Msgs::createChatLobby(const std::string& lobby_name,const std::string& lobby_topic,const std::list<std::string>& invited_friends,uint32_t privacy_type)
{
return mChatSrv->createChatLobby(lobby_name,invited_friends,privacy_type) ;
return mChatSrv->createChatLobby(lobby_name,lobby_topic,invited_friends,privacy_type) ;
}
bool p3Msgs::acceptLobbyInvite(const ChatLobbyId& id)

View file

@ -182,7 +182,7 @@ class p3Msgs: public RsMsgs
virtual bool getNickNameForChatLobby(const ChatLobbyId&,std::string& nick) ;
virtual bool setDefaultNickNameForChatLobby(const std::string&) ;
virtual bool getDefaultNickNameForChatLobby(std::string& nick) ;
virtual ChatLobbyId createChatLobby(const std::string& lobby_name,const std::list<std::string>& invited_friends,uint32_t privacy_type) ;
virtual ChatLobbyId createChatLobby(const std::string& lobby_name,const std::string& lobby_topic,const std::list<std::string>& invited_friends,uint32_t privacy_type) ;
private:

View file

@ -56,6 +56,19 @@ std::ostream& RsChatMsgItem::print(std::ostream &out, uint16_t indent)
printRsItemEnd(out, "RsChatMsgItem", indent);
return out;
}
std::ostream& RsChatLobbyListItem_deprecated::print(std::ostream &out, uint16_t indent)
{
printRsItemBase(out, "RsChatLobbyListItem_deprecated", indent);
for(uint32_t i=0;i<lobby_ids.size();++i)
{
printIndent(out, indent+2);
out << "lobby 0x" << std::hex << lobby_ids[i] << std::dec << " (name=\"" << lobby_names[i] << "\", count=" << lobby_counts[i] << std::endl ;
}
printRsItemEnd(out, "RsChatLobbyListItem_deprecated", indent);
return out;
}
std::ostream& RsChatLobbyListItem::print(std::ostream &out, uint16_t indent)
{
printRsItemBase(out, "RsChatLobbyListItem", indent);
@ -63,7 +76,7 @@ std::ostream& RsChatLobbyListItem::print(std::ostream &out, uint16_t indent)
for(uint32_t i=0;i<lobby_ids.size();++i)
{
printIndent(out, indent+2);
out << "lobby 0x" << std::hex << lobby_ids[i] << std::dec << " (name=\"" << lobby_names[i] << "\", count=" << lobby_counts[i] << std::endl ;
out << "lobby 0x" << std::hex << lobby_ids[i] << std::dec << " (name=\"" << lobby_names[i] << "\", topic="<< lobby_topics[i] << "\", count=" << lobby_counts[i] << std::endl ;
}
printRsItemEnd(out, "RsChatLobbyListItem", indent);
@ -131,6 +144,9 @@ std::ostream& RsChatLobbyInviteItem::print(std::ostream &out, uint16_t indent)
printIndent(out, int_Indent);
out << "lobby name: " << lobby_name << std::endl;
printIndent(out, int_Indent);
out << "lobby topic: " << lobby_topic << std::endl;
printRsItemEnd(out, "RsChatLobbyInviteItem", indent);
return out;
@ -225,6 +241,7 @@ RsItem *RsChatSerialiser::deserialise(void *data, uint32_t *pktsize)
case RS_PKT_SUBTYPE_CHAT_LOBBY_EVENT: return new RsChatLobbyEventItem(data,*pktsize) ;
case RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_REQUEST: return new RsChatLobbyListRequestItem(data,*pktsize) ;
case RS_PKT_SUBTYPE_CHAT_LOBBY_LIST: return new RsChatLobbyListItem(data,*pktsize) ;
case RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_deprecated: return new RsChatLobbyListItem_deprecated(data,*pktsize) ;
default:
std::cerr << "Unknown packet type in chat!" << std::endl ;
return NULL ;
@ -282,6 +299,18 @@ uint32_t RsChatLobbyListRequestItem::serial_size()
uint32_t s = 8 ; // header
return s ;
}
uint32_t RsChatLobbyListItem_deprecated::serial_size()
{
uint32_t s = 8 ; // header
s += 4 ; // number of elements in the vectors
s += lobby_ids.size() * 8 ; // lobby_ids
for(uint32_t i=0;i<lobby_names.size();++i)
s += GetTlvStringSize(lobby_names[i]) ; // lobby_names
s += lobby_counts.size() * 4 ; // lobby_counts
return s ;
}
uint32_t RsChatLobbyListItem::serial_size()
{
uint32_t s = 8 ; // header
@ -290,11 +319,13 @@ uint32_t RsChatLobbyListItem::serial_size()
for(uint32_t i=0;i<lobby_names.size();++i)
s += GetTlvStringSize(lobby_names[i]) ; // lobby_names
for(uint32_t i=0;i<lobby_topics.size();++i)
s += GetTlvStringSize(lobby_topics[i]) ; // lobby_topics
s += lobby_counts.size() * 4 ; // lobby_counts
return s ;
}
uint32_t RsChatLobbyMsgItem::serial_size()
{
uint32_t s = RsChatMsgItem::serial_size() ; // parent
@ -459,7 +490,40 @@ bool RsChatLobbyListRequestItem::serialise(void *data, uint32_t& pktsize)
pktsize = tlvsize ;
return ok ;
}
bool RsChatLobbyListItem_deprecated::serialise(void *data, uint32_t& pktsize)
{
uint32_t tlvsize = serial_size() ;
bool ok = true ;
ok &= setRsItemHeader(data, tlvsize, PacketId(), tlvsize); // correct header!
if (pktsize < tlvsize)
return false; /* not enough space */
if(lobby_ids.size() != lobby_counts.size() || lobby_ids.size() != lobby_names.size())
{
std::cerr << "Consistency error in RsChatLobbyListItem!! Sizes don't match!" << std::endl;
return false ;
}
pktsize = tlvsize ;
uint32_t offset = 8 ;
ok &= setRawUInt32(data, tlvsize, &offset, lobby_ids.size());
for(uint32_t i=0;i<lobby_ids.size();++i)
{
ok &= setRawUInt64(data, tlvsize, &offset, lobby_ids[i]);
ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_NAME, lobby_names[i]);
ok &= setRawUInt32(data, tlvsize, &offset, lobby_counts[i]);
}
if (offset != tlvsize)
{
ok = false;
#ifdef CHAT_DEBUG
std::cerr << "RsChatSerialiser::serialiseItem() Size Error! " << std::endl;
#endif
}
return ok ;
}
bool RsChatLobbyListItem::serialise(void *data, uint32_t& pktsize)
{
uint32_t tlvsize = serial_size() ;
@ -483,6 +547,7 @@ bool RsChatLobbyListItem::serialise(void *data, uint32_t& pktsize)
{
ok &= setRawUInt64(data, tlvsize, &offset, lobby_ids[i]);
ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_NAME, lobby_names[i]);
ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_NAME, lobby_topics[i]);
ok &= setRawUInt32(data, tlvsize, &offset, lobby_counts[i]);
}
if (offset != tlvsize)
@ -793,9 +858,8 @@ RsChatLobbyListRequestItem::RsChatLobbyListRequestItem(void *data,uint32_t)
if (!ok)
std::cerr << "Unknown error while deserializing." << std::endl ;
}
RsChatLobbyListItem::RsChatLobbyListItem(void *data,uint32_t)
: RsChatItem(RS_PKT_SUBTYPE_CHAT_LOBBY_LIST)
RsChatLobbyListItem_deprecated::RsChatLobbyListItem_deprecated(void *data,uint32_t)
: RsChatItem(RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_deprecated)
{
uint32_t rssize = getRsItemSize(data);
bool ok = true ;
@ -820,6 +884,34 @@ RsChatLobbyListItem::RsChatLobbyListItem(void *data,uint32_t)
if (!ok)
std::cerr << "Unknown error while deserializing." << std::endl ;
}
RsChatLobbyListItem::RsChatLobbyListItem(void *data,uint32_t)
: RsChatItem(RS_PKT_SUBTYPE_CHAT_LOBBY_LIST)
{
uint32_t rssize = getRsItemSize(data);
bool ok = true ;
uint32_t offset = 8; // skip the header
uint32_t n=0 ;
ok &= getRawUInt32(data, rssize, &offset, &n);
lobby_ids.resize(n) ;
lobby_names.resize(n) ;
lobby_topics.resize(n) ;
lobby_counts.resize(n) ;
for(uint32_t i=0;i<n;++i)
{
ok &= getRawUInt64(data, rssize, &offset, &lobby_ids[i]);
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_NAME, lobby_names[i]);
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_NAME, lobby_topics[i]);
ok &= getRawUInt32(data, rssize, &offset, &lobby_counts[i]);
}
if (offset != rssize)
std::cerr << "Size error while deserializing." << std::endl ;
if (!ok)
std::cerr << "Unknown error while deserializing." << std::endl ;
}
bool RsChatLobbyBouncingObject::deserialise(void *data,uint32_t rssize,uint32_t& offset)
{

View file

@ -59,9 +59,10 @@ const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_UNSUBSCRIBE = 0x0A ;
const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_EVENT_DEPREC = 0x0B ; // don't use ! Deprecated
const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_MSG = 0x0C ;
const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_REQUEST = 0x0D ;
const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_LIST = 0x0E ;
const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_deprecated = 0x0E ;
const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_INVITE = 0x0F ;
const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_EVENT = 0x10 ;
const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_LIST = 0x11 ;
// for defining tags themselves and msg tags
const uint8_t RS_PKT_SUBTYPE_MSG_TAG_TYPE = 0x03;
@ -183,6 +184,22 @@ class RsChatLobbyListRequestItem: public RsChatItem
virtual std::ostream& print(std::ostream &out, uint16_t indent = 0);
};
class RsChatLobbyListItem_deprecated: public RsChatItem
{
public:
RsChatLobbyListItem_deprecated() : RsChatItem(RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_deprecated) {}
RsChatLobbyListItem_deprecated(void *data,uint32_t size) ;
virtual ~RsChatLobbyListItem_deprecated() {}
virtual std::ostream& print(std::ostream &out, uint16_t indent = 0);
virtual bool serialise(void *data,uint32_t& size) ;
virtual uint32_t serial_size() ;
std::vector<ChatLobbyId> lobby_ids ;
std::vector<std::string> lobby_names ;
std::vector<uint32_t> lobby_counts ;
};
class RsChatLobbyListItem: public RsChatItem
{
public:
@ -197,9 +214,9 @@ class RsChatLobbyListItem: public RsChatItem
std::vector<ChatLobbyId> lobby_ids ;
std::vector<std::string> lobby_names ;
std::vector<std::string> lobby_topics ;
std::vector<uint32_t> lobby_counts ;
};
class RsChatLobbyUnsubscribeItem: public RsChatItem
{
public:
@ -242,6 +259,7 @@ class RsChatLobbyInviteItem: public RsChatItem
ChatLobbyId lobby_id ;
std::string lobby_name ;
std::string lobby_topic ;
uint32_t lobby_privacy_level ;
virtual bool serialise(void *data,uint32_t& size) ; // Isn't it better that items can serialize themselves ?

View file

@ -317,6 +317,7 @@ void p3ChatService::locked_printDebugInfo() const
{
std::cerr << " Lobby id\t\t: " << std::hex << it->first << std::dec << std::endl;
std::cerr << " Lobby name\t\t: " << it->second.lobby_name << std::endl;
std::cerr << " Lobby topic\t\t: " << it->second.lobby_topic << std::endl;
std::cerr << " nick name\t\t: " << it->second.nick_name << std::endl;
std::cerr << " Lobby type\t\t: " << ((it->second.lobby_privacy_level==RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC)?"Public":"private") << std::endl;
std::cerr << " Lobby peer id\t: " << it->second.virtual_peer_id << std::endl;
@ -348,7 +349,7 @@ void p3ChatService::locked_printDebugInfo() const
for( std::map<ChatLobbyId,PublicChatLobbyRecord>::const_iterator it(_public_lobbies.begin()) ;it!=_public_lobbies.end();++it)
{
std::cerr << " " << std::hex << it->first << " name = " << std::dec << it->second.lobby_name << std::endl;
std::cerr << " " << std::hex << it->first << " name = " << std::dec << it->second.lobby_name << it->second.lobby_topic << std::endl;
for(std::set<std::string>::const_iterator it2(it->second.participating_friends.begin());it2!=it->second.participating_friends.end();++it2)
std::cerr << " With friend: " << *it2 << std::endl;
}
@ -628,6 +629,7 @@ void p3ChatService::receiveChatQueue()
case RS_PKT_SUBTYPE_CHAT_LOBBY_UNSUBSCRIBE: handleFriendUnsubscribeLobby (dynamic_cast<RsChatLobbyUnsubscribeItem *>(item)) ; break ;
case RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_REQUEST: handleRecvChatLobbyListRequest(dynamic_cast<RsChatLobbyListRequestItem *>(item)) ; break ;
case RS_PKT_SUBTYPE_CHAT_LOBBY_LIST: handleRecvChatLobbyList (dynamic_cast<RsChatLobbyListItem *>(item)) ; break ;
case RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_deprecated: handleRecvChatLobbyList (dynamic_cast<RsChatLobbyListItem_deprecated *>(item)) ; break ;
default:
std::cerr << "Unhandled item subtype " << item->PacketSubType() << " in p3ChatService: " << std::endl;
@ -653,11 +655,12 @@ void p3ChatService::handleRecvChatLobbyListRequest(RsChatLobbyListRequestItem *c
if(it->second.lobby_privacy_level == RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC)
{
#ifdef CHAT_DEBUG
std::cerr << " Adding lobby " << std::hex << it->first << std::dec << " \"" << it->second.lobby_name << "\" count=" << it->second.nick_names.size() << std::endl;
std::cerr << " Adding lobby " << std::hex << it->first << std::dec << " \"" << it->second.lobby_name << it->second.lobby_topic << "\" count=" << it->second.nick_names.size() << std::endl;
#endif
item->lobby_ids.push_back(it->first) ;
item->lobby_names.push_back(it->second.lobby_name) ;
item->lobby_topics.push_back(it->second.lobby_topic) ;
item->lobby_counts.push_back(it->second.nick_names.size()) ;
}
#ifdef CHAT_DEBUG
@ -672,8 +675,47 @@ void p3ChatService::handleRecvChatLobbyListRequest(RsChatLobbyListRequestItem *c
std::cerr << " Sending list to " << clr->PeerId() << std::endl;
#endif
sendItem(item);
}
// *********** Also send an item in old format. To be removed.
RsChatLobbyListItem_deprecated *itemd = new RsChatLobbyListItem_deprecated;
itemd->lobby_ids = item->lobby_ids ;
itemd->lobby_names = item->lobby_names ;
itemd->lobby_counts = item->lobby_counts ;
itemd->PeerId(clr->PeerId()) ;
sendItem(itemd) ;
// End of part to remove in future versions. *************
}
void p3ChatService::handleRecvChatLobbyList(RsChatLobbyListItem_deprecated *item)
{
{
time_t now = time(NULL) ;
RsStackMutex stack(mChatMtx); /********** STACK LOCKED MTX ******/
for(uint32_t i=0;i<item->lobby_ids.size();++i)
{
PublicChatLobbyRecord& rec(_public_lobbies[item->lobby_ids[i]]) ;
rec.lobby_id = item->lobby_ids[i] ;
rec.lobby_name = item->lobby_names[i] ;
rec.lobby_topic = "[Old format: no topic provided]" ;
rec.participating_friends.insert(item->PeerId()) ;
if(_should_reset_lobby_counts)
rec.total_number_of_peers = item->lobby_counts[i] ;
else
rec.total_number_of_peers = std::max(rec.total_number_of_peers,item->lobby_counts[i]) ;
rec.last_report_time = now ;
}
}
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_CHAT_LOBBY_LIST, NOTIFY_TYPE_ADD) ;
_should_reset_lobby_counts = false ;
}
void p3ChatService::handleRecvChatLobbyList(RsChatLobbyListItem *item)
{
{
@ -687,6 +729,7 @@ void p3ChatService::handleRecvChatLobbyList(RsChatLobbyListItem *item)
rec.lobby_id = item->lobby_ids[i] ;
rec.lobby_name = item->lobby_names[i] ;
rec.lobby_topic = item->lobby_topics[i] ;
rec.participating_friends.insert(item->PeerId()) ;
if(_should_reset_lobby_counts)
@ -1973,6 +2016,7 @@ void p3ChatService::invitePeerToLobby(const ChatLobbyId& lobby_id, const std::st
}
item->lobby_id = lobby_id ;
item->lobby_name = it->second.lobby_name ;
item->lobby_topic = it->second.lobby_topic ;
item->lobby_privacy_level = connexion_challenge?RS_CHAT_LOBBY_PRIVACY_LEVEL_CHALLENGE:(it->second.lobby_privacy_level) ;
item->PeerId(peer_id) ;
@ -1981,7 +2025,7 @@ void p3ChatService::invitePeerToLobby(const ChatLobbyId& lobby_id, const std::st
void p3ChatService::handleRecvLobbyInvite(RsChatLobbyInviteItem *item)
{
#ifdef CHAT_DEBUG
std::cerr << "Received invite to lobby from " << item->PeerId() << " to lobby " << std::hex << item->lobby_id << std::dec << ", named " << item->lobby_name << std::endl;
std::cerr << "Received invite to lobby from " << item->PeerId() << " to lobby " << std::hex << item->lobby_id << std::dec << ", named " << item->lobby_name << item->lobby_topic << std::endl;
#endif
// 1 - store invite in a cache
@ -2026,6 +2070,7 @@ void p3ChatService::handleRecvLobbyInvite(RsChatLobbyInviteItem *item)
invite.lobby_id = item->lobby_id ;
invite.peer_id = item->PeerId() ;
invite.lobby_name = item->lobby_name ;
invite.lobby_topic = item->lobby_topic ;
invite.lobby_privacy_level = item->lobby_privacy_level ;
_lobby_invites_queue[item->lobby_id] = invite ;
@ -2078,6 +2123,7 @@ bool p3ChatService::acceptLobbyInvite(const ChatLobbyId& lobby_id)
entry.nick_name = _default_nick_name ;
entry.lobby_id = lobby_id ;
entry.lobby_name = it->second.lobby_name ;
entry.lobby_topic = it->second.lobby_topic ;
entry.virtual_peer_id = makeVirtualPeerId(lobby_id) ;
entry.connexion_challenge_count = 0 ;
entry.last_activity = now ;
@ -2187,6 +2233,7 @@ bool p3ChatService::joinPublicChatLobby(const ChatLobbyId& lobby_id)
entry.nick_name = _default_nick_name ;
entry.lobby_id = lobby_id ;
entry.lobby_name = it->second.lobby_name ;
entry.lobby_topic = it->second.lobby_topic ;
entry.virtual_peer_id = makeVirtualPeerId(lobby_id) ;
entry.connexion_challenge_count = 0 ;
entry.last_activity = now ;
@ -2212,7 +2259,7 @@ bool p3ChatService::joinPublicChatLobby(const ChatLobbyId& lobby_id)
return true ;
}
ChatLobbyId p3ChatService::createChatLobby(const std::string& lobby_name,const std::list<std::string>& invited_friends,uint32_t privacy_level)
ChatLobbyId p3ChatService::createChatLobby(const std::string& lobby_name,const std::string& lobby_topic,const std::list<std::string>& invited_friends,uint32_t privacy_level)
{
#ifdef CHAT_DEBUG
std::cerr << "Creating a new Chat lobby !!" << std::endl;
@ -2236,6 +2283,7 @@ ChatLobbyId p3ChatService::createChatLobby(const std::string& lobby_name,const s
entry.nick_name = _default_nick_name ; // to be changed. For debug only!!
entry.lobby_id = lobby_id ;
entry.lobby_name = lobby_name ;
entry.lobby_topic = lobby_topic ;
entry.virtual_peer_id = makeVirtualPeerId(lobby_id) ;
entry.connexion_challenge_count = 0 ;
entry.last_activity = now ;

View file

@ -167,7 +167,7 @@ class p3ChatService: public p3Service, public p3Config, public pqiMonitor
bool setDefaultNickNameForChatLobby(const std::string& nick) ;
bool getDefaultNickNameForChatLobby(std::string& nick) ;
void sendLobbyStatusString(const ChatLobbyId& id,const std::string& status_string) ;
ChatLobbyId createChatLobby(const std::string& lobby_name,const std::list<std::string>& invited_friends,uint32_t privacy_type) ;
ChatLobbyId createChatLobby(const std::string& lobby_name,const std::string& lobby_topic, const std::list<std::string>& invited_friends,uint32_t privacy_type) ;
void getListOfNearbyChatLobbies(std::vector<PublicChatLobbyRecord>& public_lobbies) ;
bool joinPublicChatLobby(const ChatLobbyId& id) ;
@ -211,6 +211,7 @@ class p3ChatService: public p3Service, public p3Config, public pqiMonitor
void handleRecvChatAvatarItem(RsChatAvatarItem *item) ;
void handleRecvChatLobbyListRequest(RsChatLobbyListRequestItem *item) ;
void handleRecvChatLobbyList(RsChatLobbyListItem *item) ;
void handleRecvChatLobbyList(RsChatLobbyListItem_deprecated *item) ;
void handleRecvChatLobbyEventItem(RsChatLobbyEventItem *item) ;
/// Sends a request for an avatar to the peer of given id