You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
738 B
C

#include "../inbox.h"
// Submodules
#include "ap/object.h"
// Model
#include "model/account.h"
#include "model/server.h"
// Standard Library
#include <stdio.h>
#include <string.h>
bool route_undo_follow( struct ap_activity* act )
{
const char* target = act->object.ptr->object.ref;
struct account* a = account_from_uri( target );
if( !a || 0 != strcmp( a->server, g_server->domain ) ) {
printf( "Unfollow not targeted at local account. Discarding.\n" );
return true;
}
struct account* follower = account_from_uri( act->actor );
if( !follower ) {
printf( "Follower account not present local. Active follow not possible. Discarding undo\n" );
return true;
}
account_remove_follower( a, follower );
return true;
}