mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Fix code-style
This commit is contained in:
parent
c8e1da930d
commit
84a769cdb7
@ -134,7 +134,7 @@ class SynapseHomeServer(HomeServer):
|
|||||||
logger.info("Attaching %s to path %s", resource, full_path)
|
logger.info("Attaching %s to path %s", resource, full_path)
|
||||||
last_resource = self.root_resource
|
last_resource = self.root_resource
|
||||||
for path_seg in full_path.split('/')[1:-1]:
|
for path_seg in full_path.split('/')[1:-1]:
|
||||||
if not path_seg in last_resource.listNames():
|
if path_seg not in last_resource.listNames():
|
||||||
# resource doesn't exist, so make a "dummy resource"
|
# resource doesn't exist, so make a "dummy resource"
|
||||||
child_resource = Resource()
|
child_resource = Resource()
|
||||||
last_resource.putChild(path_seg, child_resource)
|
last_resource.putChild(path_seg, child_resource)
|
||||||
|
@ -75,7 +75,7 @@ class SynapseKeyClientProtocol(HTTPClient):
|
|||||||
|
|
||||||
def handleStatus(self, version, status, message):
|
def handleStatus(self, version, status, message):
|
||||||
if status != b"200":
|
if status != b"200":
|
||||||
#logger.info("Non-200 response from %s: %s %s",
|
# logger.info("Non-200 response from %s: %s %s",
|
||||||
# self.transport.getHost(), status, message)
|
# self.transport.getHost(), status, message)
|
||||||
self.transport.abortConnection()
|
self.transport.abortConnection()
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ class SynapseKeyClientProtocol(HTTPClient):
|
|||||||
try:
|
try:
|
||||||
json_response = json.loads(response_body_bytes)
|
json_response = json.loads(response_body_bytes)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
#logger.info("Invalid JSON response from %s",
|
# logger.info("Invalid JSON response from %s",
|
||||||
# self.transport.getHost())
|
# self.transport.getHost())
|
||||||
self.transport.abortConnection()
|
self.transport.abortConnection()
|
||||||
return
|
return
|
||||||
|
@ -457,9 +457,9 @@ class PresenceHandler(BaseHandler):
|
|||||||
if state is None:
|
if state is None:
|
||||||
state = yield self.store.get_presence_state(user.localpart)
|
state = yield self.store.get_presence_state(user.localpart)
|
||||||
else:
|
else:
|
||||||
# statuscache = self._get_or_make_usercache(user)
|
# statuscache = self._get_or_make_usercache(user)
|
||||||
# self._user_cachemap_latest_serial += 1
|
# self._user_cachemap_latest_serial += 1
|
||||||
# statuscache.update(state, self._user_cachemap_latest_serial)
|
# statuscache.update(state, self._user_cachemap_latest_serial)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
yield self.push_update_to_local_and_remote(
|
yield self.push_update_to_local_and_remote(
|
||||||
@ -709,7 +709,7 @@ class PresenceHandler(BaseHandler):
|
|||||||
|
|
||||||
# TODO(paul) permissions checks
|
# TODO(paul) permissions checks
|
||||||
|
|
||||||
if not user in self._remote_sendmap:
|
if user not in self._remote_sendmap:
|
||||||
self._remote_sendmap[user] = set()
|
self._remote_sendmap[user] = set()
|
||||||
|
|
||||||
self._remote_sendmap[user].add(origin)
|
self._remote_sendmap[user].add(origin)
|
||||||
|
@ -114,7 +114,7 @@ class SyncHandler(BaseHandler):
|
|||||||
if sync_config.gap:
|
if sync_config.gap:
|
||||||
return self.incremental_sync_with_gap(sync_config, since_token)
|
return self.incremental_sync_with_gap(sync_config, since_token)
|
||||||
else:
|
else:
|
||||||
#TODO(mjark): Handle gapless sync
|
# TODO(mjark): Handle gapless sync
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
@ -48,7 +48,7 @@ class ClientDirectoryServer(ClientV1RestServlet):
|
|||||||
user, client = yield self.auth.get_user_by_req(request)
|
user, client = yield self.auth.get_user_by_req(request)
|
||||||
|
|
||||||
content = _parse_json(request)
|
content = _parse_json(request)
|
||||||
if not "room_id" in content:
|
if "room_id" not in content:
|
||||||
raise SynapseError(400, "Missing room_id key",
|
raise SynapseError(400, "Missing room_id key",
|
||||||
errcode=Codes.BAD_JSON)
|
errcode=Codes.BAD_JSON)
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ class SyncRestServlet(RestServlet):
|
|||||||
except:
|
except:
|
||||||
filter = Filter({})
|
filter = Filter({})
|
||||||
# filter = filter.apply_overrides(http_request)
|
# filter = filter.apply_overrides(http_request)
|
||||||
#if filter.matches(event):
|
# if filter.matches(event):
|
||||||
# # stuff
|
# # stuff
|
||||||
|
|
||||||
sync_config = SyncConfig(
|
sync_config = SyncConfig(
|
||||||
|
@ -96,8 +96,8 @@ class UploadResource(BaseMediaResource):
|
|||||||
code=400,
|
code=400,
|
||||||
)
|
)
|
||||||
|
|
||||||
#if headers.hasHeader("Content-Disposition"):
|
# if headers.hasHeader("Content-Disposition"):
|
||||||
# disposition = headers.getRawHeaders("Content-Disposition")[0]
|
# disposition = headers.getRawHeaders("Content-Disposition")[0]
|
||||||
# TODO(markjh): parse content-dispostion
|
# TODO(markjh): parse content-dispostion
|
||||||
|
|
||||||
content_uri = yield self.create_content(
|
content_uri = yield self.create_content(
|
||||||
|
Loading…
Reference in New Issue
Block a user