mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Hide uneditable spaces from menu
This commit is contained in:
parent
376612e4eb
commit
9714486447
1 changed files with 7 additions and 1 deletions
|
@ -751,6 +751,12 @@ CommunitiesModel::spaceChildrenListFromIndex(QString room, int idx) const
|
||||||
const auto &e = spaceOrder_.tree[i];
|
const auto &e = spaceOrder_.tree[i];
|
||||||
if (e.depth == spaceOrder_.tree[begin].depth && spaces_.count(e.id)) {
|
if (e.depth == spaceOrder_.tree[begin].depth && spaces_.count(e.id)) {
|
||||||
bool canSendChild = Permissions(e.id).canChange(qml_mtx_events::SpaceChild);
|
bool canSendChild = Permissions(e.id).canChange(qml_mtx_events::SpaceChild);
|
||||||
|
// For now hide the space, if we can't send any child, since then the only allowed
|
||||||
|
// action would be removing a space and even that only works if it currently only has a
|
||||||
|
// parent set in the child.
|
||||||
|
if (!canSendChild)
|
||||||
|
continue;
|
||||||
|
|
||||||
auto spaceId = e.id.toStdString();
|
auto spaceId = e.id.toStdString();
|
||||||
auto child =
|
auto child =
|
||||||
cache::client()->getStateEvent<mtx::events::state::space::Child>(spaceId, room_);
|
cache::client()->getStateEvent<mtx::events::state::space::Child>(spaceId, room_);
|
||||||
|
|
Loading…
Reference in a new issue