'Can we send messages to the given server?
We can\'t send messages to ourselves. If we are running on localhost
then we can only federation with other servers running on localhost.
Otherwise we only federate with servers on a public domain.
Args:
destination(str): The server we are possibly trying to send to.
Returns:
bool: True if we can send to the server.'

def can_send_to(self, destination):

    if (destination == self.server_name):
        return False
    if self.server_name.startswith('localhost'):
        return destination.startswith('localhost')
    else:
        return (not destination.startswith('localhost'))
