fix: seedIdentities 硬编码配置名导致admin身份丢失
- 迁移后配置名 qq→obv11-main,但seed用["obv11"]查不到 - 改为遍历store.List()所有配置,不再硬编码名字 - admin消息不再被当普通人处理而丢失回复 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -992,13 +992,12 @@ func seedIdentities(m *bridge.IdentityMapper, store *config.Store, adminNickname
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// From stored platform configs (admin_uids field).
|
// From stored platform configs (admin_uids field) — iterate all configs.
|
||||||
for _, name := range []string{"obv11", "telegram", "webhook", "wechat", "feishu", "discord"} {
|
for _, cfg := range store.List() {
|
||||||
stored, _ := store.Get(name)
|
if !cfg.Enabled {
|
||||||
if stored == nil {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
syncAdminUIDs(m, name, stored.Fields, adminNickname)
|
syncAdminUIDs(m, cfg.Platform, cfg.Fields, adminNickname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user