"""
User actions
"""

import typing

from slidge.core.session import BaseSession
from slidge.db.models import GatewayUser

from .legacy_client import SuperDuperClient

if typing.TYPE_CHECKING:
    from .contact import Contact  # noqa:F401


class Session(BaseSession["Contact"]):
    def __init__(self, user: GatewayUser) -> None:
        super().__init__(user)
        self.legacy_client = SuperDuperClient(self)
        self.contacts.user_legacy_id = str(self.legacy_client.user_id)

    async def login(self) -> str:
        await self.legacy_client.login()
        return "Success!"
