Bugfix: selected emoji inserted into all open chat boxes

when in overlay view mode.
This commit is contained in:
SilverYoCha 2022-04-04 11:53:50 +02:00 committed by JC Brand
parent c3e3f89e52
commit b331405658
4 changed files with 21 additions and 9 deletions

View File

@ -3,6 +3,7 @@
## 9.1.1 (Unreleased)
- GIFs don't render inside unfurls and cause a TypeError
- #2868: Selected emoji is inserted into all open chat boxes
## 9.1.0 (2022-04-02)

14
package-lock.json generated
View File

@ -13179,6 +13179,12 @@
"node": "*"
}
},
"node_modules/prettierx/node_modules/minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"node_modules/prettierx/node_modules/postcss-selector-parser": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz",
@ -18300,7 +18306,6 @@
},
"@converse/skeletor": {
"version": "git+ssh://git@github.com/conversejs/skeletor.git#c7e76b023337a8ac201c74507f7a1209de1c6d18",
"integrity": "sha512-2g+6XxFUorhlHncfkBWB8+26+8Izl2kJYf+1uk/Umb53/ltvCgtCJcQuAECmKXC/y99yCjNWot+qhA+tQK9sWQ==",
"from": "@converse/skeletor@conversejs/skeletor#c7e76b023337a8ac201c74507f7a1209de1c6d18",
"requires": {
"lit-html": "^2.0.0-rc.2",
@ -25065,7 +25070,6 @@
},
"localforage-getitems": {
"version": "git+ssh://git@github.com/conversejs/localForage-getItems.git#de039970de16a9d3b54cdaa816aed5adaefb80c9",
"integrity": "sha512-fPxYV2vJFx2onqHfL+En0bTesjawTmn1v/peYf/0gaYL7uhx5nP9czVHNUYAXoKL9kKplVH8lZo4LRrE2MK23w==",
"from": "localforage-getitems@conversejs/localForage-getItems#de039970de16a9d3b54cdaa816aed5adaefb80c9",
"requires": {
"localforage": ">=1.4.0"
@ -27201,6 +27205,12 @@
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"postcss-selector-parser": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz",

View File

@ -17,12 +17,12 @@ export default class MessageForm extends ElementView {
this.listenTo(this.model.messages, 'change:correcting', this.onMessageCorrecting);
this.listenTo(this.model, 'change:composing_spoiler', () => this.render());
this.handleEmojiSelection = ({ detail }) => this.insertIntoTextArea(
detail.value,
detail.autocompleting,
false,
detail.ac_position
);
this.handleEmojiSelection = ({ detail }) => {
debugger;
if (this.model.get('jid') === detail.jid) {
this.insertIntoTextArea(detail.value, detail.autocompleting, false, detail.ac_position);
}
}
document.addEventListener("emojiSelected", this.handleEmojiSelection);
this.render();
}

View File

@ -155,9 +155,10 @@ export default class EmojiPicker extends CustomElement {
const ac_position = this.model.get('ac_position');
this.model.set({'autocompleting': null, 'query': '', 'ac_position': null});
this.disableArrowNavigation();
const jid = this.chatview.model.get('jid');
const options = {
'bubbles': true,
'detail': { value, autocompleting, ac_position }
'detail': { value, autocompleting, ac_position, jid }
};
this.dispatchEvent(new CustomEvent("emojiSelected", options));
}