mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
Rename humbug_finish to zulip_finish.
(imported from commit a73ef9302d16a4068c7d050d4882d2eba699488d)
This commit is contained in:
@@ -25,7 +25,7 @@ class _RespondAsynchronously(object):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
# Return RespondAsynchronously from an @asynchronous view if the
|
# Return RespondAsynchronously from an @asynchronous view if the
|
||||||
# response will be provided later by calling handler.humbug_finish(),
|
# response will be provided later by calling handler.zulip_finish(),
|
||||||
# or has already been provided this way. We use this for longpolling
|
# or has already been provided this way. We use this for longpolling
|
||||||
# mode.
|
# mode.
|
||||||
RespondAsynchronously = _RespondAsynchronously()
|
RespondAsynchronously = _RespondAsynchronously()
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class ClientDescriptor(object):
|
|||||||
self.event_queue.push(event)
|
self.event_queue.push(event)
|
||||||
if self.current_handler is not None:
|
if self.current_handler is not None:
|
||||||
try:
|
try:
|
||||||
self.current_handler.humbug_finish(dict(result='success', msg='',
|
self.current_handler.zulip_finish(dict(result='success', msg='',
|
||||||
events=[event],
|
events=[event],
|
||||||
queue_id=self.event_queue.id),
|
queue_id=self.event_queue.id),
|
||||||
self.current_handler._request,
|
self.current_handler._request,
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ class AsyncDjangoHandler(tornado.web.RequestHandler, base.BaseHandler):
|
|||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def humbug_finish(self, response, request, apply_markdown):
|
def zulip_finish(self, response, request, apply_markdown):
|
||||||
# Make sure that Markdown rendering really happened, if requested.
|
# Make sure that Markdown rendering really happened, if requested.
|
||||||
# This is a security issue because it's where we escape HTML.
|
# This is a security issue because it's where we escape HTML.
|
||||||
# c.f. ticket #64
|
# c.f. ticket #64
|
||||||
|
|||||||
@@ -1746,7 +1746,7 @@ class DummyHandler(object):
|
|||||||
def write(self, response):
|
def write(self, response):
|
||||||
raise NotImplemented
|
raise NotImplemented
|
||||||
|
|
||||||
def humbug_finish(self, response, *ignore):
|
def zulip_finish(self, response, *ignore):
|
||||||
if self.assert_callback:
|
if self.assert_callback:
|
||||||
self.assert_callback(response)
|
self.assert_callback(response)
|
||||||
|
|
||||||
|
|||||||
@@ -126,9 +126,9 @@ def get_updates_backend(request, user_profile, handler=None,
|
|||||||
dont_block, stream_name,
|
dont_block, stream_name,
|
||||||
apply_markdown=apply_markdown, **kwargs)
|
apply_markdown=apply_markdown, **kwargs)
|
||||||
if resp is not None:
|
if resp is not None:
|
||||||
handler.humbug_finish(resp, request, apply_markdown)
|
handler.zulip_finish(resp, request, apply_markdown)
|
||||||
|
|
||||||
# We have already invoked handler.humbug_finish(), so we bypass the usual view
|
# We have already invoked handler.zulip_finish(), so we bypass the usual view
|
||||||
# response path. We are "responding asynchronously" except that it
|
# response path. We are "responding asynchronously" except that it
|
||||||
# already happened. This is slightly weird.
|
# already happened. This is slightly weird.
|
||||||
return RespondAsynchronously
|
return RespondAsynchronously
|
||||||
@@ -157,7 +157,7 @@ def get_updates_backend(request, user_profile, handler=None,
|
|||||||
# We must return a response because we don't have
|
# We must return a response because we don't have
|
||||||
# a way to re-queue a callback and so the client
|
# a way to re-queue a callback and so the client
|
||||||
# must do it by making a new request
|
# must do it by making a new request
|
||||||
handler.humbug_finish({"result": "success",
|
handler.zulip_finish({"result": "success",
|
||||||
"msg": "",
|
"msg": "",
|
||||||
'update_types': []},
|
'update_types': []},
|
||||||
request, apply_markdown)
|
request, apply_markdown)
|
||||||
@@ -168,7 +168,7 @@ def get_updates_backend(request, user_profile, handler=None,
|
|||||||
client_server_generation=client_server_generation,
|
client_server_generation=client_server_generation,
|
||||||
apply_markdown=apply_markdown,
|
apply_markdown=apply_markdown,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
handler.humbug_finish(res, request, apply_markdown)
|
handler.zulip_finish(res, request, apply_markdown)
|
||||||
except socket.error:
|
except socket.error:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user