'Get all messages sent by one entity - this could be either a
player or an object
Args:
sender (Player or Object): The sender of the message.
exclude_channel_messages (bool, optional): Only return messages
not aimed at a channel (that is, private tells for example)
Returns:
messages (list): List of matching messages
Raises:
CommError: For incorrect sender types.'

def get_messages_by_sender(self, sender, exclude_channel_messages=False):

    (obj, typ) = identify_object(sender)
    if exclude_channel_messages:
        if (typ == 'player'):
            return list(self.filter(db_sender_players=obj, db_receivers_channels__isnull=True).exclude(db_hide_from_players=obj))
        elif (typ == 'object'):
            return list(self.filter(db_sender_objects=obj, db_receivers_channels__isnull=True).exclude(db_hide_from_objects=obj))
        else:
            raise CommError
    elif (typ == 'player'):
        return list(self.filter(db_sender_players=obj).exclude(db_hide_from_players=obj))
    elif (typ == 'object'):
        return list(self.filter(db_sender_objects=obj).exclude(db_hide_from_objects=obj))
    else:
        raise CommError
