Skip to content

Commit

Permalink
Fix: don't show folders in trash
Browse files Browse the repository at this point in the history
  • Loading branch information
nivram913 committed Apr 4, 2024
1 parent b492ff3 commit ae0de77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions digiposte_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static resp_stuct* prepare_request(const req_type req_type, const char *url, con
static void construct_folder_rec(c_folder *folder, json_object *root)
{
int n, i;
json_object *j_folders, *tmp, *field_id, *field_name;
json_object *j_folders, *tmp, *field_id, *field_name, *field_location;
c_folder *new;

j_folders = json_object_object_get(root, "folders");
Expand All @@ -183,7 +183,9 @@ static void construct_folder_rec(c_folder *folder, json_object *root)
tmp = json_object_array_get_idx(j_folders, i);
field_id = json_object_object_get(tmp, "id");
field_name = json_object_object_get(tmp, "name");
new = add_folder(folder, json_object_get_string(field_id), json_object_get_string(field_name));
field_location = json_object_object_get(tmp, "location");
if (strncmp(json_object_get_string(field_location), "TRASH", 6) != 0)
new = add_folder(folder, json_object_get_string(field_id), json_object_get_string(field_name));

construct_folder_rec(new, tmp);
}
Expand Down

0 comments on commit ae0de77

Please sign in to comment.