MCPcopy Create free account
hub / github.com/dailydotdev/apps / getMessagePreview

Function getMessagePreview

packages/shared/src/features/messages/media.ts:70–79  ·  view source on GitHub ↗
(body: string)

Source from the content-addressed store, hash-verified

68
69// A one-line summary for the inbox, where raw markdown would read as noise.
70export const getMessagePreview = (body: string): string =>
71 parseMessageBody(body)
72 .map((part) => {
73 if (part.type === 'text') {
74 return part.text;
75 }
76
77 return part.isGif ? 'GIF' : 'Image';
78 })
79 .join(' ');
80
81const cleanAlt = (alt: string): string => alt.replace(/[[\]\n]/g, ' ').trim();
82

Callers 3

media.spec.tsFile · 0.90
ConversationRowFunction · 0.90
getMessagePushPreviewFunction · 0.85

Calls 1

parseMessageBodyFunction · 0.85

Tested by

no test coverage detected