Files
mono/shared/services/stubs.py
giles 99ab363cfd Add per-app AP social UI for blog, market, and events
Lightweight social pages (search, follow/unfollow, followers, following,
actor timeline) auto-registered for AP-enabled apps via shared blueprint.
Federation keeps the full social hub. Followers scoped per app_domain;
post cards show "View on Hub" link instead of interaction buttons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 08:45:59 +00:00

43 lines
1.4 KiB
Python

"""No-op stub services.
Cross-app calls now go over HTTP via call_action() / fetch_data().
Stubs are no longer needed for the 4 main domains (blog, calendar,
market, cart). Only StubFederationService remains as a safety net
for apps that conditionally load AP infrastructure.
"""
from __future__ import annotations
class StubFederationService:
"""No-op federation stub for apps that don't load AP."""
async def get_actor_by_username(self, session, username):
return None
async def get_actor_by_user_id(self, session, user_id):
return None
async def publish_activity(self, session, *, actor_user_id, activity_type,
object_type, object_data, source_type=None,
source_id=None):
return None
async def get_activity_for_source(self, session, source_type, source_id):
return None
async def count_activities_for_source(self, session, source_type, source_id, *, activity_type):
return 0
async def get_followers_paginated(self, session, username,
page=1, per_page=20, app_domain=None):
return [], 0
async def get_following(self, session, username, page=1, per_page=20):
return [], 0
async def search_actors(self, session, query, page=1, limit=20):
return [], 0
async def get_stats(self, session):
return {"actors": 0, "activities": 0, "followers": 0}