'Get all messages sent to one given recipient.
Args:
recipient (Object, Player or Channel): The recipient of the messages to search for.
Returns:
messages (list): Matching messages.
Raises:
CommError: If the `recipient` is not of a valid type.'

def get_messages_by_receiver(self, recipient):

    (obj, typ) = identify_object(recipient)
    if (typ == 'player'):
        return list(self.filter(db_receivers_players=obj).exclude(db_hide_from_players=obj))
    elif (typ == 'object'):
        return list(self.filter(db_receivers_objects=obj).exclude(db_hide_from_objects=obj))
    elif (typ == 'channel'):
        return list(self.filter(db_receivers_channels=obj).exclude(db_hide_from_channels=obj))
    else:
        raise CommError
