peertube-plugin-livechat/conversejs/custom/plugins/tasks/task.js

30 lines
671 B
JavaScript
Raw Normal View History

2024-05-23 09:42:14 +00:00
// SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
//
// SPDX-License-Identifier: AGPL-3.0-only
2024-04-30 16:30:44 +00:00
import { Model } from '@converse/skeletor/src/model.js'
/**
* A chat room task.
* @class
* @namespace _converse.exports.ChatRoomTask
2024-04-30 16:30:44 +00:00
* @memberof _converse
*/
class ChatRoomTask extends Model {
idAttribute = 'id'
2024-05-06 15:26:20 +00:00
async saveItem () {
console.log('Saving task ' + this.get('id') + '...')
await this.collection.chatroom.taskManager.saveItem(this)
console.log('Task ' + this.get('id') + ' saved.')
}
async deleteItem () {
return this.collection.chatroom.taskManager.deleteItem(this)
}
2024-04-30 16:30:44 +00:00
}
export {
ChatRoomTask
}