mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-27 08:25:53 -04:00
fixed bug causing distant chat preference contacts/nobody/everybody to be ignored
This commit is contained in:
parent
2233af4702
commit
07abdeeceb
4 changed files with 11 additions and 11 deletions
|
@ -135,13 +135,13 @@ void DistantChatService::handleRecvChatStatusItem(RsChatStatusItem *cs)
|
||||||
std::cerr << "DistantChatService::handleRecvChatStatusItem(): received keep alive packet for inactive chat! peerId=" << cs->PeerId() << std::endl;
|
std::cerr << "DistantChatService::handleRecvChatStatusItem(): received keep alive packet for inactive chat! peerId=" << cs->PeerId() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DistantChatService::acceptDataFromPeer(const RsGxsId& gxs_id,const RsGxsTunnelId& tunnel_id,bool is_client_side)
|
bool DistantChatService::acceptDataFromPeer(const RsGxsId& gxs_id,const RsGxsTunnelId& tunnel_id,bool am_I_client_side)
|
||||||
{
|
{
|
||||||
bool res = true ;
|
if(am_I_client_side) // always accept distant chat when we're the client side.
|
||||||
|
|
||||||
if(is_client_side) // always accept distant chat when we're the client side.
|
|
||||||
return true ;
|
return true ;
|
||||||
|
|
||||||
|
bool res = true ;
|
||||||
|
|
||||||
if(mDistantChatPermissions & RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NON_CONTACTS)
|
if(mDistantChatPermissions & RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NON_CONTACTS)
|
||||||
res = (rsIdentity!=NULL) && rsIdentity->isARegularContact(gxs_id) ;
|
res = (rsIdentity!=NULL) && rsIdentity->isARegularContact(gxs_id) ;
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ public:
|
||||||
virtual void connectToGxsTunnelService(RsGxsTunnelService *tunnel_service) ;
|
virtual void connectToGxsTunnelService(RsGxsTunnelService *tunnel_service) ;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool acceptDataFromPeer(const RsGxsId& gxs_id, const RsGxsTunnelService::RsGxsTunnelId& tunnel_id, bool is_client_side) ;
|
virtual bool acceptDataFromPeer(const RsGxsId& gxs_id, const RsGxsTunnelService::RsGxsTunnelId& tunnel_id, bool am_I_client_side) ;
|
||||||
virtual void notifyTunnelStatus(const RsGxsTunnelService::RsGxsTunnelId& tunnel_id,uint32_t tunnel_status) ;
|
virtual void notifyTunnelStatus(const RsGxsTunnelService::RsGxsTunnelId& tunnel_id,uint32_t tunnel_status) ;
|
||||||
virtual void receiveData(const RsGxsTunnelService::RsGxsTunnelId& id,unsigned char *data,uint32_t data_size) ;
|
virtual void receiveData(const RsGxsTunnelService::RsGxsTunnelId& id,unsigned char *data,uint32_t data_size) ;
|
||||||
|
|
||||||
|
|
|
@ -373,7 +373,7 @@ void p3GxsTunnelService::handleRecvTunnelDataItem(const RsGxsTunnelId& tunnel_id
|
||||||
{
|
{
|
||||||
it2->second.client_services.insert(item->service_id) ;
|
it2->second.client_services.insert(item->service_id) ;
|
||||||
peer_from = it2->second.to_gxs_id ;
|
peer_from = it2->second.to_gxs_id ;
|
||||||
is_client_side = (it2->second.direction == RsTurtleGenericDataItem::DIRECTION_CLIENT);
|
is_client_side = (it2->second.direction == RsTurtleGenericDataItem::DIRECTION_SERVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the item has already been received. This is necessary because we actually re-send items until an ACK is received. If the ACK gets lost (connection interrupted) the
|
// Check if the item has already been received. This is necessary because we actually re-send items until an ACK is received. If the ACK gets lost (connection interrupted) the
|
||||||
|
|
|
@ -62,7 +62,7 @@ public:
|
||||||
|
|
||||||
// Gives feedback about type of data that is allowed in. For security reasons, this always needs to be re-derived (Clients can return true on default)
|
// Gives feedback about type of data that is allowed in. For security reasons, this always needs to be re-derived (Clients can return true on default)
|
||||||
|
|
||||||
virtual bool acceptDataFromPeer(const RsGxsId& gxs_id,const RsGxsTunnelId& tunnel_id,bool is_client_side) = 0 ;
|
virtual bool acceptDataFromPeer(const RsGxsId& gxs_id,const RsGxsTunnelId& tunnel_id,bool am_I_client_side) = 0 ;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GxsTunnelInfo
|
class GxsTunnelInfo
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue