Skip to content

Commit 9c69624

Browse files
committed
Fix bug where non-public messages were forwarded
1 parent 2c30707 commit 9c69624

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Version 0.1.1
66

77
To be released.
88

9+
- Fixed a bug where direct and followers-only messages that reply to a bot
10+
had been forwarded to the bot's followers.
11+
912

1013
Version 0.1.0
1114
-------------

src/bot-impl.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,11 @@ export class BotImpl<TContextData> implements Bot<TContextData> {
633633
messageClasses.includes(replyTarget.class)
634634
) {
635635
const message = await getMessage();
636-
await ctx.forwardActivity(this, "followers");
636+
if (
637+
message.visibility === "public" || message.visibility === "unlisted"
638+
) {
639+
await ctx.forwardActivity(this, "followers");
640+
}
637641
await this.onReply(session, message);
638642
}
639643
for await (const tag of object.getTags(ctx)) {

0 commit comments

Comments
 (0)