diff --git a/src/Notifier.ts b/src/Notifier.ts index 4f55046e72..2afc7d9901 100644 --- a/src/Notifier.ts +++ b/src/Notifier.ts @@ -68,7 +68,7 @@ export const Notifier = { // or not pendingEncryptedEventIds: [], - notificationMessageForEvent: function(ev: MatrixEvent) { + notificationMessageForEvent: function(ev: MatrixEvent): string { if (typehandlers.hasOwnProperty(ev.getContent().msgtype)) { return typehandlers[ev.getContent().msgtype](ev); } diff --git a/src/TextForEvent.tsx b/src/TextForEvent.tsx index 50bdae8ca9..4c2c264439 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -669,6 +669,7 @@ export function hasText(ev): boolean { return Boolean(handler?.(ev)); } +export function textForEvent(ev: MatrixEvent): string export function textForEvent(ev: MatrixEvent, allowJSX = false): string | JSX.Element { const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()]; return handler?.(ev, allowJSX)?.() || '';