File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
app/lib/methods/subscriptions Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,23 @@ export default class RoomSubscription {
261261 try {
262262 const messageRecord = await getMessageById ( message . _id ) ;
263263 if ( messageRecord ) {
264+ if ( messageRecord . t === 'e2e' && message . attachments ) {
265+ message . attachments = message . attachments ?. map ( att => {
266+ const existing = messageRecord . attachments ?. find (
267+ a =>
268+ ( a . image_url && a . image_url === att . image_url ) ||
269+ ( a . video_url && a . video_url === att . video_url ) ||
270+ ( a . audio_url && a . audio_url === att . audio_url ) ||
271+ ( a . thumb_url && a . thumb_url === att . thumb_url )
272+ ) ;
273+
274+ return {
275+ ...att ,
276+ e2e : existing ?. e2e ,
277+ title_link : existing ?. e2e === 'done' ? existing ?. title_link : att . title_link
278+ } ;
279+ } ) ;
280+ }
264281 batch . push (
265282 messageRecord . prepareUpdate (
266283 protectedFunction ( ( m : TMessageModel ) => {
You can’t perform that action at this time.
0 commit comments