Task lists WIP:
* disco support
This commit is contained in:
@ -14,9 +14,6 @@ export function getHeadingButtons (view, buttons) {
|
||||
return buttons
|
||||
}
|
||||
|
||||
// TODO: use disco to discover the feature.
|
||||
// (if the chat is remote, the server could use a livechat version that does not support this feature)
|
||||
|
||||
// Adding a "Open task list" button.
|
||||
buttons.unshift({
|
||||
// eslint-disable-next-line no-undef
|
||||
@ -96,6 +93,12 @@ export function initOrDestroyChatRoomTaskLists (mucModel) {
|
||||
return _destroyChatRoomTaskLists(mucModel)
|
||||
}
|
||||
|
||||
// We must check disco features
|
||||
// (if the chat is remote, the server could use a livechat version that does not support this feature)
|
||||
if (!mucModel.features?.get?.(XMLNS_TASKLIST) || !mucModel.features?.get?.(XMLNS_TASK)) {
|
||||
return _destroyChatRoomTaskLists(mucModel)
|
||||
}
|
||||
|
||||
const myself = mucModel.getOwnOccupant()
|
||||
if (!myself || !['admin', 'owner'].includes(myself.get('affiliation'))) {
|
||||
// User must be admin or owner
|
||||
|
Reference in New Issue
Block a user