mirror of
https://github.com/swaywm/sway.git
synced 2024-12-27 07:26:55 +01:00
swaymsg: parse success of single object
Allows swaymsg to parse the success attribute of a single object response. This is needed for the subscribe event.
This commit is contained in:
parent
9d18d81d48
commit
e62ab6ddbd
1 changed files with 3 additions and 0 deletions
|
@ -32,6 +32,9 @@ static bool success_object(json_object *result) {
|
|||
// Iterate results array and return false if any of them failed
|
||||
static bool success(json_object *r, bool fallback) {
|
||||
if (!json_object_is_type(r, json_type_array)) {
|
||||
if (json_object_is_type(r, json_type_object)) {
|
||||
return success_object(r);
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue