|
|
|
@ -64,33 +64,66 @@ struct json_object_field signature_types[] = {
|
|
|
|
|
{ NULL },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct json_object_field ap_activity_layout[] = {
|
|
|
|
|
{ "@context", offsetof( struct ap_activity, ap_context ), false, &ap_activity_context_type },
|
|
|
|
|
{ "id", offsetof( struct ap_activity, id ), true, &json_field_string },
|
|
|
|
|
{ "actor", offsetof( struct ap_activity, actor ), true, &json_field_string },
|
|
|
|
|
{ "state", offsetof( struct ap_activity, state ), false, &json_field_string },
|
|
|
|
|
|
|
|
|
|
{ "content", offsetof( struct ap_activity, content ), false, &json_field_string },
|
|
|
|
|
{ "conversation", offsetof( struct ap_activity, conversation ), false, &json_field_string },
|
|
|
|
|
{ "published", offsetof( struct ap_activity, published ), false, &json_field_date_time },
|
|
|
|
|
{ "sensitive", offsetof( struct ap_activity, sensitive ), false, &json_field_bool_or_null },
|
|
|
|
|
{ "source", offsetof( struct ap_activity, source ), false, &json_field_string },
|
|
|
|
|
{ "summary", offsetof( struct ap_activity, summary), false, &json_field_string },
|
|
|
|
|
|
|
|
|
|
{ "tag", offsetof( struct ap_activity, tags ), false, &json_field_array_of, &ap_activity_tag_type },
|
|
|
|
|
|
|
|
|
|
{ "context", offsetof( struct ap_activity, context ), false, &json_field_string },
|
|
|
|
|
//{ "context_id", offsetof( struct ap_activity, context_id ), false, &json_field_integer },
|
|
|
|
|
|
|
|
|
|
{ "attributedTo", offsetof( struct ap_activity, attributed_to ), false, &json_field_string },
|
|
|
|
|
#define OBJ_TYPE struct ap_activity
|
|
|
|
|
struct json_object_field ap_activity_layout[] = {
|
|
|
|
|
{
|
|
|
|
|
.key = "@context",
|
|
|
|
|
.offset = offsetof( OBJ_TYPE, ap_context ),
|
|
|
|
|
.required = false,
|
|
|
|
|
.type = &ap_activity_context_type
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
JSON_FIELD_STRING(id,true),
|
|
|
|
|
JSON_FIELD_STRING(actor,true),
|
|
|
|
|
JSON_FIELD_STRING(state,false),
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
.key = "content",
|
|
|
|
|
.offset = offsetof( struct ap_activity, content.value ),
|
|
|
|
|
.required = false,
|
|
|
|
|
.type = &json_field_string
|
|
|
|
|
},
|
|
|
|
|
JSON_FIELD_STRING(conversation,false),
|
|
|
|
|
JSON_FIELD_DATETIME(published,false),
|
|
|
|
|
{
|
|
|
|
|
.key = "sensitive",
|
|
|
|
|
.offset = offsetof( struct ap_activity, sensitive ),
|
|
|
|
|
.required = false,
|
|
|
|
|
.type = &json_field_bool_or_null
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.key = "source",
|
|
|
|
|
.offset = offsetof( struct ap_activity, source.value ),
|
|
|
|
|
.required = false,
|
|
|
|
|
.type = &json_field_string
|
|
|
|
|
},
|
|
|
|
|
JSON_FIELD_STRING(summary,false),
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
.key = "tag",
|
|
|
|
|
.offset = offsetof( struct ap_activity, tags ),
|
|
|
|
|
.required = false,
|
|
|
|
|
.type = &json_field_array_of,
|
|
|
|
|
.type_data = &ap_activity_tag_type
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
JSON_FIELD_STRING(context,false),
|
|
|
|
|
{
|
|
|
|
|
.key = "attributedTo",
|
|
|
|
|
.required = false,
|
|
|
|
|
.offset = offsetof(OBJ_TYPE,attributed_to),
|
|
|
|
|
.type = &json_field_string,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{ "directMessage", offsetof( struct ap_activity, direct_message ), false, &json_field_bool },
|
|
|
|
|
|
|
|
|
|
{ "attachment", offsetof( struct ap_activity, attachments ), false, &json_field_array_of, &json_field_string },
|
|
|
|
|
|
|
|
|
|
{ "to", offsetof( struct ap_activity, to ), true, &json_field_array_of, &json_field_string },
|
|
|
|
|
{ "cc", offsetof( struct ap_activity, cc ), false, &json_field_array_of, &json_field_string },
|
|
|
|
|
{ "bcc", offsetof( struct ap_activity, bcc ), false, &json_field_array_of, &json_field_string },
|
|
|
|
|
JSON_FIELD_ARRAY_OF_STRINGS(to,true),
|
|
|
|
|
JSON_FIELD_ARRAY_OF_STRINGS(cc,false),
|
|
|
|
|
JSON_FIELD_ARRAY_OF_STRINGS(bcc,false),
|
|
|
|
|
|
|
|
|
|
{ "object", offsetof( struct ap_activity, object.tag ), false, &json_field_tagged_union, &activity_ref_types },
|
|
|
|
|
|
|
|
|
@ -100,6 +133,7 @@ struct json_object_field ap_activity_layout[] = {
|
|
|
|
|
|
|
|
|
|
{ NULL, 0, true, NULL, &ap_activity_type },
|
|
|
|
|
};
|
|
|
|
|
#undef OBJ_TYPE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void ap_activity_free_shim( void* ptr )
|
|
|
|
|