mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-14 00:49:41 -05:00
fixed bug in previous commit for chat lobbies
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8386 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ea7a5a5929
commit
377eb50c6e
@ -1622,14 +1622,14 @@ bool DistributedChatService::getIdentityForChatLobby(const ChatLobbyId& lobby_id
|
|||||||
bool DistributedChatService::setIdentityForChatLobby(const ChatLobbyId& lobby_id,const RsGxsId& nick)
|
bool DistributedChatService::setIdentityForChatLobby(const ChatLobbyId& lobby_id,const RsGxsId& nick)
|
||||||
{
|
{
|
||||||
if (nick.isNull())
|
if (nick.isNull())
|
||||||
{
|
{
|
||||||
std::cerr << "(EE) Ignore empty nickname for chat lobby " << nick << std::endl;
|
std::cerr << "(EE) Ignore empty nickname for chat lobby " << nick << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// first check for change and send status peer changed nick name
|
// first check for change and send status peer changed nick name
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
std::map<ChatLobbyId,ChatLobbyEntry>::iterator it;
|
std::map<ChatLobbyId,ChatLobbyEntry>::iterator it;
|
||||||
|
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mDistributedChatMtx); /********** STACK LOCKED MTX ******/
|
RsStackMutex stack(mDistributedChatMtx); /********** STACK LOCKED MTX ******/
|
||||||
@ -1646,36 +1646,36 @@ bool DistributedChatService::setIdentityForChatLobby(const ChatLobbyId& lobby_id
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!it->second.gxs_id.isNull() && it->second.gxs_id != nick)
|
if (!it->second.gxs_id.isNull() && it->second.gxs_id != nick)
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
{
|
||||||
|
// Inform other peers of change the Nickname
|
||||||
{
|
{
|
||||||
RsIdentityDetails det1,det2 ;
|
RsIdentityDetails det1,det2 ;
|
||||||
|
|
||||||
// Only send a nickname change event if the two Identities are not anonymous
|
// Only send a nickname change event if the two Identities are not anonymous
|
||||||
|
|
||||||
if(rsIdentity->getIdDetails(nick,det1) && rsIdentity->getIdDetails(it->second.gxs_id,det2) && det1.mPgpLinked && det2.mPgpLinked)
|
if(rsIdentity->getIdDetails(nick,det1) && rsIdentity->getIdDetails(it->second.gxs_id,det2) && det1.mPgpLinked && det2.mPgpLinked)
|
||||||
changed = true;
|
sendLobbyStatusPeerChangedNickname(lobby_id, nick.toStdString()) ;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (changed)
|
// set new nick name
|
||||||
{
|
RsStackMutex stack(mDistributedChatMtx); /********** STACK LOCKED MTX ******/
|
||||||
// Inform other peers of change the Nickname
|
|
||||||
sendLobbyStatusPeerChangedNickname(lobby_id, nick.toStdString()) ;
|
|
||||||
|
|
||||||
// set new nick name
|
it = _chat_lobbys.find(lobby_id) ;
|
||||||
RsStackMutex stack(mDistributedChatMtx); /********** STACK LOCKED MTX ******/
|
|
||||||
|
|
||||||
it = _chat_lobbys.find(lobby_id) ;
|
if(it == _chat_lobbys.end())
|
||||||
|
{
|
||||||
if(it == _chat_lobbys.end())
|
std::cerr << " (EE) lobby does not exist!!" << std::endl;
|
||||||
{
|
return false;
|
||||||
std::cerr << " (EE) lobby does not exist!!" << std::endl;
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
it->second.gxs_id = nick ;
|
it->second.gxs_id = nick ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DistributedChatService::setLobbyAutoSubscribe(const ChatLobbyId& lobby_id, const bool autoSubscribe)
|
void DistributedChatService::setLobbyAutoSubscribe(const ChatLobbyId& lobby_id, const bool autoSubscribe)
|
||||||
|
@ -372,8 +372,6 @@ private:
|
|||||||
struct sockaddr_storage mProxyServerAddress;
|
struct sockaddr_storage mProxyServerAddress;
|
||||||
uint32_t mProxyServerStatus ;
|
uint32_t mProxyServerStatus ;
|
||||||
|
|
||||||
//std::map<RsPeerId,std::pair<sockaddr_storage,time_t> > mReportedConnectionIps ;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MRK_PQI_PEER_MANAGER_HEADER
|
#endif // MRK_PQI_PEER_MANAGER_HEADER
|
||||||
|
Loading…
Reference in New Issue
Block a user