修改频道配置

main
root 2 years ago
parent d4415a0e34
commit 3038d5d088

@ -1 +1 @@
name: "异世界百科" name: "异世界百科"

@ -1 +1 @@
name: "管理信息" name: "管理信息"

@ -1,11 +1,11 @@
name: 自动审核通过 name: 自动审核通过
provider: pusher provider: pusher
source: source:
service: pusher service: pusher
channel: isekaiwiki channel: isekaiwiki
type: autoReview type: autoReview
tpl: tpl:
default: |- default: |-
{{data.author}} 更新了新页面: {{data.title}} {{{author}}} 更新了新页面: {{{title}}}
{{data.summary}} {{{summary}}}
{{data.result}} {{{result}}}

@ -1,11 +1,12 @@
name: 待审页面 name: 待审页面
provider: pusher provider: pusher
source: source:
service: pusher service: pusher
channel: isekaiwiki channel: isekaiwiki
type: needReview type: needReview
tpl: tpl:
default: |- default: |-
Review队列更新 Review队列中增加了新页面:
{{data.author}} 更新了新页面: {{data.title}} 编辑者: {{{author}}}
{{data.summary}} 标题: {{{title}}}
{{{summary}}}

@ -1,11 +1,11 @@
name: 修改页面 name: 修改页面
provider: pusher provider: pusher
source: source:
service: pusher service: pusher
channel: isekaiwiki channel: isekaiwiki
type: edit type: edit
tpl: tpl:
default: |- default: |-
{{data.author}} 更新了页面: {{data.title}} {{{author}}} 更新了页面《{{{title}}}》:
{{data.summary}} {{{summary}}}
{{data.url}} {{{url}}}

@ -1,11 +1,12 @@
name: 新页面 name: 新页面
provider: pusher provider: pusher
source: source:
service: pusher service: pusher
channel: isekaiwiki channel: isekaiwiki
type: new type: new
tpl: tpl:
default: |- default: |-
{{data.author}} 创建了新页面: {{data.title}} {{{author}}} 创建了新页面《{{{title}}}》:
{{data.summary}} {{{summary}}}
{{data.url}}
{{{url}}}

@ -38,6 +38,7 @@ export class SubscribeManager {
this.subscribeConfig = {}; this.subscribeConfig = {};
this.loadSubscribeFile(); this.loadSubscribeFile();
this.rebuildTree();
} }
public async initialize() { public async initialize() {
@ -133,23 +134,7 @@ export class SubscribeManager {
* @param channelId ID * @param channelId ID
*/ */
public addChannel(channelId: string) { 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 * @param channelId ID
*/ */
public removeChannel(channelId: string) { public removeChannel(channelId: string) {
delete this.subscribeList[channelId];
} }
/** /**

Loading…
Cancel
Save