Exemplo n.º 1
0
 def clear_bans(self):
     """ Clear all room bans. """
     url = "http://tinychat.com/ajax/user/clearbans"
     header = {"X-Requested-With": "XMLHttpRequest", "Referrer": self._privacy_url}
     response = web_request.post_request(url, post_data={}, header=header, json=True, proxy=self._proxy)
     if response["content"]["room"] is not None:
         return True
     return False
Exemplo n.º 2
0
 def clear_bans(self):
     """ Clear all room bans. """
     url = 'http://tinychat.com/ajax/user/clearbans'
     header = {
         'X-Requested-With': 'XMLHttpRequest',
         'Referrer': self._privacy_url
     }
     response = web_request.post_request(url, post_data={}, header=header, json=True, proxy=self._proxy)
     if response['content']['room'] is not None:
         return True
     return False
Exemplo n.º 3
0
    def _update(self):
        """ Update the privacy settings page. """
        header = {"Referrer": self._privacy_url}

        form_data = [
            ("validate", self._validation_key),
            ("form_sent", "1"),
            ("allowGuests", self._allow_guests),
            ("public_directory", self._public_directory),
            ("push2talk", self._push2talk),
            ("greenroom", self._greenroom),
            ("save", "1"),
            ("roomPassword", self._room_password),
            ("broadcastPassword", self._broadcast_password),
        ]
        for mod in self.room_moderators:
            mod_data = ("mods[]", mod)
            form_data.append(mod_data)

        response = web_request.post_request(self._privacy_url, post_data=form_data, header=header, proxy=self._proxy)
        self.parse_privacy_settings(response=response)
        self._privacy_url = "http://tinychat.com/settings/privacy?saved=1"
Exemplo n.º 4
0
    def _update(self):
        """ Update the privacy settings page. """
        header = {
            'Referrer': self._privacy_url
        }

        form_data = [
            ('validate', self._validation_key),
            ('form_sent', '1'),
            ('allowGuests', self._allow_guests),
            ('public_directory', self._public_directory),
            ('push2talk', self._push2talk),
            ('greenroom', self._greenroom),
            ('save', '1'),
            ('roomPassword', self._room_password),
            ('broadcastPassword', self._broadcast_password)
        ]
        for mod in self.room_moderators:
            mod_data = ('mods[]', mod)
            form_data.append(mod_data)

        response = web_request.post_request(self._privacy_url, post_data=form_data, header=header, proxy=self._proxy)
        self.parse_privacy_settings(response=response)
        self._privacy_url = 'http://tinychat.com/settings/privacy?saved=1'