I am creating a chat room using the converse js package on my react project. I am trying to add an icon in every massage of the user like the screenshot. The condition is this icon can see only the admin.
I was trying to do that by event but I think there is no event for this, My main purpose is I want to add an icon that can see by the admin if the admin clicks on the icon then a drop menu will show.
export const restrictUserOnLoadPlugin = () => {
window.converse.plugins.add('restrict-user', {
dependencies: [],
initialize: function () {
const _converse = this._converse;
// _converse.api.listen.on('getMessageActionButtons', (el, buttons) => {
// console.log(buttons);
// buttons.push({
// i18n_text: 'Foo',
// handler: (ev) => alert('Foo!'),
// button_class: 'chat-msg__action-foo',
// icon_class: 'fa fa-check',
// name: 'foo',
// });
// console.log(buttons);
// return buttons;
// });
},
});
};
is there any event for adding the icon? or any other way?