mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Made the private lobbies more accessible:
- record which friend participates in a lobby even after they unsubscribed. The lobby list that is sent to these friends contains the privaye lobby as well. In practice, people jsut need to be invited once to a private lobby. Afterwards, they get the lobby in the list of nearby lobbies and can join by clicking on it. - added new item RsChatLobbyList_deprecated2, to replace old existing item. Should be removed in v0.6 - changed PublicLobbies for VisibleLobbies in the code, to avoid confusion - the change is backward compatible, although old peers won't receive private lobby info from new peers, of course. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5942 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8f7f00c6b9
commit
d01745e54f
@ -164,10 +164,10 @@ class ChatLobbyInvite
|
||||
std::string lobby_topic ;
|
||||
uint32_t lobby_privacy_level ;
|
||||
};
|
||||
class PublicChatLobbyRecord
|
||||
class VisibleChatLobbyRecord
|
||||
{
|
||||
public:
|
||||
PublicChatLobbyRecord() { total_number_of_peers = 0 ; }
|
||||
VisibleChatLobbyRecord() { total_number_of_peers = 0 ; }
|
||||
|
||||
ChatLobbyId lobby_id ; // unique id of the lobby
|
||||
std::string lobby_name ; // name to use for this lobby
|
||||
@ -176,6 +176,7 @@ class PublicChatLobbyRecord
|
||||
|
||||
uint32_t total_number_of_peers ; // total number of particpating peers. Might not be
|
||||
time_t last_report_time ; // last time the lobby was reported.
|
||||
uint32_t lobby_privacy_level ; // see RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC / RS_CHAT_LOBBY_PRIVACY_LEVEL_PRIVATE
|
||||
};
|
||||
class ChatLobbyInfo
|
||||
{
|
||||
@ -261,11 +262,11 @@ virtual void getAvatarData(const std::string& pid,unsigned char *& data,int& siz
|
||||
virtual void setOwnAvatarData(const unsigned char *data,int size) = 0 ;
|
||||
virtual void getOwnAvatarData(unsigned char *& data,int& size) = 0 ;
|
||||
|
||||
virtual bool joinPublicChatLobby(const ChatLobbyId& lobby_id) = 0 ;
|
||||
virtual bool joinVisibleChatLobby(const ChatLobbyId& lobby_id) = 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 getListOfNearbyChatLobbies(std::vector<PublicChatLobbyRecord>& public_lobbies) = 0 ;
|
||||
virtual void getListOfNearbyChatLobbies(std::vector<VisibleChatLobbyRecord>& public_lobbies) = 0 ;
|
||||
virtual void invitePeerToLobby(const ChatLobbyId& lobby_id,const std::string& peer_id) = 0;
|
||||
virtual bool acceptLobbyInvite(const ChatLobbyId& id) = 0 ;
|
||||
virtual void denyLobbyInvite(const ChatLobbyId& id) = 0 ;
|
||||
|
@ -303,12 +303,12 @@ bool p3Msgs::getNickNameForChatLobby(const ChatLobbyId& lobby_id,std::string& ni
|
||||
return mChatSrv->getNickNameForChatLobby(lobby_id,nick_name) ;
|
||||
}
|
||||
|
||||
bool p3Msgs::joinPublicChatLobby(const ChatLobbyId& lobby_id)
|
||||
bool p3Msgs::joinVisibleChatLobby(const ChatLobbyId& lobby_id)
|
||||
{
|
||||
return mChatSrv->joinPublicChatLobby(lobby_id) ;
|
||||
return mChatSrv->joinVisibleChatLobby(lobby_id) ;
|
||||
}
|
||||
|
||||
void p3Msgs::getListOfNearbyChatLobbies(std::vector<PublicChatLobbyRecord>& public_lobbies)
|
||||
void p3Msgs::getListOfNearbyChatLobbies(std::vector<VisibleChatLobbyRecord>& public_lobbies)
|
||||
{
|
||||
mChatSrv->getListOfNearbyChatLobbies(public_lobbies) ;
|
||||
}
|
||||
|
@ -167,8 +167,8 @@ class p3Msgs: public RsMsgs
|
||||
|
||||
/****************************************/
|
||||
|
||||
virtual bool joinPublicChatLobby(const ChatLobbyId& id) ;
|
||||
virtual void getListOfNearbyChatLobbies(std::vector<PublicChatLobbyRecord>& public_lobbies) ;
|
||||
virtual bool joinVisibleChatLobby(const ChatLobbyId& id) ;
|
||||
virtual void getListOfNearbyChatLobbies(std::vector<VisibleChatLobbyRecord>& public_lobbies) ;
|
||||
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> >&) ;
|
||||
|
@ -56,6 +56,19 @@ std::ostream& RsChatMsgItem::print(std::ostream &out, uint16_t indent)
|
||||
printRsItemEnd(out, "RsChatMsgItem", indent);
|
||||
return out;
|
||||
}
|
||||
std::ostream& RsChatLobbyListItem_deprecated2::print(std::ostream &out, uint16_t indent)
|
||||
{
|
||||
printRsItemBase(out, "RsChatLobbyListItem_deprecated2", 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] << "\", topic="<< lobby_topics[i] << "\", count=" << lobby_counts[i] << std::endl ;
|
||||
}
|
||||
|
||||
printRsItemEnd(out, "RsChatLobbyListItem_deprecated2", indent);
|
||||
return out;
|
||||
}
|
||||
std::ostream& RsChatLobbyListItem_deprecated::print(std::ostream &out, uint16_t indent)
|
||||
{
|
||||
printRsItemBase(out, "RsChatLobbyListItem_deprecated", indent);
|
||||
@ -76,7 +89,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] << "\", topic="<< lobby_topics[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] << ", privacy_level = " << lobby_privacy_levels[i] << std::endl ;
|
||||
}
|
||||
|
||||
printRsItemEnd(out, "RsChatLobbyListItem", indent);
|
||||
@ -242,6 +255,7 @@ RsItem *RsChatSerialiser::deserialise(void *data, uint32_t *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) ;
|
||||
case RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_deprecated2:return new RsChatLobbyListItem_deprecated2(data,*pktsize) ;
|
||||
default:
|
||||
std::cerr << "Unknown packet type in chat!" << std::endl ;
|
||||
return NULL ;
|
||||
@ -299,6 +313,21 @@ uint32_t RsChatLobbyListRequestItem::serial_size()
|
||||
uint32_t s = 8 ; // header
|
||||
return s ;
|
||||
}
|
||||
uint32_t RsChatLobbyListItem_deprecated2::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
|
||||
|
||||
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 RsChatLobbyListItem_deprecated::serial_size()
|
||||
{
|
||||
uint32_t s = 8 ; // header
|
||||
@ -324,6 +353,7 @@ uint32_t RsChatLobbyListItem::serial_size()
|
||||
s += GetTlvStringSize(lobby_topics[i]) ; // lobby_topics
|
||||
|
||||
s += lobby_counts.size() * 4 ; // lobby_counts
|
||||
s += lobby_privacy_levels.size() * 4 ; // lobby_privacy_levels
|
||||
return s ;
|
||||
}
|
||||
uint32_t RsChatLobbyMsgItem::serial_size()
|
||||
@ -524,6 +554,41 @@ bool RsChatLobbyListItem_deprecated::serialise(void *data, uint32_t& pktsize)
|
||||
}
|
||||
return ok ;
|
||||
}
|
||||
bool RsChatLobbyListItem_deprecated2::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 &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_NAME, lobby_topics[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() ;
|
||||
@ -547,8 +612,9 @@ 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 &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_NAME, lobby_topics[i]);
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, lobby_counts[i]);
|
||||
ok &= setRawUInt32(data, tlvsize, &offset, lobby_privacy_levels[i]);
|
||||
}
|
||||
if (offset != tlvsize)
|
||||
{
|
||||
@ -884,6 +950,34 @@ RsChatLobbyListItem_deprecated::RsChatLobbyListItem_deprecated(void *data,uint32
|
||||
if (!ok)
|
||||
std::cerr << "Unknown error while deserializing." << std::endl ;
|
||||
}
|
||||
RsChatLobbyListItem_deprecated2::RsChatLobbyListItem_deprecated2(void *data,uint32_t)
|
||||
: RsChatItem(RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_deprecated2)
|
||||
{
|
||||
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 ;
|
||||
}
|
||||
RsChatLobbyListItem::RsChatLobbyListItem(void *data,uint32_t)
|
||||
: RsChatItem(RS_PKT_SUBTYPE_CHAT_LOBBY_LIST)
|
||||
{
|
||||
@ -896,15 +990,17 @@ RsChatLobbyListItem::RsChatLobbyListItem(void *data,uint32_t)
|
||||
|
||||
lobby_ids.resize(n) ;
|
||||
lobby_names.resize(n) ;
|
||||
lobby_topics.resize(n) ;
|
||||
lobby_topics.resize(n) ;
|
||||
lobby_counts.resize(n) ;
|
||||
lobby_privacy_levels.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 &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_NAME, lobby_topics[i]);
|
||||
ok &= getRawUInt32(data, rssize, &offset, &lobby_counts[i]);
|
||||
ok &= getRawUInt32(data, rssize, &offset, &lobby_privacy_levels[i]);
|
||||
}
|
||||
|
||||
if (offset != rssize)
|
||||
|
@ -59,10 +59,11 @@ 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_deprecated = 0x0E ;
|
||||
const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_deprecated = 0x0E ; // to be removed
|
||||
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 ;
|
||||
const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_deprecated2 = 0x11 ; // to be removed (deprecated since 02 Dec. 2012)
|
||||
const uint8_t RS_PKT_SUBTYPE_CHAT_LOBBY_LIST = 0x12 ;
|
||||
|
||||
// for defining tags themselves and msg tags
|
||||
const uint8_t RS_PKT_SUBTYPE_MSG_TAG_TYPE = 0x03;
|
||||
@ -200,6 +201,23 @@ class RsChatLobbyListItem_deprecated: public RsChatItem
|
||||
std::vector<std::string> lobby_names ;
|
||||
std::vector<uint32_t> lobby_counts ;
|
||||
};
|
||||
class RsChatLobbyListItem_deprecated2: public RsChatItem
|
||||
{
|
||||
public:
|
||||
RsChatLobbyListItem_deprecated2() : RsChatItem(RS_PKT_SUBTYPE_CHAT_LOBBY_LIST_deprecated2) {}
|
||||
RsChatLobbyListItem_deprecated2(void *data,uint32_t size) ;
|
||||
virtual ~RsChatLobbyListItem_deprecated2() {}
|
||||
|
||||
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<std::string> lobby_topics ;
|
||||
std::vector<uint32_t> lobby_counts ;
|
||||
};
|
||||
class RsChatLobbyListItem: public RsChatItem
|
||||
{
|
||||
public:
|
||||
@ -216,6 +234,7 @@ class RsChatLobbyListItem: public RsChatItem
|
||||
std::vector<std::string> lobby_names ;
|
||||
std::vector<std::string> lobby_topics ;
|
||||
std::vector<uint32_t> lobby_counts ;
|
||||
std::vector<uint32_t> lobby_privacy_levels ;
|
||||
};
|
||||
class RsChatLobbyUnsubscribeItem: public RsChatItem
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ p3ChatService::p3ChatService(p3LinkMgr *lm, p3HistoryMgr *historyMgr)
|
||||
_default_nick_name = rsPeers->getPeerName(rsPeers->getOwnId());
|
||||
_should_reset_lobby_counts = false ;
|
||||
|
||||
last_public_lobby_info_request_time = 0 ;
|
||||
last_visible_lobby_info_request_time = 0 ;
|
||||
}
|
||||
|
||||
int p3ChatService::tick()
|
||||
@ -348,7 +348,7 @@ void p3ChatService::locked_printDebugInfo() const
|
||||
|
||||
std::cerr << "Visible public lobbies: " << std::endl;
|
||||
|
||||
for( std::map<ChatLobbyId,PublicChatLobbyRecord>::const_iterator it(_public_lobbies.begin()) ;it!=_public_lobbies.end();++it)
|
||||
for( std::map<ChatLobbyId,VisibleChatLobbyRecord>::const_iterator it(_visible_lobbies.begin()) ;it!=_visible_lobbies.end();++it)
|
||||
{
|
||||
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)
|
||||
@ -654,7 +654,13 @@ void p3ChatService::handleRecvChatLobbyListRequest(RsChatLobbyListRequestItem *c
|
||||
RsStackMutex stack(mChatMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
for(std::map<ChatLobbyId,ChatLobbyEntry>::const_iterator it(_chat_lobbys.begin());it!=_chat_lobbys.end();++it)
|
||||
if(it->second.lobby_privacy_level == RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC)
|
||||
{
|
||||
const ChatLobbyEntry& lobby(it->second) ;
|
||||
|
||||
if(lobby.lobby_privacy_level == RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC
|
||||
|| (lobby.lobby_privacy_level == RS_CHAT_LOBBY_PRIVACY_LEVEL_PRIVATE
|
||||
&& (lobby.previously_known_peers.find(clr->PeerId()) != lobby.previously_known_peers.end()
|
||||
||lobby.participating_friends.find(clr->PeerId()) != lobby.participating_friends.end()) ))
|
||||
{
|
||||
#ifdef CHAT_DEBUG
|
||||
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;
|
||||
@ -662,13 +668,15 @@ void p3ChatService::handleRecvChatLobbyListRequest(RsChatLobbyListRequestItem *c
|
||||
|
||||
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_topics.push_back(it->second.lobby_topic) ;
|
||||
item->lobby_counts.push_back(it->second.nick_names.size()) ;
|
||||
item->lobby_privacy_levels.push_back(it->second.lobby_privacy_level) ;
|
||||
}
|
||||
#ifdef CHAT_DEBUG
|
||||
else
|
||||
std::cerr << " Not adding private lobby " << std::hex << it->first << std::dec << std::endl ;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
item->PeerId(clr->PeerId()) ;
|
||||
@ -678,15 +686,29 @@ void p3ChatService::handleRecvChatLobbyListRequest(RsChatLobbyListRequestItem *c
|
||||
#endif
|
||||
sendItem(item);
|
||||
|
||||
// *********** Also send an item in old format. To be removed.
|
||||
// *********** Also send an item in old formats. 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 ;
|
||||
RsChatLobbyListItem_deprecated2 *itemd2 = new RsChatLobbyListItem_deprecated2;
|
||||
|
||||
for(uint32_t i=0;i<item->lobby_ids.size();++i)
|
||||
if(item->lobby_privacy_levels[i] == RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC)
|
||||
{
|
||||
itemd->lobby_ids.push_back(item->lobby_ids[i]) ;
|
||||
itemd->lobby_names.push_back(item->lobby_names[i]) ;
|
||||
itemd->lobby_counts.push_back(item->lobby_counts[i]) ;
|
||||
|
||||
itemd2->lobby_ids.push_back(item->lobby_ids[i]) ;
|
||||
itemd2->lobby_names.push_back(item->lobby_names[i]) ;
|
||||
itemd2->lobby_counts.push_back(item->lobby_counts[i]) ;
|
||||
itemd2->lobby_topics.push_back(item->lobby_topics[i]) ;
|
||||
}
|
||||
|
||||
itemd->PeerId(clr->PeerId()) ;
|
||||
itemd2->PeerId(clr->PeerId()) ;
|
||||
|
||||
sendItem(itemd) ;
|
||||
sendItem(itemd2) ;
|
||||
|
||||
// End of part to remove in future versions. *************
|
||||
}
|
||||
@ -699,7 +721,7 @@ void p3ChatService::handleRecvChatLobbyList(RsChatLobbyListItem_deprecated *item
|
||||
|
||||
for(uint32_t i=0;i<item->lobby_ids.size();++i)
|
||||
{
|
||||
PublicChatLobbyRecord& rec(_public_lobbies[item->lobby_ids[i]]) ;
|
||||
VisibleChatLobbyRecord& rec(_visible_lobbies[item->lobby_ids[i]]) ;
|
||||
|
||||
rec.lobby_id = item->lobby_ids[i] ;
|
||||
rec.lobby_name = item->lobby_names[i] ;
|
||||
@ -711,6 +733,36 @@ void p3ChatService::handleRecvChatLobbyList(RsChatLobbyListItem_deprecated *item
|
||||
rec.total_number_of_peers = std::max(rec.total_number_of_peers,item->lobby_counts[i]) ;
|
||||
|
||||
rec.last_report_time = now ;
|
||||
rec.lobby_privacy_level = RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC ;
|
||||
}
|
||||
}
|
||||
|
||||
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_CHAT_LOBBY_LIST, NOTIFY_TYPE_ADD) ;
|
||||
_should_reset_lobby_counts = false ;
|
||||
}
|
||||
void p3ChatService::handleRecvChatLobbyList(RsChatLobbyListItem_deprecated2 *item)
|
||||
{
|
||||
{
|
||||
time_t now = time(NULL) ;
|
||||
|
||||
RsStackMutex stack(mChatMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
for(uint32_t i=0;i<item->lobby_ids.size();++i)
|
||||
{
|
||||
VisibleChatLobbyRecord& rec(_visible_lobbies[item->lobby_ids[i]]) ;
|
||||
|
||||
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)
|
||||
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 ;
|
||||
rec.lobby_privacy_level = RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -726,7 +778,7 @@ void p3ChatService::handleRecvChatLobbyList(RsChatLobbyListItem *item)
|
||||
|
||||
for(uint32_t i=0;i<item->lobby_ids.size();++i)
|
||||
{
|
||||
PublicChatLobbyRecord& rec(_public_lobbies[item->lobby_ids[i]]) ;
|
||||
VisibleChatLobbyRecord& rec(_visible_lobbies[item->lobby_ids[i]]) ;
|
||||
|
||||
rec.lobby_id = item->lobby_ids[i] ;
|
||||
rec.lobby_name = item->lobby_names[i] ;
|
||||
@ -739,13 +791,13 @@ void p3ChatService::handleRecvChatLobbyList(RsChatLobbyListItem *item)
|
||||
rec.total_number_of_peers = std::max(rec.total_number_of_peers,item->lobby_counts[i]) ;
|
||||
|
||||
rec.last_report_time = now ;
|
||||
rec.lobby_privacy_level = item->lobby_privacy_levels[i] ;
|
||||
}
|
||||
}
|
||||
|
||||
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_CHAT_LOBBY_LIST, NOTIFY_TYPE_ADD) ;
|
||||
_should_reset_lobby_counts = false ;
|
||||
}
|
||||
|
||||
void p3ChatService::handleRecvChatLobbyEventItem(RsChatLobbyEventItem *item)
|
||||
{
|
||||
#ifdef CHAT_DEBUG
|
||||
@ -1007,20 +1059,20 @@ void p3ChatService::handleRecvChatStatusItem(RsChatStatusItem *cs)
|
||||
rsicontrol->getNotify().notifyChatStatus(cs->PeerId(),cs->status_string,false) ;
|
||||
}
|
||||
|
||||
void p3ChatService::getListOfNearbyChatLobbies(std::vector<PublicChatLobbyRecord>& public_lobbies)
|
||||
void p3ChatService::getListOfNearbyChatLobbies(std::vector<VisibleChatLobbyRecord>& visible_lobbies)
|
||||
{
|
||||
{
|
||||
RsStackMutex stack(mChatMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
public_lobbies.clear() ;
|
||||
visible_lobbies.clear() ;
|
||||
|
||||
for(std::map<ChatLobbyId,PublicChatLobbyRecord>::const_iterator it(_public_lobbies.begin());it!=_public_lobbies.end();++it)
|
||||
public_lobbies.push_back(it->second) ;
|
||||
for(std::map<ChatLobbyId,VisibleChatLobbyRecord>::const_iterator it(_visible_lobbies.begin());it!=_visible_lobbies.end();++it)
|
||||
visible_lobbies.push_back(it->second) ;
|
||||
}
|
||||
|
||||
time_t now = time(NULL) ;
|
||||
|
||||
if(now > MIN_DELAY_BETWEEN_PUBLIC_LOBBY_REQ + last_public_lobby_info_request_time)
|
||||
if(now > MIN_DELAY_BETWEEN_PUBLIC_LOBBY_REQ + last_visible_lobby_info_request_time)
|
||||
{
|
||||
std::list<std::string> ids ;
|
||||
mLinkMgr->getOnlineList(ids);
|
||||
@ -1035,7 +1087,7 @@ void p3ChatService::getListOfNearbyChatLobbies(std::vector<PublicChatLobbyRecord
|
||||
|
||||
sendItem(item);
|
||||
}
|
||||
last_public_lobby_info_request_time = now ;
|
||||
last_visible_lobby_info_request_time = now ;
|
||||
_should_reset_lobby_counts = true ;
|
||||
}
|
||||
}
|
||||
@ -2214,7 +2266,7 @@ void p3ChatService::denyLobbyInvite(const ChatLobbyId& lobby_id)
|
||||
_lobby_invites_queue.erase(it) ;
|
||||
}
|
||||
|
||||
bool p3ChatService::joinPublicChatLobby(const ChatLobbyId& lobby_id)
|
||||
bool p3ChatService::joinVisibleChatLobby(const ChatLobbyId& lobby_id)
|
||||
{
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "Joining public chat lobby " << std::hex << lobby_id << std::dec << std::endl;
|
||||
@ -2226,9 +2278,9 @@ bool p3ChatService::joinPublicChatLobby(const ChatLobbyId& lobby_id)
|
||||
|
||||
// create a unique id.
|
||||
//
|
||||
std::map<ChatLobbyId,PublicChatLobbyRecord>::const_iterator it(_public_lobbies.find(lobby_id)) ;
|
||||
std::map<ChatLobbyId,VisibleChatLobbyRecord>::const_iterator it(_visible_lobbies.find(lobby_id)) ;
|
||||
|
||||
if(it == _public_lobbies.end())
|
||||
if(it == _visible_lobbies.end())
|
||||
{
|
||||
std::cerr << " lobby is not a known public chat lobby. Sorry!" << std::endl;
|
||||
return false ;
|
||||
@ -2252,12 +2304,12 @@ bool p3ChatService::joinPublicChatLobby(const ChatLobbyId& lobby_id)
|
||||
time_t now = time(NULL) ;
|
||||
|
||||
ChatLobbyEntry entry ;
|
||||
entry.lobby_privacy_level = RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC ;
|
||||
entry.lobby_privacy_level = it->second.lobby_privacy_level ;//RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC ;
|
||||
entry.participating_friends.clear() ;
|
||||
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.lobby_topic = it->second.lobby_topic ;
|
||||
entry.virtual_peer_id = makeVirtualPeerId(lobby_id) ;
|
||||
entry.connexion_challenge_count = 0 ;
|
||||
entry.last_activity = now ;
|
||||
@ -2307,7 +2359,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.lobby_topic = lobby_topic ;
|
||||
entry.virtual_peer_id = makeVirtualPeerId(lobby_id) ;
|
||||
entry.connexion_challenge_count = 0 ;
|
||||
entry.last_activity = now ;
|
||||
@ -2348,6 +2400,7 @@ void p3ChatService::handleFriendUnsubscribeLobby(RsChatLobbyUnsubscribeItem *ite
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << " removing peer id " << item->PeerId() << " from participant list of lobby " << std::hex << item->lobby_id << std::dec << std::endl;
|
||||
#endif
|
||||
it->second.previously_known_peers.insert(*it2) ;
|
||||
it->second.participating_friends.erase(it2) ;
|
||||
break ;
|
||||
}
|
||||
@ -2580,16 +2633,16 @@ void p3ChatService::cleanLobbyCaches()
|
||||
// 2 - clean deprecated public chat lobby records
|
||||
//
|
||||
|
||||
for(std::map<ChatLobbyId,PublicChatLobbyRecord>::iterator it(_public_lobbies.begin());it!=_public_lobbies.end();)
|
||||
for(std::map<ChatLobbyId,VisibleChatLobbyRecord>::iterator it(_visible_lobbies.begin());it!=_visible_lobbies.end();)
|
||||
if(it->second.last_report_time + MAX_KEEP_PUBLIC_LOBBY_RECORD < now) // this lobby record is too late.
|
||||
{
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << " removing old public lobby record 0x" << std::hex << it->first << ", time=" << std::dec << now - it->second.last_report_time << " secs ago" << std::endl;
|
||||
#endif
|
||||
|
||||
std::map<ChatLobbyMsgId,PublicChatLobbyRecord>::iterator tmp(it) ;
|
||||
std::map<ChatLobbyMsgId,VisibleChatLobbyRecord>::iterator tmp(it) ;
|
||||
++tmp ;
|
||||
_public_lobbies.erase(it) ;
|
||||
_visible_lobbies.erase(it) ;
|
||||
it = tmp ;
|
||||
}
|
||||
else
|
||||
|
@ -169,8 +169,8 @@ class p3ChatService: public p3Service, public p3Config, public pqiMonitor
|
||||
void sendLobbyStatusString(const ChatLobbyId& id,const std::string& status_string) ;
|
||||
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) ;
|
||||
void getListOfNearbyChatLobbies(std::vector<VisibleChatLobbyRecord>& public_lobbies) ;
|
||||
bool joinVisibleChatLobby(const ChatLobbyId& id) ;
|
||||
|
||||
protected:
|
||||
/************* from p3Config *******************/
|
||||
@ -212,6 +212,7 @@ class p3ChatService: public p3Service, public p3Config, public pqiMonitor
|
||||
void handleRecvChatLobbyListRequest(RsChatLobbyListRequestItem *item) ;
|
||||
void handleRecvChatLobbyList(RsChatLobbyListItem *item) ;
|
||||
void handleRecvChatLobbyList(RsChatLobbyListItem_deprecated *item) ;
|
||||
void handleRecvChatLobbyList(RsChatLobbyListItem_deprecated2 *item) ;
|
||||
void handleRecvChatLobbyEventItem(RsChatLobbyEventItem *item) ;
|
||||
|
||||
/// Sends a request for an avatar to the peer of given id
|
||||
@ -277,15 +278,16 @@ class p3ChatService: public p3Service, public p3Config, public pqiMonitor
|
||||
int connexion_challenge_count ;
|
||||
time_t last_connexion_challenge_time ;
|
||||
time_t last_keep_alive_packet_time ;
|
||||
std::set<std::string> previously_known_peers ;
|
||||
};
|
||||
|
||||
std::map<ChatLobbyId,ChatLobbyEntry> _chat_lobbys ;
|
||||
std::map<ChatLobbyId,ChatLobbyInvite> _lobby_invites_queue ;
|
||||
std::map<ChatLobbyId,PublicChatLobbyRecord> _public_lobbies ;
|
||||
std::map<ChatLobbyId,VisibleChatLobbyRecord> _visible_lobbies ;
|
||||
std::map<std::string,ChatLobbyId> _lobby_ids ;
|
||||
std::string _default_nick_name ;
|
||||
time_t last_lobby_challenge_time ; // prevents bruteforce attack
|
||||
time_t last_public_lobby_info_request_time ; // allows to ask for updates
|
||||
time_t last_visible_lobby_info_request_time ; // allows to ask for updates
|
||||
bool _should_reset_lobby_counts ;
|
||||
};
|
||||
|
||||
|
@ -153,68 +153,80 @@ void ChatLobbyWidget::updateDisplay()
|
||||
#ifdef CHAT_LOBBY_GUI_DEBUG
|
||||
std::cerr << "updating chat lobby display!" << std::endl;
|
||||
#endif
|
||||
std::vector<PublicChatLobbyRecord> publicLobbies;
|
||||
rsMsgs->getListOfNearbyChatLobbies(publicLobbies);
|
||||
std::vector<VisibleChatLobbyRecord> visibleLobbies;
|
||||
rsMsgs->getListOfNearbyChatLobbies(visibleLobbies);
|
||||
|
||||
std::list<ChatLobbyInfo> lobbies;
|
||||
rsMsgs->getChatLobbyList(lobbies);
|
||||
|
||||
#ifdef CHAT_LOBBY_GUI_DEBUG
|
||||
std::cerr << "got " << publicLobbies.size() << " public lobbies, and " << lobbies.size() << " private lobbies." << std::endl;
|
||||
std::cerr << "got " << visibleLobbies.size() << " visible lobbies, and " << lobbies.size() << " private lobbies." << std::endl;
|
||||
#endif
|
||||
|
||||
// now, do a nice display of lobbies
|
||||
|
||||
std::string vpid;
|
||||
uint32_t i;
|
||||
uint32_t size = publicLobbies.size();
|
||||
uint32_t size = visibleLobbies.size();
|
||||
std::list<ChatLobbyInfo>::const_iterator lobbyIt;
|
||||
|
||||
// remove not existing public lobbies
|
||||
int childCount = publicLobbyItem->childCount();
|
||||
int childIndex = 0;
|
||||
while (childIndex < childCount) {
|
||||
QTreeWidgetItem *itemLoop = publicLobbyItem->child(childIndex);
|
||||
if (itemLoop->type() == TYPE_LOBBY) {
|
||||
// check for public lobby
|
||||
for (i = 0; i < size; ++i) {
|
||||
if (itemLoop->data(COLUMN_DATA, ROLE_ID).toULongLong() == publicLobbies[i].lobby_id) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= size) {
|
||||
// check for private lobby with public level
|
||||
for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) {
|
||||
if (lobbyIt->lobby_privacy_level == RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC &&
|
||||
itemLoop->data(COLUMN_DATA, ROLE_ID).toULongLong() == lobbyIt->lobby_id) {
|
||||
for(int p=0;p<2;++p)
|
||||
{
|
||||
QTreeWidgetItem *lobby_item = (p==0)?publicLobbyItem:privateLobbyItem ;
|
||||
|
||||
int childCnt = lobby_item->childCount();
|
||||
int childIndex = 0;
|
||||
|
||||
while (childIndex < childCnt) {
|
||||
QTreeWidgetItem *itemLoop = lobby_item->child(childIndex);
|
||||
if (itemLoop->type() == TYPE_LOBBY)
|
||||
{
|
||||
// check for visible lobby
|
||||
for (i = 0; i < size; ++i)
|
||||
if (itemLoop->data(COLUMN_DATA, ROLE_ID).toULongLong() == visibleLobbies[i].lobby_id)
|
||||
break;
|
||||
|
||||
if (i >= size)
|
||||
{
|
||||
// Check for participating lobby with public level
|
||||
//
|
||||
for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt)
|
||||
if(itemLoop->data(COLUMN_DATA, ROLE_ID).toULongLong() == lobbyIt->lobby_id)
|
||||
break;
|
||||
|
||||
if (lobbyIt == lobbies.end())
|
||||
{
|
||||
delete(lobby_item->takeChild(lobby_item->indexOfChild(itemLoop)));
|
||||
childCnt = lobby_item->childCount();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (lobbyIt == lobbies.end()) {
|
||||
delete(publicLobbyItem->takeChild(publicLobbyItem->indexOfChild(itemLoop)));
|
||||
childCount = publicLobbyItem->childCount();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
childIndex++;
|
||||
}
|
||||
childIndex++;
|
||||
}
|
||||
|
||||
for (i = 0; i < size; ++i) {
|
||||
const PublicChatLobbyRecord &lobby = publicLobbies[i];
|
||||
// Now add visible lobbies
|
||||
//
|
||||
for (i = 0; i < size; ++i)
|
||||
{
|
||||
const VisibleChatLobbyRecord &lobby = visibleLobbies[i];
|
||||
|
||||
#ifdef CHAT_LOBBY_GUI_DEBUG
|
||||
std::cerr << "adding " << lobby.lobby_name << "topic " << lobby.lobby_topic << " #" << std::hex << lobby.lobby_id << std::dec << " public " << lobby.total_number_of_peers << " peers." << std::endl;
|
||||
std::cerr << "adding " << lobby.lobby_name << "topic " << lobby.lobby_topic << " #" << std::hex << lobby.lobby_id << std::dec << " public " << lobby.total_number_of_peers << " peers. Lobby type: " << lobby.lobby_privacy_level << std::endl;
|
||||
#endif
|
||||
|
||||
QTreeWidgetItem *item = NULL;
|
||||
QTreeWidgetItem *lobby_item = (visibleLobbies[i].lobby_privacy_level == RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC)?publicLobbyItem:privateLobbyItem ;
|
||||
|
||||
// search existing item
|
||||
childCount = publicLobbyItem->childCount();
|
||||
for (childIndex = 0; childIndex < childCount; childIndex++) {
|
||||
QTreeWidgetItem *itemLoop = publicLobbyItem->child(childIndex);
|
||||
// Search existing item
|
||||
//
|
||||
int childCnt = lobby_item->childCount();
|
||||
for (int childIndex = 0; childIndex < childCnt; childIndex++)
|
||||
{
|
||||
QTreeWidgetItem *itemLoop = lobby_item->child(childIndex);
|
||||
if (itemLoop->type() == TYPE_LOBBY && itemLoop->data(COLUMN_DATA, ROLE_ID).toULongLong() == lobby.lobby_id) {
|
||||
item = itemLoop;
|
||||
break;
|
||||
@ -223,10 +235,13 @@ void ChatLobbyWidget::updateDisplay()
|
||||
|
||||
if (item == NULL) {
|
||||
item = new RSTreeWidgetItem(compareRole, TYPE_LOBBY);
|
||||
publicLobbyItem->addChild(item);
|
||||
lobby_item->addChild(item);
|
||||
}
|
||||
|
||||
item->setIcon(COLUMN_NAME, QIcon(IMAGE_PUBLIC));
|
||||
if(lobby_item == publicLobbyItem)
|
||||
item->setIcon(COLUMN_NAME, QIcon(IMAGE_PUBLIC));
|
||||
else
|
||||
item->setIcon(COLUMN_NAME, QIcon(IMAGE_PRIVATE));
|
||||
|
||||
bool subscribed = false;
|
||||
if (rsMsgs->getVirtualPeerId(lobby.lobby_id, vpid)) {
|
||||
@ -236,29 +251,10 @@ void ChatLobbyWidget::updateDisplay()
|
||||
updateItem(item, lobby.lobby_id, lobby.lobby_name,lobby.lobby_topic, lobby.total_number_of_peers, subscribed);
|
||||
}
|
||||
|
||||
// remove not existing private lobbies
|
||||
childCount = privateLobbyItem->childCount();
|
||||
childIndex = 0;
|
||||
while (childIndex < childCount) {
|
||||
QTreeWidgetItem *itemLoop = privateLobbyItem->child(childIndex);
|
||||
if (itemLoop->type() == TYPE_LOBBY) {
|
||||
for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) {
|
||||
if (lobbyIt->lobby_privacy_level == RS_CHAT_LOBBY_PRIVACY_LEVEL_PRIVATE &&
|
||||
itemLoop->data(COLUMN_DATA, ROLE_ID).toULongLong() == lobbyIt->lobby_id) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (lobbyIt == lobbies.end()) {
|
||||
delete(privateLobbyItem->takeChild(privateLobbyItem->indexOfChild(itemLoop)));
|
||||
childCount = privateLobbyItem->childCount();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
childIndex++;
|
||||
}
|
||||
|
||||
for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) {
|
||||
// Now add participating lobbies.
|
||||
//
|
||||
for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt)
|
||||
{
|
||||
const ChatLobbyInfo &lobby = *lobbyIt;
|
||||
|
||||
#ifdef CHAT_LOBBY_GUI_DEBUG
|
||||
@ -275,8 +271,8 @@ void ChatLobbyWidget::updateDisplay()
|
||||
QTreeWidgetItem *item = NULL;
|
||||
|
||||
// search existing item
|
||||
childCount = itemParent->childCount();
|
||||
for (childIndex = 0; childIndex < childCount; childIndex++) {
|
||||
int childCount = itemParent->childCount();
|
||||
for (int childIndex = 0; childIndex < childCount; childIndex++) {
|
||||
QTreeWidgetItem *itemLoop = itemParent->child(childIndex);
|
||||
if (itemLoop->type() == TYPE_LOBBY && itemLoop->data(COLUMN_DATA, ROLE_ID).toULongLong() == lobby.lobby_id) {
|
||||
item = itemLoop;
|
||||
@ -318,7 +314,7 @@ static void subscribeLobby(QTreeWidgetItem *item)
|
||||
}
|
||||
|
||||
ChatLobbyId id = item->data(COLUMN_DATA, ROLE_ID).toULongLong();
|
||||
if (rsMsgs->joinPublicChatLobby(id)) {
|
||||
if (rsMsgs->joinVisibleChatLobby(id)) {
|
||||
std::string vpeer_id;
|
||||
if (rsMsgs->getVirtualPeerId(id, vpeer_id)) {
|
||||
ChatDialog::chatFriend(vpeer_id) ;
|
||||
|
Loading…
Reference in New Issue
Block a user