import json
import requests
import base64, hashlib, hmac, time
import email.utils
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import padding
from urllib.parse import urlparse
from db.db import async_session
from models.users import RemoteUser
from sqlmodel import select
from activitypub.activitystreams import ActivityTypes


async def send_activity(private_key: str, user_id: str, target_id: str, body: dict):
    # 1. Fetch target inbox
    # 1.1 Check if we know the user's inbox
    async with async_session() as s:
        statement = 