From 468bbf216d1e95bc7abe83a98fba11c8ae7e4d82 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Tue, 18 Jun 2013 18:00:40 -0400 Subject: [PATCH] Add a new window.bridge call for unread pms (imported from commit 098c31dbd69c4c020e4c093095e4c78723db0bb1) --- zephyr/static/js/notifications.js | 6 ++++++ zephyr/static/js/zephyr.js | 1 + 2 files changed, 7 insertions(+) diff --git a/zephyr/static/js/notifications.js b/zephyr/static/js/notifications.js index c0317b73a1..18b7a7a37e 100644 --- a/zephyr/static/js/notifications.js +++ b/zephyr/static/js/notifications.js @@ -103,6 +103,12 @@ exports.update_title_count = function (new_message_count) { } }; +exports.update_pm_count = function (new_pm_count) { + if (window.bridge !== undefined && window.bridge.updatePMCount !== undefined) { + window.bridge.updatePMCount(new_pm_count); + } +}; + exports.window_has_focus = function () { return window_has_focus; }; diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index ee56defd0d..30b5447937 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -286,6 +286,7 @@ function update_unread_counts() { // avoid excessive calls to this. stream_list.update_dom_with_unread_counts(res); notifications.update_title_count(res.unread_in_current_view); + notifications.update_pm_count(res.private_message_count); notifications_bar.update(res.unread_in_current_view); }