[core] Censor returns True if message is accepted
This commit is contained in:
parent
2ce11122c8
commit
3e565caf69
|
@ -122,11 +122,13 @@ class Censor:
|
|||
|
||||
Args:
|
||||
message (Message): Message to distribute
|
||||
Returns (Boolean): returns True if message is accepted by Censor.
|
||||
"""
|
||||
if not await self.__is_appropriate(message):
|
||||
return
|
||||
for censor in self.__hood_censors:
|
||||
await censor._inbox.put(message)
|
||||
return False
|
||||
for censor in self.hood_censors:
|
||||
await censor.inbox.put(message)
|
||||
return True
|
||||
|
||||
async def receive(self):
|
||||
""" Receive a message.
|
||||
|
|
Loading…
Reference in a new issue