Commit 310b2c72 authored by JC Brand's avatar JC Brand

Fixes #1149

With xhr_user_search_url, contact requests are not being sent out
parent 69632f24
......@@ -5,6 +5,7 @@
- Allow setting of debug mode via URL with `/#converse?debug=true`
- New config setting [locked_muc_domain](https://conversejs.org/docs/html/configuration.html#locked-muc-domain)
- New config setting [show_client_info](https://conversejs.org/docs/html/configuration.html#show-client-info)
- #1149: With `xhr_user_search_url`, contact requests are not being sent out
- #1213: Switch roster filter input and icons
- #1373: Re-add support for the [muc_domain](https://conversejs.org/docs/html/configuration.html#muc-domain) setting
- #1400: When a chat message is just an emoji, enlarge the emoji
......
......@@ -59050,14 +59050,16 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].plugins
afterRender() {
if (_converse.xhr_user_search_url && _.isString(_converse.xhr_user_search_url)) {
this.initXHRAutoComplete(this.el);
this.el.addEventListener('awesomplete-selectcomplete', ev => {
this.el.querySelector('input[name="name"]').value = ev.text.label;
this.el.querySelector('input[name="jid"]').value = ev.text.value;
});
} else {
this.initJIDAutoComplete(this.el);
}
const jid_input = this.el.querySelector('input[name="jid"]');
this.el.addEventListener('shown.bs.modal', () => {
jid_input.focus();
}, false);
this.el.addEventListener('shown.bs.modal', () => jid_input.focus(), false);
},
initJIDAutoComplete(root) {
......@@ -59067,9 +59069,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].plugins
new awesomplete__WEBPACK_IMPORTED_MODULE_3___default.a(jid_input, {
'list': list,
'data': function data(text, input) {
return input.slice(0, input.indexOf("@")) + "@" + text;
},
'data': (text, input) => `${input.slice(0, input.indexOf("@"))}@${text}`,
'filter': awesomplete__WEBPACK_IMPORTED_MODULE_3___default.a.FILTER_STARTSWITH
});
},
......@@ -59100,10 +59100,6 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].plugins
xhr.open("GET", `${_converse.xhr_user_search_url}q=${name_input.value}`, true);
xhr.send();
}, 300));
this.el.addEventListener('awesomplete-selectcomplete', ev => {
jid_input.value = ev.text.value;
name_input.value = ev.text.label;
});
},
addContactFromForm(ev) {
......@@ -133,13 +133,15 @@ converse.plugins.add('converse-rosterview', {
afterRender () {
if (_converse.xhr_user_search_url && _.isString(_converse.xhr_user_search_url)) {
this.initXHRAutoComplete(this.el);
this.el.addEventListener('awesomplete-selectcomplete', ev => {
this.el.querySelector('input[name="name"]').value = ev.text.label;
this.el.querySelector('input[name="jid"]').value = ev.text.value;
});
} else {
this.initJIDAutoComplete(this.el);
}
const jid_input = this.el.querySelector('input[name="jid"]');
this.el.addEventListener('shown.bs.modal', () => {
jid_input.focus();
}, false);
this.el.addEventListener('shown.bs.modal', () => jid_input.focus(), false);
},
initJIDAutoComplete (root) {
......@@ -147,9 +149,7 @@ converse.plugins.add('converse-rosterview', {
const list = _.uniq(_converse.roster.map((item) => Strophe.getDomainFromJid(item.get('jid'))));
new Awesomplete(jid_input, {
'list': list,
'data': function (text, input) {
return input.slice(0, input.indexOf("@")) + "@" + text;
},
'data': (text, input) => `${input.slice(0, input.indexOf("@"))}@${text}`,
'filter': Awesomplete.FILTER_STARTSWITH
});
},
......@@ -175,10 +175,6 @@ converse.plugins.add('converse-rosterview', {
xhr.open("GET", `${_converse.xhr_user_search_url}q=${name_input.value}`, true);
xhr.send()
} , 300));
this.el.addEventListener('awesomplete-selectcomplete', (ev) => {
jid_input.value = ev.text.value;
name_input.value = ev.text.label;
});
},
addContactFromForm (ev) {
......
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