@ -9,6 +9,8 @@
// Reference: https://www.w3.org/TR/activitystreams-vocabulary/
// TODO: rename this to ap_object, as this is really an Object base and not an Activity base
struct ap_object ;
# define ap_activity ap_object
struct ap_activity_source
{
@ -104,7 +106,18 @@ struct ap_attachement
void ap_attachement_free ( struct ap_attachement * a ) ;
extern struct json_field_type ap_attachement_type ;
struct ap_activity
struct ap_object_ptr_or_ref
{
int tag ;
union {
char * ref ;
struct ap_object * ptr ;
} ;
} ;
void ap_object_ptr_or_ref_free ( struct ap_object_ptr_or_ref * oor ) ;
void ap_object_ptr_or_ref_free_composite ( struct ap_object_ptr_or_ref * oor ) ;
struct ap_object
{
struct ap_activity_context ap_context ;
@ -147,18 +160,17 @@ struct ap_activity
int count ;
} also_known_as ;
struct {
struct ap_object_ptr_or_ref * * items ;
int count ;
} ordered_items ;
struct {
char * * items ;
int count ;
} to , cc , bcc ;
struct {
int tag ;
union {
char * ref ;
struct ap_activity * ptr ;
} ;
} object ;
struct ap_object_ptr_or_ref object ;
char * state ;
@ -170,33 +182,31 @@ struct json_object_field;
extern struct json_field_type ap_activity_type ;
extern struct json_object_field ap_activity_layout [ ] ;
struct ap_ activity * ap_activity_new ( ) ;
struct ap_ activity* ap_activity_dup ( struct ap_activity * act ) ;
struct ap_ activity * ap_activity_from_FILE ( FILE * f ) ;
struct ap_ activity * ap_activity_from_local_id ( int id ) ;
void ap_activity_free ( struct ap_ activity* act ) ;
void ap_activity_free_composite ( struct ap_ activity* act ) ;
struct ap_ object * ap_activity_new ( ) ;
struct ap_ object* ap_activity_dup ( struct ap_object * o ) ;
struct ap_ object * ap_activity_from_FILE ( FILE * f ) ;
struct ap_ object * ap_activity_from_local_id ( int id ) ;
void ap_activity_free ( struct ap_ object* o ) ;
void ap_activity_free_composite ( struct ap_ object* o ) ;
void ap_activity_write_to_FILE ( struct ap_ activity* act , FILE * f ) ;
void ap_activity_save ( struct ap_ activity* act ) ;
void ap_activity_write_to_FILE ( struct ap_ object* o , FILE * f ) ;
void ap_activity_save ( struct ap_ object* o ) ;
struct ap_ activity* ap_activity_create_accept ( struct ap_activity * act ) ;
void ap_activity_accept ( struct ap_ activity * act , int deliver_to_account_id ) ;
struct ap_ object* ap_activity_create_accept ( struct ap_object * act ) ;
void ap_activity_accept ( struct ap_ object * act , int deliver_to_account_id ) ;
struct status ;
struct ap_activity * ap_activity_create_emoji_react ( struct status * s , const char * react ) ;
void ap_activity_react ( struct status * s , const char * react ) ;
struct account ;
int ap_activity_follow ( struct account * follower , struct account * following ) ;
void ap_activity_unfollow ( struct account * follower , struct account * to_unfollow ) ;
struct ap_activity * ap_activity_create_undo ( struct ap_activity * act ) ;
void ap_activity_undo ( struct ap_activity * act , int deliver_to_account_id ) ;
struct ap_ activity* ap_activity_create_like ( struct status * s ) ;
int ap_activity_like ( struct status * s ) ;
struct ap_ activity * ap_activity_create_note ( struct status * s ) ;
struct ap_ activity* ap_activity_create_Create ( struct ap_activity * act ) ;
struct ap_object * ap_activity_create_emoji_react ( struct status * s , const char * react ) ;
struct ap_object * ap_activity_create_undo ( struct ap_object * act ) ;
struct ap_object * ap_activity_create_like ( struct status * s ) ;
struct ap_object * ap_activity_create_note ( struct status * s ) ;
struct ap_ object* ap_activity_create_Create ( struct ap_object * act ) ;
// These should be elsewhere
void ap_activity_react ( struct status * s , const char * react ) ;
int ap_activity_follow ( struct account * follower , struct account * following ) ;
void ap_activity_unfollow ( struct account * follower , struct account * to_unfollow ) ;
void ap_activity_undo ( struct ap_activity * act , int deliver_to_account_id ) ;
int ap_activity_like ( struct status * s ) ;