mirror of
https://github.com/matrix-construct/construct
synced 2024-11-15 14:31:11 +01:00
modules/client/sync/account_data: Fix return value from push_rules handler when no rules.
This commit is contained in:
parent
9d5d2cc184
commit
df39547fa1
1 changed files with 5 additions and 3 deletions
|
@ -167,7 +167,8 @@ ircd::m::sync::push_rules(data &data)
|
|||
content, "global"
|
||||
};
|
||||
|
||||
const auto each_kind{[&_scope, &pushrules]
|
||||
bool ret{false};
|
||||
const auto each_kind{[&_scope, &pushrules, &ret]
|
||||
(const string_view &scope, const string_view &kind)
|
||||
{
|
||||
json::stack::array _kind
|
||||
|
@ -175,10 +176,11 @@ ircd::m::sync::push_rules(data &data)
|
|||
_scope, kind
|
||||
};
|
||||
|
||||
pushrules.for_each(push::path{scope, kind, {}}, [&_kind]
|
||||
pushrules.for_each(push::path{scope, kind, {}}, [&_kind, &ret]
|
||||
(const auto &event_idx, const auto &path, const json::object &rule)
|
||||
{
|
||||
_kind.append(rule);
|
||||
ret |= true;
|
||||
return true;
|
||||
});
|
||||
}};
|
||||
|
@ -188,5 +190,5 @@ ircd::m::sync::push_rules(data &data)
|
|||
each_kind("global", "room");
|
||||
each_kind("global", "sender");
|
||||
each_kind("global", "underride");
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue