Task lists WIP:
* dropping role support, does not work.
This commit is contained in:
@ -25,8 +25,8 @@ converse.plugins.add('livechat-converse-tasks', {
|
||||
initOrDestroyChatRoomTaskLists(muc)
|
||||
})
|
||||
|
||||
// When the current user role changes, we must also delete or initilize the TaskLists object:
|
||||
muc.occupants.on('change:role', occupant => {
|
||||
// When the current user affiliation changes, we must also delete or initiliaze the TaskLists object:
|
||||
muc.occupants.on('change:affiliation', occupant => {
|
||||
if (occupant.get('jid') !== _converse.bare_jid) { // only for myself
|
||||
return
|
||||
}
|
||||
|
@ -97,8 +97,8 @@ export function initOrDestroyChatRoomTaskLists (mucModel) {
|
||||
}
|
||||
|
||||
const myself = mucModel.getOwnOccupant()
|
||||
if (!myself || !myself.isModerator()) {
|
||||
// User must be moderator
|
||||
if (!myself || !['admin', 'owner'].includes(myself.get('affiliation'))) {
|
||||
// User must be admin or owner
|
||||
return _destroyChatRoomTaskLists(mucModel)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user