👽 Update according to AP api changes

This commit is contained in:
2025-12-29 01:43:00 +08:00
parent bb1a5155ed
commit 3670fe0f10
6 changed files with 495 additions and 67 deletions

View File

@@ -4,8 +4,8 @@ import 'package:island/models/activitypub.dart';
import 'package:island/pods/network.dart';
final activityPubServiceProvider = Provider<ActivityPubService>((ref) {
final dio = ref.watch(apiClientProvider);
return ActivityPubService(dio);
final client = ref.watch(apiClientProvider);
return ActivityPubService(client);
});
class ActivityPubService {
@@ -16,7 +16,7 @@ class ActivityPubService {
Future<void> followRemoteUser(String targetActorUri) async {
final response = await _client.post(
'/sphere/activitypub/follow',
data: {'targetActorUri': targetActorUri},
data: {'target_actor_uri': targetActorUri},
);
final followResponse = SnActivityPubFollowResponse.fromJson(response.data);
if (!followResponse.success) {
@@ -27,7 +27,7 @@ class ActivityPubService {
Future<void> unfollowRemoteUser(String targetActorUri) async {
final response = await _client.post(
'/sphere/activitypub/unfollow',
data: {'targetActorUri': targetActorUri},
data: {'target_actor_uri': targetActorUri},
);
final followResponse = SnActivityPubFollowResponse.fromJson(response.data);
if (!followResponse.success) {