Task lists WIP:
* some front end work.
This commit is contained in:
@ -1,9 +1,6 @@
|
||||
import { Collection } from '@converse/skeletor/src/collection.js'
|
||||
import { ChatRoomTaskList } from './task-list'
|
||||
import { XMLNS_TASKLIST } from './constants'
|
||||
import { initStorage } from '@converse/headless/utils/storage.js'
|
||||
import { converse, api } from '@converse/headless/core'
|
||||
const { $build } = converse.env
|
||||
|
||||
/**
|
||||
* A list of {@link _converse.ChatRoomTaskList} instances, representing task lists associated to a MUC.
|
||||
@ -37,9 +34,7 @@ class ChatRoomTaskLists extends Collection {
|
||||
if (!name) { throw new Error('Missing name') }
|
||||
|
||||
console.log('Creating task list ' + name + '...')
|
||||
const item = $build('item').c('tasklist', { xmlns: XMLNS_TASKLIST })
|
||||
item.c('name').t(name)
|
||||
await api.pubsub.publish(this.chatroom.get('jid'), 'livechat-tasks', item)
|
||||
await this.chatroom.taskManager.createItem(this, { name })
|
||||
console.log('Task list ' + name + ' created.')
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user