Package Tribler :: Package Core :: Module RequestPolicy :: Class AllowFriendsRequestPolicy

Class AllowFriendsRequestPolicy

AbstractRequestPolicy --+    
                        |    
      CommonRequestPolicy --+
                            |
                           AllowFriendsRequestPolicy

A RequestPolicy that allows all non-crawler messages to be sent by friends only. Crawler messages are allowed from Crawlers only.
Instance Methods
 
allowed(self, permid, messageID)
Returns whether or not the peer identified by permid is allowed to send us a message of type messageID.
 
allowAllRequestsFromFriends(self, permid, messageID)

Inherited from CommonRequestPolicy: __init__, benign_random_peer, get_peer_nqueries, isCrawler, isFriend, isSuperPeer

Method Details

allowed(self, permid, messageID)

 
Returns whether or not the peer identified by permid is allowed to send us a message of type messageID.
Parameters:
  • permid - The permid of the sending peer.
  • messageID - A integer messageID, see Tribler.Core.BitTornado.BT1.MessageID
Returns:
A boolean indicating whether the message is authorized.
Overrides: AbstractRequestPolicy.allowed
(inherited documentation)