|
|
|
@ -10,6 +10,37 @@
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
#define OBJ_TYPE struct string_pair
|
|
|
|
|
static struct json_object_field emoji_layout[] = {
|
|
|
|
|
{
|
|
|
|
|
.key = "shortcode",
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, key ),
|
|
|
|
|
.type = &json_field_string,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.key = "static_url",
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, value ),
|
|
|
|
|
.type = &json_field_string,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.key = "url",
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, value ),
|
|
|
|
|
.type = &json_field_string,
|
|
|
|
|
},
|
|
|
|
|
JSON_FIELD_FIXED_BOOL( visible_in_picker, false ),
|
|
|
|
|
JSON_FIELD_END,
|
|
|
|
|
};
|
|
|
|
|
#undef OBJ_TYPE
|
|
|
|
|
|
|
|
|
|
struct json_field_type emoji_composite_type = {
|
|
|
|
|
.reader = json_field_object_composite_reader,
|
|
|
|
|
.writer = json_field_object_composite_writer,
|
|
|
|
|
.size = sizeof( struct string_pair ),
|
|
|
|
|
.layout = emoji_layout,
|
|
|
|
|
.alloc = NULL,
|
|
|
|
|
.free = NULL,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define OBJ_TYPE struct account
|
|
|
|
|
static struct json_object_field pleroma_layout[] = {
|
|
|
|
|
JSON_FIELD_FIXED_BOOL( accepts_chat_messages, false ),
|
|
|
|
@ -125,7 +156,12 @@ struct json_object_field api_Account_layout[] = {
|
|
|
|
|
.type = &json_field_callback_string,
|
|
|
|
|
.string_callback = display_name_callback,
|
|
|
|
|
},
|
|
|
|
|
JSON_FIELD_EMPTY_ARRAY( emojis, true ),
|
|
|
|
|
{
|
|
|
|
|
.key = "emojis",
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, emoji ),
|
|
|
|
|
.type = &json_field_array_of,
|
|
|
|
|
.array_item_type = &emoji_composite_type,
|
|
|
|
|
},
|
|
|
|
|
JSON_FIELD_EMPTY_ARRAY( fields, true ),
|
|
|
|
|
JSON_FIELD_INTEGER( followers_count, true ),
|
|
|
|
|
JSON_FIELD_INTEGER( following_count, true ),
|
|
|
|
|