diff options
Diffstat (limited to 'chrome/browser/resources/chat_manager/js/chatbridgehook.js')
-rw-r--r-- | chrome/browser/resources/chat_manager/js/chatbridgehook.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/resources/chat_manager/js/chatbridgehook.js b/chrome/browser/resources/chat_manager/js/chatbridgehook.js index afbe0be..9549a83 100644 --- a/chrome/browser/resources/chat_manager/js/chatbridgehook.js +++ b/chrome/browser/resources/chat_manager/js/chatbridgehook.js @@ -43,10 +43,11 @@ function forwardChatEvent(event) { } /** - * Triggered on opening/closing a central roster chat. Forward to extension. + * Forward mole events to extension. + * Triggered on opening/closing/focus a central roster chat. * @param {MessageEvent} event the opened/closed event. */ -function moleOpenedClosed(event) { +function forwardMoleEvent(event) { var eventType = event.type; var chatJid = event.data; chrome.extension.sendRequest({msg: eventType, jid: chatJid}); @@ -132,10 +133,13 @@ function onPageLoaded() { setupCentralRosterJidListener, false); divRosterHandler.addEventListener( ChatBridgeEventTypes.OPENED_MOLE_INCOMING, - moleOpenedClosed, false); + forwardMoleEvent, false); divRosterHandler.addEventListener( ChatBridgeEventTypes.CLOSED_MOLE_INCOMING, - moleOpenedClosed, false); + forwardMoleEvent, false); + divRosterHandler.addEventListener( + ChatBridgeEventTypes.MOLE_FOCUSED, + forwardMoleEvent, false); } } |