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,