mirror of https://github.com/zulip/zulip.git
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)
This commit is contained in:
parent
3c10a2e6a0
commit
7274b24018
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue