summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/rest.c b/src/rest.c
index 8bde175..0ecfcbd 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -3943,14 +3943,20 @@ static int og_dbi_scope_get_computers_from_computers(const struct og_dbi *dbi,
char *query,
const uint32_t group_id);
+#define OG_COMPUTER_FOLDER_MARKER 0x00010000
+
static int og_dbi_scope_get_computers(const struct og_dbi *dbi, json_t *array,
- char *query)
+ char *query, bool in_room)
{
const char *msglog, *computers_name;
json_t *computers, *scope_array;
uint32_t computers_id;
+ uint32_t marker = 0;
dbi_result result;
+ if (in_room)
+ marker = OG_COMPUTER_FOLDER_MARKER;
+
result = dbi_conn_queryf(dbi->conn, query);
if (!result) {
dbi_conn_error(dbi->conn, &msglog);
@@ -3974,7 +3980,7 @@ static int og_dbi_scope_get_computers(const struct og_dbi *dbi, json_t *array,
json_string(computers_name));
json_object_set_new(computers, "type", json_string("folder"));
json_object_set_new(computers, "id",
- json_integer(computers_id));
+ json_integer(computers_id | marker));
json_object_set_new(computers, "scope", json_array());
json_array_append(array, computers);
json_decref(computers);
@@ -4018,7 +4024,7 @@ static int og_dbi_scope_get_computers_from_room(const struct og_dbi *dbi,
if (ret <= 0 || ret >= OG_QUERY_MAXLEN)
return -1;
- return og_dbi_scope_get_computers(dbi, array, query);
+ return og_dbi_scope_get_computers(dbi, array, query, true);
}
static int og_dbi_scope_get_computers_from_computers(const struct og_dbi *dbi,
@@ -4033,7 +4039,7 @@ static int og_dbi_scope_get_computers_from_computers(const struct og_dbi *dbi,
if (ret <= 0 || ret >= OG_QUERY_MAXLEN)
return -1;
- return og_dbi_scope_get_computers(dbi, array, query);
+ return og_dbi_scope_get_computers(dbi, array, query, false);
}
static int og_dbi_scope_get_room(const struct og_dbi *dbi, json_t *array,