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.
31 lines
699 B
C
31 lines
699 B
C
2 years ago
|
#include "../inbox.h"
|
||
|
|
||
|
#include "model/account.h"
|
||
|
#include "model/ap/activity.h"
|
||
|
#include "model/server.h"
|
||
|
|
||
|
#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_name ) ) {
|
||
|
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;
|
||
|
}
|
||
|
|
||
|
|