|
|
|
@ -746,6 +746,13 @@ void status_get_context( struct status* s, void* ancestors_ptr, void* replies_pt
|
|
|
|
|
|
|
|
|
|
void status_add_react( struct status* s, const char* react, struct account* a )
|
|
|
|
|
{
|
|
|
|
|
if( s->repost_id ) {
|
|
|
|
|
struct status* reposted_status = status_from_id( s->repost_id );
|
|
|
|
|
status_add_react(reposted_status,react,a);
|
|
|
|
|
status_free(reposted_status);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// generate outbox element
|
|
|
|
|
if( a->id == owner_account_id ) {
|
|
|
|
|
if( s->account_id == owner_account_id ) {
|
|
|
|
@ -798,6 +805,13 @@ done:
|
|
|
|
|
}
|
|
|
|
|
void status_remove_react( struct status* s, const char* react, struct account* a )
|
|
|
|
|
{
|
|
|
|
|
if( s->repost_id ) {
|
|
|
|
|
struct status* reposted_status = status_from_id( s->repost_id );
|
|
|
|
|
status_remove_react(reposted_status,react,a);
|
|
|
|
|
status_free(reposted_status);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: generate outbox element
|
|
|
|
|
printf( "TODO: generate outbox activity for removing reaction '%s' to status #%d by account #%d\n", react, s->id, a->id );
|
|
|
|
|
/// Find react activity we need to Undo
|
|
|
|
@ -838,6 +852,13 @@ update_entry:
|
|
|
|
|
}
|
|
|
|
|
void status_add_like( struct status* s, struct account* a )
|
|
|
|
|
{
|
|
|
|
|
if( s->repost_id ) {
|
|
|
|
|
struct status* reposted_status = status_from_id( s->repost_id );
|
|
|
|
|
status_add_like(reposted_status,a);
|
|
|
|
|
status_free(reposted_status);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for( int i = 0; i < s->likes.count; ++i ) {
|
|
|
|
|
if( s->likes.items[i] == a->id ) {
|
|
|
|
|
return;
|
|
|
|
@ -870,6 +891,13 @@ void status_add_like( struct status* s, struct account* a )
|
|
|
|
|
}
|
|
|
|
|
void status_remove_like( struct status* s, struct account* a )
|
|
|
|
|
{
|
|
|
|
|
if( s->repost_id ) {
|
|
|
|
|
struct status* reposted_status = status_from_id( s->repost_id );
|
|
|
|
|
status_remove_like(reposted_status,a);
|
|
|
|
|
status_free(reposted_status);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for( int i = 0; i < s->likes.count; ++i ) {
|
|
|
|
|
if( s->likes.items[i] == a->id ) {
|
|
|
|
|
// Swap with last element
|
|
|
|
|