[FIX] Data converters overriding fields added by apps (#16639)

pull/16644/head
Douglas Gubert 5 years ago committed by Diego Sampaio
parent 6649361db7
commit 997dcae9d2
No known key found for this signature in database
GPG Key ID: E060152B30502562
  1. 6
      app/apps/lib/misc/transformMappedData.js
  2. 1
      app/lib/server/functions/sendMessage.js

@ -73,8 +73,10 @@ export const transformMappedData = (data, map) => {
if (typeof result !== 'undefined') {
transformedData[to] = result;
}
} else if (typeof from === 'string' && typeof originalData[from] !== 'undefined') {
transformedData[to] = originalData[from];
} else if (typeof from === 'string') {
if (typeof originalData[from] !== 'undefined') {
transformedData[to] = originalData[from];
}
delete originalData[from];
}
});

@ -136,6 +136,7 @@ const validateMessage = (message) => {
emoji: String,
avatar: ValidPartialURLParam,
attachments: [Match.Any],
blocks: [Match.Any],
}));
if (Array.isArray(message.attachments) && message.attachments.length) {

Loading…
Cancel
Save