Skip to content

Commit

Permalink
Merge pull request #9720 from RocketChat/fix/quoting-integration-mess…
Browse files Browse the repository at this point in the history
…age-breaking

[FIX] Messages can't be quoted sometimes
  • Loading branch information
rodrigok committed Feb 14, 2018
1 parent 617c426 commit 4b35658
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ this.processWebhookMessage = function(messageObj, user, defaultValues = { channe
const message = {
alias: messageObj.username || messageObj.alias || defaultValues.alias,
msg: s.trim(messageObj.text || messageObj.msg || ''),
attachments: messageObj.attachments,
attachments: messageObj.attachments || [],
parseUrls: messageObj.parseUrls !== undefined ? messageObj.parseUrls : !messageObj.attachments,
bot: messageObj.bot,
groupable: (messageObj.groupable !== undefined) ? messageObj.groupable : false
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-oembed/server/jumpToMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import QueryString from 'querystring';

const recursiveRemove = (message, deep = 1) => {
if (message) {
if ('attachments' in message && deep < RocketChat.settings.get('Message_QuoteChainLimit')) {
if ('attachments' in message && message.attachments !== null && deep < RocketChat.settings.get('Message_QuoteChainLimit')) {
message.attachments.map((msg) => recursiveRemove(msg, deep + 1));
} else {
delete(message.attachments);
Expand Down

0 comments on commit 4b35658

Please sign in to comment.