Commit e425f257 authored by JC Brand's avatar JC Brand

Listen for `xmpp:` URIs in all of Converse, not only chatrooms

updates #537
parent 9e47fff0
...@@ -68948,7 +68948,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -68948,7 +68948,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
'click .hide-occupants': 'hideOccupants', 'click .hide-occupants': 'hideOccupants',
'click .new-msgs-indicator': 'viewUnreadMessages', 'click .new-msgs-indicator': 'viewUnreadMessages',
'click .occupant-nick': 'onOccupantClicked', 'click .occupant-nick': 'onOccupantClicked',
'click a.open-chatroom': 'openChatRoomFromURIClicked',
'click .send-button': 'onFormSubmitted', 'click .send-button': 'onFormSubmitted',
'click .show-room-details-modal': 'showRoomDetailsModal', 'click .show-room-details-modal': 'showRoomDetailsModal',
'click .toggle-call': 'toggleCall', 'click .toggle-call': 'toggleCall',
...@@ -69285,12 +69284,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -69285,12 +69284,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.insertIntoTextArea(ev.target.textContent); this.insertIntoTextArea(ev.target.textContent);
}, },
openChatRoomFromURIClicked(ev) {
ev.preventDefault();
_converse.api.rooms.open(ev.target.href);
},
handleChatStateNotification(message) { handleChatStateNotification(message) {
/* Override the method on the ChatBoxView base class to /* Override the method on the ChatBoxView base class to
* ignore <gone/> notifications in groupchats. * ignore <gone/> notifications in groupchats.
...@@ -70624,6 +70617,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -70624,6 +70617,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
_converse.on('chatBoxViewsInitialized', () => { _converse.on('chatBoxViewsInitialized', () => {
function openChatRoomFromURIClicked(ev) {
ev.preventDefault();
_converse.api.rooms.open(ev.target.href);
}
_converse.chatboxviews.delegate('click', 'a.open-chatroom', openChatRoomFromURIClicked);
const that = _converse.chatboxviews; const that = _converse.chatboxviews;
_converse.chatboxes.on('add', item => { _converse.chatboxes.on('add', item => {
...@@ -512,7 +512,6 @@ ...@@ -512,7 +512,6 @@
'click .hide-occupants': 'hideOccupants', 'click .hide-occupants': 'hideOccupants',
'click .new-msgs-indicator': 'viewUnreadMessages', 'click .new-msgs-indicator': 'viewUnreadMessages',
'click .occupant-nick': 'onOccupantClicked', 'click .occupant-nick': 'onOccupantClicked',
'click a.open-chatroom': 'openChatRoomFromURIClicked',
'click .send-button': 'onFormSubmitted', 'click .send-button': 'onFormSubmitted',
'click .show-room-details-modal': 'showRoomDetailsModal', 'click .show-room-details-modal': 'showRoomDetailsModal',
'click .toggle-call': 'toggleCall', 'click .toggle-call': 'toggleCall',
...@@ -814,11 +813,6 @@ ...@@ -814,11 +813,6 @@
this.insertIntoTextArea(ev.target.textContent); this.insertIntoTextArea(ev.target.textContent);
}, },
openChatRoomFromURIClicked (ev) {
ev.preventDefault();
_converse.api.rooms.open(ev.target.href);
},
handleChatStateNotification (message) { handleChatStateNotification (message) {
/* Override the method on the ChatBoxView base class to /* Override the method on the ChatBoxView base class to
* ignore <gone/> notifications in groupchats. * ignore <gone/> notifications in groupchats.
...@@ -2071,6 +2065,13 @@ ...@@ -2071,6 +2065,13 @@
/************************ BEGIN Event Handlers ************************/ /************************ BEGIN Event Handlers ************************/
_converse.on('chatBoxViewsInitialized', () => { _converse.on('chatBoxViewsInitialized', () => {
function openChatRoomFromURIClicked (ev) {
ev.preventDefault();
_converse.api.rooms.open(ev.target.href);
}
_converse.chatboxviews.delegate('click', 'a.open-chatroom', openChatRoomFromURIClicked);
const that = _converse.chatboxviews; const that = _converse.chatboxviews;
_converse.chatboxes.on('add', item => { _converse.chatboxes.on('add', item => {
if (!that.get(item.get('id')) && item.get('type') === _converse.CHATROOMS_TYPE) { if (!that.get(item.get('id')) && item.get('type') === _converse.CHATROOMS_TYPE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment