ソースを参照

Add some IDs to webhook body

Andrés Manelli 7 年 前
コミット
a96ece2c11
2 ファイル変更10 行追加0 行削除
  1. 5 0
      models/activities.js
  2. 5 0
      server/notifications/outgoing.js

+ 5 - 0
models/activities.js

@@ -73,12 +73,14 @@ if (Meteor.isServer) {
       // No need send notification to user of activity
       // No need send notification to user of activity
       // participants = _.union(participants, [activity.userId]);
       // participants = _.union(participants, [activity.userId]);
       params.user = activity.user().getName();
       params.user = activity.user().getName();
+      params.userId = activity.userId;
     }
     }
     if (activity.boardId) {
     if (activity.boardId) {
       board = activity.board();
       board = activity.board();
       params.board = board.title;
       params.board = board.title;
       title = 'act-withBoardTitle';
       title = 'act-withBoardTitle';
       params.url = board.absoluteUrl();
       params.url = board.absoluteUrl();
+      params.boardId = activity.boardId;
     }
     }
     if (activity.memberId) {
     if (activity.memberId) {
       participants = _.union(participants, [activity.memberId]);
       participants = _.union(participants, [activity.memberId]);
@@ -88,11 +90,13 @@ if (Meteor.isServer) {
       const list = activity.list();
       const list = activity.list();
       watchers = _.union(watchers, list.watchers || []);
       watchers = _.union(watchers, list.watchers || []);
       params.list = list.title;
       params.list = list.title;
+      params.listId = activity.listId;
     }
     }
     if (activity.oldListId) {
     if (activity.oldListId) {
       const oldList = activity.oldList();
       const oldList = activity.oldList();
       watchers = _.union(watchers, oldList.watchers || []);
       watchers = _.union(watchers, oldList.watchers || []);
       params.oldList = oldList.title;
       params.oldList = oldList.title;
+      params.oldListId = activity.oldListId;
     }
     }
     if (activity.cardId) {
     if (activity.cardId) {
       const card = activity.card();
       const card = activity.card();
@@ -101,6 +105,7 @@ if (Meteor.isServer) {
       params.card = card.title;
       params.card = card.title;
       title = 'act-withCardTitle';
       title = 'act-withCardTitle';
       params.url = card.absoluteUrl();
       params.url = card.absoluteUrl();
+      params.cardId = activity.cardId;
     }
     }
     if (activity.commentId) {
     if (activity.commentId) {
       const comment = activity.comment();
       const comment = activity.comment();

+ 5 - 0
server/notifications/outgoing.js

@@ -28,6 +28,11 @@ Meteor.methods({
       text: `${text}`,
       text: `${text}`,
     };
     };
 
 
+    ['cardId', 'listId', 'oldListId', 'boardId'].forEach((key) => {
+      if (params[key]) value[key] = params[key];
+    });
+    value['description'] = description;
+
     const options = {
     const options = {
       headers: {
       headers: {
         // 'Content-Type': 'application/json',
         // 'Content-Type': 'application/json',