修改频道配置

main
root 2 years ago
parent d4415a0e34
commit 3038d5d088

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

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

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

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

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

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

@ -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];
}
/**

Loading…
Cancel
Save