New moderator app WIP:
* #144: moderator notes WIP, * plugin size: adding an API, * refactoring the code from the task app, to create a new MUC App system.
This commit is contained in:
29
conversejs/custom/plugins/notes/note.js
Normal file
29
conversejs/custom/plugins/notes/note.js
Normal file
@ -0,0 +1,29 @@
|
||||
// SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { Model } from '@converse/skeletor/src/model.js'
|
||||
|
||||
/**
|
||||
* A chat room note.
|
||||
* @class
|
||||
* @namespace _converse.exports.ChatRoomNote
|
||||
* @memberof _converse
|
||||
*/
|
||||
class ChatRoomNote extends Model {
|
||||
idAttribute = 'id'
|
||||
|
||||
async saveItem () {
|
||||
console.log('Saving note ' + this.get('id') + '...')
|
||||
await this.collection.chatroom.noteManager.saveItem(this)
|
||||
console.log('Note ' + this.get('id') + ' saved.')
|
||||
}
|
||||
|
||||
async deleteItem () {
|
||||
return this.collection.chatroom.noteManager.deleteItems([this])
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
ChatRoomNote
|
||||
}
|
Reference in New Issue
Block a user