# Path: xmpp_backends/constants.py
# CONNECTION_HTTP_BINDING = 2
# 
# Path: xmpp_backends/constants.py
# CONNECTION_UNKNOWN = 4
# 
# Path: xmpp_backends/constants.py
# CONNECTION_XMPP = 0


import ipaddress
import logging
import random
import re
import string
import time
import pytz
from datetime import datetime
from datetime import timedelta
from importlib import import_module
from .constants import CONNECTION_HTTP_BINDING
from .constants import CONNECTION_UNKNOWN
from .constants import CONNECTION_XMPP
        return True

    def set_email(self, username, domain, email):
        """Not yet implemented."""
        pass

    def check_email(self, username, domain, email):
        """Not yet implemented."""
        pass

    def parse_connection_string(self, connection):
        """Parse string as returned by the ``connected_users_info`` or ``user_sessions_info`` API calls.

        >>> EjabberdBackendBase().parse_connection_string('c2s_tls')
        (0, True, False)
        >>> EjabberdBackendBase().parse_connection_string('c2s_compressed_tls')
        (0, True, True)
        >>> EjabberdBackendBase().parse_connection_string('http_bind')
        (2, None, None)

        :param connection: The connection string as returned by the ejabberd APIs.
        :type  connection: str
        :return: A tuple representing the conntion type, if it is encrypted and if it uses XMPP stream
            compression.
        :rtype: tuple
        """
        # TODO: Websockets, HTTP Polling
        if connection == 'c2s_tls':
            return CONNECTION_XMPP, True, False
        elif connection == 'c2s_compressed_tls':

# Path: xmpp_backends/constants.py
# CONNECTION_HTTP_BINDING = 2
# 
# Path: xmpp_backends/constants.py
# CONNECTION_UNKNOWN = 4
# 
# Path: xmpp_backends/constants.py
# CONNECTION_XMPP = 0


# Path: xmpp_backends/base.py
import ipaddress
import logging
import random
import re
import string
import time
import pytz
from datetime import datetime
from datetime import timedelta
from importlib import import_module
from .constants import CONNECTION_HTTP_BINDING
from .constants import CONNECTION_UNKNOWN
from .constants import CONNECTION_XMPP

        return True

    def set_email(self, username, domain, email):
        """Not yet implemented."""
        pass

    def check_email(self, username, domain, email):
        """Not yet implemented."""
        pass

    def parse_connection_string(self, connection):
        """Parse string as returned by the ``connected_users_info`` or ``user_sessions_info`` API calls.

        >>> EjabberdBackendBase().parse_connection_string('c2s_tls')
        (0, True, False)
        >>> EjabberdBackendBase().parse_connection_string('c2s_compressed_tls')
        (0, True, True)
        >>> EjabberdBackendBase().parse_connection_string('http_bind')
        (2, None, None)

        :param connection: The connection string as returned by the ejabberd APIs.
        :type  connection: str
        :return: A tuple representing the conntion type, if it is encrypted and if it uses XMPP stream
            compression.
        :rtype: tuple
        """
        # TODO: Websockets, HTTP Polling
        if connection == 'c2s_tls':
            return CONNECTION_XMPP, True, False
        elif connection == 'c2s_compressed_tls':

            return CONNECTION_XMPP, True, True