|
|
|
@ -1,11 +1,12 @@
|
|
|
|
|
#include "status.h"
|
|
|
|
|
#include "status/react.h"
|
|
|
|
|
|
|
|
|
|
#include "model/account.h"
|
|
|
|
|
#include "model/ap/activity.h"
|
|
|
|
|
|
|
|
|
|
// Submodules
|
|
|
|
|
#include "json/json.h"
|
|
|
|
|
#include "json/layout.h"
|
|
|
|
|
|
|
|
|
|
#include "sha256/sha256.h"
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
@ -18,7 +19,7 @@ static struct json_object_field status_layout[] = {
|
|
|
|
|
{ "sensitive", offsetof( struct status, sensitive ), true, &json_field_bool },
|
|
|
|
|
{ "content", offsetof( struct status, content ), true, &json_field_string },
|
|
|
|
|
{ "media", offsetof( struct status, media ), false, &json_field_array_of, &json_field_string },
|
|
|
|
|
{ "reacts", offsetof( struct status, reacts ), false, &json_field_array_of, &json_field_string },
|
|
|
|
|
{ "reacts", offsetof( struct status, reacts ), false, &json_field_array_of, &status_react_type },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -47,11 +48,6 @@ struct status* status_from_id( unsigned int id )
|
|
|
|
|
return s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char* render_source( const char* src )
|
|
|
|
|
{
|
|
|
|
|
return strdup(src);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct status* status_from_activity( struct ap_activity* act )
|
|
|
|
|
{
|
|
|
|
|
struct status* s;
|
|
|
|
@ -62,7 +58,7 @@ struct status* status_from_activity( struct ap_activity* act )
|
|
|
|
|
s->account_id = a->id;
|
|
|
|
|
account_free(a);
|
|
|
|
|
|
|
|
|
|
s->content = render_source( act->source );
|
|
|
|
|
s->content = status_render_source( act->source );
|
|
|
|
|
|
|
|
|
|
return s;
|
|
|
|
|
}
|
|
|
|
|