diff --git a/app/discussion/client/createDiscussionMessageAction.js b/app/discussion/client/createDiscussionMessageAction.js index 7d107be268b2..120001c9e52d 100644 --- a/app/discussion/client/createDiscussionMessageAction.js +++ b/app/discussion/client/createDiscussionMessageAction.js @@ -22,12 +22,12 @@ Meteor.startup(function() { label: 'Discussion_start', context: ['message', 'message-mobile'], async action() { - const { msg: message } = messageArgs(this); + const { msg: message, room } = messageArgs(this); imperativeModal.open({ component: CreateDiscussion, props: { - defaultParentRoom: message.rid, + defaultParentRoom: room.prid || room._id, onClose: imperativeModal.close, parentMessageId: message._id, nameSuggestion: message?.msg?.substr(0, 140), diff --git a/app/discussion/client/discussionFromMessageBox.js b/app/discussion/client/discussionFromMessageBox.js index 668cf6ac75b5..e2a8b29c845b 100644 --- a/app/discussion/client/discussionFromMessageBox.js +++ b/app/discussion/client/discussionFromMessageBox.js @@ -20,7 +20,7 @@ Meteor.startup(function() { imperativeModal.open({ component: CreateDiscussion, props: { - defaultParentRoom: data.rid, + defaultParentRoom: data.prid || data.rid, onClose: imperativeModal.close, }, }); diff --git a/app/discussion/server/methods/createDiscussion.js b/app/discussion/server/methods/createDiscussion.js index b9d28a0d58df..8c1ea7dbb3d3 100644 --- a/app/discussion/server/methods/createDiscussion.js +++ b/app/discussion/server/methods/createDiscussion.js @@ -38,7 +38,7 @@ const mentionMessage = (rid, { _id, username, name }, message_embedded) => { }; const create = ({ prid, pmid, t_name, reply, users, user, encrypted }) => { - // if you set both, prid and pmid, and the rooms doesnt match... should throw an error) + // if you set both, prid and pmid, and the rooms dont match... should throw an error) let message = false; if (pmid) { message = Messages.findOne({ _id: pmid }); diff --git a/app/ui-message/client/messageBox/messageBox.js b/app/ui-message/client/messageBox/messageBox.js index 8d67e3466bdc..d8cf0424deff 100644 --- a/app/ui-message/client/messageBox/messageBox.js +++ b/app/ui-message/client/messageBox/messageBox.js @@ -477,6 +477,7 @@ Template.messageBox.events({ data: { rid: this.rid, tmid: this.tmid, + prid: this.subscription.prid, messageBox: instance.firstNode, }, activeElement: event.currentTarget, @@ -494,6 +495,7 @@ Template.messageBox.events({ rid: this.rid, tmid: this.tmid, messageBox: instance.firstNode, + prid: this.subscription.prid, event, }); });