* Remove comments * Show custom emoji first in suggestions * Show global image packs in emoji picker * Display emoji and sticker in room settings * Fix some pack not visible in emojiboard * WIP * Add/delete/rename images to exisitng packs * Change pack avatar, name & attribution * Add checkbox to make pack global * Bug fix * Create or delete pack * Add personal emoji in settings * Show global pack selector in settings * Show space emoji in emojiboard * Send custom emoji reaction as mxc * Render stickers as stickers * Fix sticker jump bug * Fix reaction width * Fix stretched custom emoji * Fix sending space emoji in message * Remove unnessesary comments * Send user pills * Fix pill generating regex * Add support for sending stickers
34 lines
779 B
JavaScript
34 lines
779 B
JavaScript
import initMatrix from '../initMatrix';
|
|
|
|
async function redactEvent(roomId, eventId, reason) {
|
|
const mx = initMatrix.matrixClient;
|
|
|
|
try {
|
|
await mx.redactEvent(roomId, eventId, undefined, typeof reason === 'undefined' ? undefined : { reason });
|
|
return true;
|
|
} catch (e) {
|
|
throw new Error(e);
|
|
}
|
|
}
|
|
|
|
async function sendReaction(roomId, toEventId, reaction, shortcode) {
|
|
const mx = initMatrix.matrixClient;
|
|
const content = {
|
|
'm.relates_to': {
|
|
event_id: toEventId,
|
|
key: reaction,
|
|
rel_type: 'm.annotation',
|
|
},
|
|
};
|
|
if (typeof shortcode === 'string') content.shortcode = shortcode;
|
|
try {
|
|
await mx.sendEvent(roomId, 'm.reaction', content);
|
|
} catch (e) {
|
|
throw new Error(e);
|
|
}
|
|
}
|
|
|
|
export {
|
|
redactEvent,
|
|
sendReaction,
|
|
};
|