Skip to content

Commit

Permalink
Add the reason the message was reported
Browse files Browse the repository at this point in the history
  • Loading branch information
tapiarafael committed May 2, 2022
1 parent bcc5fb2 commit a42fb6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/meteor/app/apps/server/bridges/listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ export class AppListenerBridge {
isStarred,
};
case AppInterface.IPostMessageReported:
const [userReported] = payload;
const [userReported, reason] = payload;
return {
message: msg,
user: this.orch.getConverters().get('users').convertToApp(userReported),
reason,
};
default:
return msg;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/server/methods/reportMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Meteor.methods({

await Reports.createWithMessageDescriptionAndUserId(message, description, uid);

Promise.await(Apps.triggerEvent(AppEvents.IPostMessageReported, message, Meteor.user()));
Promise.await(Apps.triggerEvent(AppEvents.IPostMessageReported, message, Meteor.user(), description));

return true;
},
Expand Down

0 comments on commit a42fb6e

Please sign in to comment.