[core] Censor returns True if message is accepted

This commit is contained in:
maike 2020-07-06 15:13:38 +02:00 committed by dl6tom
parent 2ce11122c8
commit 3e565caf69

View file

@ -122,11 +122,13 @@ class Censor:
Args: Args:
message (Message): Message to distribute message (Message): Message to distribute
Returns (Boolean): returns True if message is accepted by Censor.
""" """
if not await self.__is_appropriate(message): if not await self.__is_appropriate(message):
return return False
for censor in self.__hood_censors: for censor in self.hood_censors:
await censor._inbox.put(message) await censor.inbox.put(message)
return True
async def receive(self): async def receive(self):
""" Receive a message. """ Receive a message.