def start_xmpp_client(self):
        logger = logging.getLogger(__name__)
        ClientXMPP.__init__(self, "%s/bot" % settings.USERNAME, settings.PASSWORD)

        if settings.USE_PROXY:
            self.use_proxy = True
            self.proxy_config = {
                'host': settings.PROXY_HOSTNAME,
                'port': settings.PROXY_PORT,
                'username': settings.PROXY_USERNAME,
                'password': settings.PROXY_PASSWORD,
            }

        self.rooms = []
        self.default_room = settings.DEFAULT_ROOM

        # Property boostraps the list
        self.available_rooms
        for r in settings.ROOMS:
            if r != "":
                if not hasattr(self, "default_room"):
                    self.default_room = r

                try:
                    self.rooms.append(self.available_rooms[r])
                except KeyError:
                    logger.error(
                        u'"{0}" is not an available room, ask'
                        ' "@{1} what are the rooms?" for the full list.'
                        .format(r, settings.HANDLE))

        self.nick = settings.NAME
        self.handle = settings.HANDLE
        self.handle_regex = re.compile(self.handle % "@%s")

        self.whitespace_keepalive = True
        self.whitespace_keepalive_interval = 30

        if settings.ALLOW_INSECURE_HIPCHAT_SERVER is True:
            self.add_event_handler('ssl_invalid_cert', lambda cert: True)

        self.add_event_handler("roster_update", self.join_rooms)
        self.add_event_handler("session_start", self.session_start)
        self.add_event_handler("message", self.message_recieved)
        self.add_event_handler("groupchat_message", self.room_message)

        self.register_plugin('xep_0045')  # MUC
dataset/ETHPy150Open skoczen/will/will/listener.py/WillXMPPClientMixin.start_xmpp_client/swapped operands of `%`