Skip to content

Commit

Permalink
Slack: remove "ignore myself" from sources(PipedreamHQ#3944)
Browse files Browse the repository at this point in the history
Remove ignoreMyself prop from Slack sources

Keep ignoreMyself prop in New Direct Message source and set default to
false

ignoreMyself is removed to make it easier to generate test events when
configuring the trigger in a workflow.
  • Loading branch information
js07 authored Aug 5, 2022
1 parent 43a5987 commit 8ca1469
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 32 deletions.
2 changes: 1 addition & 1 deletion components/slack/slack.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ export default {
type: "boolean",
label: "Ignore myself",
description: "Ignore messages from me",
default: true,
default: false,
},
word: {
type: "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
...common,
key: "slack-new-direct-message",
name: "New Direct Message (Instant)",
version: "0.0.1",
version: "1.0.0",
description: "Emit new event when a message was posted in a direct message channel",
type: "source",
dedupe: "unique",
Expand Down
11 changes: 1 addition & 10 deletions components/slack/sources/new-mention/new-mention.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
...common,
key: "slack-new-mention",
name: "New Mention (Instant)",
version: "0.0.1",
version: "1.0.0",
description: "Emit new event when a username or specific word is mentioned in a channel",
type: "source",
dedupe: "unique",
Expand All @@ -30,12 +30,6 @@ export default {
];
},
},
ignoreMyself: {
propDefinition: [
common.props.slack,
"ignoreMyself",
],
},
word: {
propDefinition: [
common.props.slack,
Expand Down Expand Up @@ -73,9 +67,6 @@ export default {
console.log("Ignoring message with subtype.");
return;
}
if (this.ignoreMyself && event.user == this.slack.mySlackId()) {
return;
}
if ((this.ignoreBot) && (event.subtype == "bot_message" || event.bot_id)) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
...common,
key: "slack-new-message-in-channels",
name: "New Message In Channels (Instant)",
version: "0.0.7",
version: "1.0.0",
description: "Emit new event when a new message is posted to one or more channels",
type: "source",
dedupe: "unique",
Expand All @@ -30,12 +30,6 @@ export default {
];
},
},
ignoreMyself: {
propDefinition: [
common.props.slack,
"ignoreMyself",
],
},
resolveNames: {
propDefinition: [
common.props.slack,
Expand Down Expand Up @@ -67,9 +61,6 @@ export default {
console.log("Ignoring message with subtype.");
return;
}
if (this.ignoreMyself && event.user == this.slack.mySlackId()) {
return;
}
if ((this.ignoreBot) && (event.subtype == "bot_message" || event.bot_id)) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
...common,
key: "slack-new-reaction-added",
name: "New Reaction Added (Instant)",
version: "0.0.1",
version: "1.0.0",
description: "Emit new event when a member has added an emoji reaction to an item",
type: "source",
dedupe: "unique",
Expand Down Expand Up @@ -38,12 +38,6 @@ export default {
];
},
},
ignoreMyself: {
propDefinition: [
common.props.slack,
"ignoreMyself",
],
},
ignoreBot: {
propDefinition: [
common.props.slack,
Expand All @@ -56,9 +50,6 @@ export default {
return "New reaction added";
},
async processEvent(event) {
if (this.ignoreMyself && event.user == this.slack.mySlackId()) {
return;
}
if ((this.ignoreBot) && (event.subtype == "bot_message" || event.bot_id)) {
return;
}
Expand Down

0 comments on commit 8ca1469

Please sign in to comment.