// SPDX-License-Identifier: AGPL-3.0-or-later // Copyright (C) 2022-2026 Aykut Alparslan KOC using TLDto = Ferrite.TL.baseLayer.dto; namespace Ferrite.Data.Repositories; public interface IGroupCallsRepository { ValueTask TryCreateCallAsync(TLDto.TLGroupCallState call, CancellationToken cancellationToken = default); ValueTask TryCreateConferenceCallAsync( TLDto.TLGroupCallState call, CancellationToken cancellationToken = default); ValueTask GetCallAsync(long callId, CancellationToken cancellationToken = default); ValueTask GetActiveCallByPeerAsync(int peerType, long peerId, CancellationToken cancellationToken = default); ValueTask GetCallByPeerRandomIdAsync(int peerType, long peerId, int randomId, CancellationToken cancellationToken = default); ValueTask> GetActiveCallsAsync( CancellationToken cancellationToken = default); ValueTask TrySetJoinMutedAsync(long callId, bool joinMuted, CancellationToken cancellationToken = default); ValueTask TrySetTitleAsync(long callId, string title, CancellationToken cancellationToken = default); ValueTask TryStartScheduledAsync(long callId, int startedDate, CancellationToken cancellationToken = default); ValueTask TrySetStartSubscriptionAsync(long callId, long userId, bool subscribed, CancellationToken cancellationToken = default); ValueTask TryRotateInviteGenerationAsync(long callId, CancellationToken cancellationToken = default); ValueTask TryAdvanceMediaEpochAsync(long callId, CancellationToken cancellationToken = default); ValueTask TryStartRecordingAsync(long callId, int startDate, long initiatingUserId, string title, bool video, bool portrait, CancellationToken cancellationToken = default); ValueTask TryStopRecordingAsync(long callId, int expectedGeneration, CancellationToken cancellationToken = default); ValueTask TryMarkTransportsStaleAsync(long callId, CancellationToken cancellationToken = default); ValueTask TryDiscardCallAsync(long callId, int endedDate, int duration, int? expectedState = null, CancellationToken cancellationToken = default); ValueTask TryJoinParticipantAsync( TLDto.TLGroupCallParticipantState participant, CancellationToken cancellationToken = default); ValueTask TryLeaveParticipantAsync(long callId, long userId, CancellationToken cancellationToken = default); ValueTask TryEditParticipantAsync(long callId, long userId, GroupCallParticipantEditSpec edit, CancellationToken cancellationToken = default); ValueTask TrySetParticipantPresentationAsync( long callId, long userId, string? presentationEndpoint, CancellationToken cancellationToken = default); ValueTask TryTouchParticipantActiveDateAsync(long callId, long userId, int activeDate, CancellationToken cancellationToken = default); ValueTask CountActiveVideoParticipantsAsync(long callId, CancellationToken cancellationToken = default); ValueTask GetParticipantAsync(long callId, long userId, CancellationToken cancellationToken = default); ValueTask GetParticipantBySourceAsync(long callId, int source, CancellationToken cancellationToken = default); ValueTask GetParticipantsPageAsync(long callId, string? offset, int limit, CancellationToken cancellationToken = default); ValueTask PutViewerStateAsync(TLDto.TLGroupCallViewerState state, CancellationToken cancellationToken = default); ValueTask GetViewerStateAsync(long callId, long userId, CancellationToken cancellationToken = default); ValueTask PutViewerParticipantStateAsync( TLDto.TLGroupCallViewerParticipantState state, CancellationToken cancellationToken = default); ValueTask GetViewerParticipantStateAsync( long callId, long viewerUserId, long targetUserId, CancellationToken cancellationToken = default); ValueTask> GetViewerParticipantStatesAsync(long callId, long viewerUserId, CancellationToken cancellationToken = default); ValueTask SaveDefaultJoinAsAsync(TLDto.TLGroupCallDefaultJoinAs joinAs, CancellationToken cancellationToken = default); ValueTask GetDefaultJoinAsAsync(long userId, int peerType, long peerId, CancellationToken cancellationToken = default); ValueTask PutInviteAsync(TLDto.TLGroupCallInvite invite, CancellationToken cancellationToken = default); ValueTask GetInviteByHashAsync(string hash, CancellationToken cancellationToken = default); ValueTask> GetInvitesByCallAsync(long callId, CancellationToken cancellationToken = default); ValueTask TryRevokeInviteAsync(long callId, string hash, CancellationToken cancellationToken = default); }