修复频道订阅失效的问题

main
落雨楓 3 years ago
parent d4415a0e34
commit 183a435480

@ -38,6 +38,7 @@ export class SubscribeManager {
this.subscribeConfig = {};
this.loadSubscribeFile();
this.rebuildTree();
}
public async initialize() {
@ -133,23 +134,7 @@ export class SubscribeManager {
* @param channelId ID
*/
public addChannel(channelId: string) {
this.subscribeList[channelId] = {};
for (let robotId in this.subscribeConfig) {
this.prepareTree(robotId, channelId); // 这里就先创建tree
let targetConf = this.subscribeConfig[robotId];
for (let targetType in targetConf) {
let targetList = targetConf[targetType];
for (let targetIdentity in targetList) {
let subscribeChannelList = targetList[targetIdentity];
if (subscribeChannelList.includes(channelId)) {
this.subscribeList[channelId][robotId].push({
type: targetType,
identity: targetIdentity
});
}
}
}
}
}
/**
@ -157,7 +142,7 @@ export class SubscribeManager {
* @param channelId ID
*/
public removeChannel(channelId: string) {
delete this.subscribeList[channelId];
}
/**

@ -1,9 +1,9 @@
qq:
user:
1234567890:
- some_channel_group/*
- some_channel_group # 订阅频道组会订阅下一级的全部频道,但是不会订阅更深层级的频道
- some_channel_group2/some_channel
group:
1234567890:
- some_channel_group/*
- some_channel_group
- some_channel_group2/some_channel

Loading…
Cancel
Save