mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
connected GUI to distant chat permission flags system
This commit is contained in:
parent
b32eb6e0c8
commit
9dfac71822
4 changed files with 17 additions and 12 deletions
|
@ -60,6 +60,12 @@ static const uint32_t DISTANT_CHAT_GXS_TUNNEL_SERVICE_ID = 0xa0001 ;
|
|||
|
||||
typedef RsGxsTunnelService::RsGxsTunnelId RsGxsTunnelId;
|
||||
|
||||
DistantChatService::DistantChatService() : mDistantChatMtx("distant chat")
|
||||
{
|
||||
mGxsTunnels = NULL ;
|
||||
mDistantChatPermissions = RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NONE ; // default: accept everyone
|
||||
}
|
||||
|
||||
void DistantChatService::connectToGxsTunnelService(RsGxsTunnelService *tr)
|
||||
{
|
||||
mGxsTunnels = tr ;
|
||||
|
@ -111,10 +117,10 @@ void DistantChatService::handleRecvChatStatusItem(RsChatStatusItem *cs)
|
|||
|
||||
bool DistantChatService::acceptDataFromPeer(const RsGxsId& gxs_id)
|
||||
{
|
||||
if(mDistantChatPermissions & RS_DISTANT_MESSAGING_CONTACT_PERMISSION_FLAG_FILTER_NON_CONTACTS)
|
||||
if(mDistantChatPermissions & RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NON_CONTACTS)
|
||||
return (rsIdentity!=NULL) && rsIdentity->isARegularContact(gxs_id) ;
|
||||
|
||||
if(mDistantChatPermissions & RS_DISTANT_MESSAGING_CONTACT_PERMISSION_FLAG_FILTER_EVERYBODY)
|
||||
if(mDistantChatPermissions & RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_EVERYBODY)
|
||||
return false ;
|
||||
|
||||
return true ;
|
||||
|
|
|
@ -39,11 +39,7 @@ public:
|
|||
// So, public interface only uses DistandChatPeerId, but internally, this is converted into a RsGxsTunnelService::RsGxsTunnelId
|
||||
|
||||
|
||||
DistantChatService() : mDistantChatMtx("distant chat")
|
||||
{
|
||||
mGxsTunnels = NULL ;
|
||||
mDistantChatPermissions = RS_DISTANT_MESSAGING_CONTACT_PERMISSION_FLAG_FILTER_NONE ; // default: accept everyone
|
||||
}
|
||||
DistantChatService() ;
|
||||
|
||||
virtual void triggerConfigSave()=0 ;
|
||||
bool processLoadListItem(const RsItem *item) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue