#include "../inbox.h" // Submodules #include "ap/object.h" // Model #include "model/account.h" #include "model/server.h" // Standard Library #include #include 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; }