UserSetSettings, UserGetSettings Websocket API commands

This commit is contained in:
shortcutme 2017-07-10 02:41:01 +02:00
parent 1384da4691
commit efbef25c76
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 14 additions and 1 deletions

View file

@ -818,13 +818,20 @@ class UiWebsocket(object):
self.cmd("notification", ["done", _["Site cloned"] + "<script>window.top.location = '/%s'</script>" % new_address])
gevent.spawn(new_site.announce)
def actionSiteSetLimit(self, to, size_limit):
self.site.settings["size_limit"] = int(size_limit)
self.site.saveSettings()
self.response(to, "ok")
self.site.download(blind_includes=True)
def actionUserGetSettings(self, to):
settings = self.user.sites[self.site.address].get("settings", {})
self.response(to, settings)
def actionUserSetSettings(self, to, settings):
self.user.setSettings(self.site.address, settings)
self.response(to, "ok")
def actionServerUpdate(self, to):
self.cmd("updating")
sys.modules["main"].update_after_shutdown = True