mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
Extract notifications.reify_message_id().
This removes the last need for a message_id_changed event.
This commit is contained in:
@@ -203,8 +203,7 @@ exports.reify_message_id = function reify_message_id(local_id, server_id) {
|
|||||||
var opts = {old_id: local_id, new_id: server_id};
|
var opts = {old_id: local_id, new_id: server_id};
|
||||||
|
|
||||||
message_store.reify_message_id(opts);
|
message_store.reify_message_id(opts);
|
||||||
|
notifications.reify_message_id(opts);
|
||||||
$(document).trigger($.Event('message_id_changed', opts));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.process_from_server = function process_from_server(messages) {
|
exports.process_from_server = function process_from_server(messages) {
|
||||||
|
|||||||
@@ -619,9 +619,11 @@ $(function () {
|
|||||||
window.bridge = bridge;
|
window.bridge = bridge;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('message_id_changed', function (event) {
|
});
|
||||||
var old_id = event.old_id;
|
|
||||||
var new_id = event.new_id;
|
exports.reify_message_id = function (opts) {
|
||||||
|
var old_id = opts.old_id;
|
||||||
|
var new_id = opts.new_id;
|
||||||
|
|
||||||
// If a message ID that we're currently storing (as a link) has changed,
|
// If a message ID that we're currently storing (as a link) has changed,
|
||||||
// update that link as well
|
// update that link as well
|
||||||
@@ -633,8 +635,7 @@ $(function () {
|
|||||||
elem.data('msgid', new_id);
|
elem.data('msgid', new_id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
};
|
||||||
});
|
|
||||||
|
|
||||||
exports.register_click_handlers = function () {
|
exports.register_click_handlers = function () {
|
||||||
$('#out-of-view-notification').on('click', '.compose_notification_narrow_by_subject', function (e) {
|
$('#out-of-view-notification').on('click', '.compose_notification_narrow_by_subject', function (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user