From fb646552b91d7d3c953daa46456a1c3e15c7c30c Mon Sep 17 00:00:00 2001 From: Aska Date: Tue, 8 Sep 2026 02:41:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(weixin):=20=E6=89=AB=E7=A0=81=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E6=97=B6=E6=8A=8A=E4=B8=BB=E4=BA=BAuser=5Fid=E5=B9=B6?= =?UTF-8?q?=E5=85=A5allow=5Fusers=E7=99=BD=E5=90=8D=E5=8D=95=E2=80=94?= =?UTF-8?q?=E2=80=94=E4=BF=AE=E5=A4=8D=E4=B8=BB=E4=BA=BA=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E8=A2=AB=E5=BD=93stranger=E9=9D=99=E9=BB=98=E4=B8=8D=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/gateway/admin_channels_weixin.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/internal/services/gateway/admin_channels_weixin.go b/internal/services/gateway/admin_channels_weixin.go index a811365..a57b98c 100644 --- a/internal/services/gateway/admin_channels_weixin.go +++ b/internal/services/gateway/admin_channels_weixin.go @@ -149,12 +149,28 @@ func (s *Server) persistWeixinConfirmed(platform, accountID, token, botID, owner if ownerID != "" { cfg["owner_id"] = ownerID } + // Ensure the binding user (the scanner) lands in the channel's allow list, so + // the bridge recognises it as the owner and replies instead of silencing it as + // a stranger (actor_role=unknown / env=stranger). + allowUsers := append([]string(nil), base.AllowUsers...) + if ownerID != "" { + found := false + for _, u := range allowUsers { + if u == ownerID { + found = true + break + } + } + if !found { + allowUsers = append(allowUsers, ownerID) + } + } acct := config.ChannelAccount{ ID: base.ID, Config: cfg, AllowGroups: base.AllowGroups, DenyGroups: base.DenyGroups, - AllowUsers: base.AllowUsers, + AllowUsers: allowUsers, DenyUsers: base.DenyUsers, GroupMsgPerMin: base.GroupMsgPerMin, MsgPerMin: base.MsgPerMin,