From 7274b24018e4ef951f34291dd3d16ee1ab3171b0 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 9 Jan 2013 10:21:21 -0500 Subject: [PATCH] Callbacks: Reference users by user_profile_id, not user_id. This is for consistency with the rest of our code dealing with message delivery, which always uses the user_profile_id. (imported from commit 5bf10bb9b994b0a98d3a22bd0bd86e542ab8a2ee) --- zephyr/tornadoviews.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zephyr/tornadoviews.py b/zephyr/tornadoviews.py index 2a39f17ab5..a11e97653a 100644 --- a/zephyr/tornadoviews.py +++ b/zephyr/tornadoviews.py @@ -41,19 +41,19 @@ callbacks_table = Callbacks() # The user receives this message def receive(user_profile, message): - callbacks_table.call(user_profile.user.id, Callbacks.TYPE_RECEIVE, + callbacks_table.call(user_profile.id, Callbacks.TYPE_RECEIVE, messages=[message], update_types=["new_messages"]) def update_pointer(user_profile, new_pointer, pointer_updater): - callbacks_table.call(user_profile.user.id, Callbacks.TYPE_POINTER_UPDATE, + callbacks_table.call(user_profile.id, Callbacks.TYPE_POINTER_UPDATE, new_pointer=new_pointer, update_types=["pointer_update"]) def add_receive_callback(user_profile, cb): - callbacks_table.add(user_profile.user.id, Callbacks.TYPE_RECEIVE, cb) + callbacks_table.add(user_profile.id, Callbacks.TYPE_RECEIVE, cb) def add_pointer_update_callback(user_profile, cb): - callbacks_table.add(user_profile.user.id, Callbacks.TYPE_POINTER_UPDATE, cb) + callbacks_table.add(user_profile.id, Callbacks.TYPE_POINTER_UPDATE, cb) @internal_notify_view def notify_new_message(request):