Skip to content

Commit

Permalink
[FIX] Discussions created inside discussions (#23733)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored Nov 17, 2021
1 parent 56b6d33 commit 6ede939
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/discussion/client/createDiscussionMessageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion app/discussion/client/discussionFromMessageBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Meteor.startup(function() {
imperativeModal.open({
component: CreateDiscussion,
props: {
defaultParentRoom: data.rid,
defaultParentRoom: data.prid || data.rid,
onClose: imperativeModal.close,
},
});
Expand Down
2 changes: 1 addition & 1 deletion app/discussion/server/methods/createDiscussion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
2 changes: 2 additions & 0 deletions app/ui-message/client/messageBox/messageBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ Template.messageBox.events({
data: {
rid: this.rid,
tmid: this.tmid,
prid: this.subscription.prid,
messageBox: instance.firstNode,
},
activeElement: event.currentTarget,
Expand All @@ -494,6 +495,7 @@ Template.messageBox.events({
rid: this.rid,
tmid: this.tmid,
messageBox: instance.firstNode,
prid: this.subscription.prid,
event,
});
});
Expand Down

0 comments on commit 6ede939

Please sign in to comment.