diff --git a/CHANGES.md b/CHANGES.md index 2aa61ffa9..0af029be5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ - #2936: Fix documentation about enable_smacks option, which is true by default. - #3005: Fix MUC messages with a fallback body not rendering. - #3007: Fix links becoming text when a message is edited +- #3018: Fix MUC icons not functioning. ## 9.1.1 (2022-05-05) diff --git a/src/plugins/bookmark-views/utils.js b/src/plugins/bookmark-views/utils.js index db1a21f1d..5df258e86 100644 --- a/src/plugins/bookmark-views/utils.js +++ b/src/plugins/bookmark-views/utils.js @@ -27,8 +27,8 @@ export function getHeadingButtons (view, buttons) { export async function removeBookmarkViaEvent (ev) { ev.preventDefault(); - const name = ev.target.getAttribute('data-bookmark-name'); - const jid = ev.target.getAttribute('data-room-jid'); + const name = ev.currentTarget.getAttribute('data-bookmark-name'); + const jid = ev.currentTarget.getAttribute('data-room-jid'); const result = await api.confirm(__('Are you sure you want to remove the bookmark "%1$s"?', name)); if (result) { invokeMap(_converse.bookmarks.where({ jid }), Model.prototype.destroy); @@ -37,7 +37,7 @@ export async function removeBookmarkViaEvent (ev) { export function addBookmarkViaEvent (ev) { ev.preventDefault(); - const jid = ev.target.getAttribute('data-room-jid'); + const jid = ev.currentTarget.getAttribute('data-room-jid'); api.modal.show(MUCBookmarkFormModal, { jid }, ev); } diff --git a/src/plugins/roomslist/view.js b/src/plugins/roomslist/view.js index b8e68765a..f1aee0fa7 100644 --- a/src/plugins/roomslist/view.js +++ b/src/plugins/roomslist/view.js @@ -55,7 +55,7 @@ export class RoomsList extends CustomElement { } showRoomDetailsModal (ev) { // eslint-disable-line class-methods-use-this - const jid = ev.target.getAttribute('data-room-jid'); + const jid = ev.currentTarget.getAttribute('data-room-jid'); const room = _converse.chatboxes.get(jid); ev.preventDefault(); api.modal.show(RoomDetailsModal, {'model': room}, ev); @@ -73,10 +73,10 @@ export class RoomsList extends CustomElement { async closeRoom (ev) { // eslint-disable-line class-methods-use-this ev.preventDefault(); - const name = ev.target.getAttribute('data-room-name'); + const name = ev.currentTarget.getAttribute('data-room-name'); + const jid = ev.currentTarget.getAttribute('data-room-jid'); const result = await api.confirm(__("Are you sure you want to leave the groupchat %1$s?", name)); if (result) { - const jid = ev.target.getAttribute('data-room-jid'); const room = await api.rooms.get(jid); room.close(); }