properly use parent_ids by storing them in a hash first

This commit is contained in:
2019-07-20 09:09:22 +02:00
parent b07b716a56
commit d9c276c68c
3 changed files with 34 additions and 14 deletions

View File

@@ -52,6 +52,7 @@ dc_channel_t dc_channel_from_json(json_t *j);
char const *dc_channel_id(dc_channel_t c);
char const *dc_channel_name(dc_channel_t c);
char const *dc_channel_parent_id(dc_channel_t c);
dc_channel_type_t dc_channel_type(dc_channel_t c);
bool dc_channel_is_dm(dc_channel_t c);

View File

@@ -249,6 +249,12 @@ char const *dc_channel_id(dc_channel_t c)
return c->id;
}
char const *dc_channel_parent_id(dc_channel_t c)
{
return_if_true(c == NULL, NULL);
return c->parent_id;
}
dc_channel_type_t dc_channel_type(dc_channel_t c)
{
return_if_true(c == NULL, -1);