QNGroupRepository

public class QNGroupRepository

Represents a Group

Properties

  • Name of the group

    Declaration

    Swift

    public var name: String { get }
  • Group identifier

    Declaration

    Swift

    public var groupId: String { get }
  • Group chat identifier

    Declaration

    Swift

    public var chatId: String { get }
  • Users who are joined to group

    Declaration

    Swift

    public var participants: [QNUser]
  • Group ringing strategy

    Declaration

    Swift

    public var ringingStrategy: QNRingingStrategy { get }

Api

  • add(user:) Asynchronous

    Add a new participant to group

    Declaration

    Swift

    public func add(user: QNUser) async throws

    Parameters

    user

    User to be added

  • expel(user:) Asynchronous

    As group owners expel a participant from group

    Declaration

    Swift

    public func expel(user: QNUser) async throws

    Parameters

    participant

    Participant to be expelled

  • leave() Asynchronous

    Leave the group

    Declaration

    Swift

    public func leave() async throws
  • removeAllUser() Asynchronous

    As group owner expel all participants

    Declaration

    Swift

    public func removeAllUser() async throws
  • Check if a participant belongs to the group

    Declaration

    Swift

    public func hasParticipant(userId: String) async throws -> Bool

    Parameters

    participant

    Participant to check

  • Update the list of group participants changing his order according to the received order.

    Declaration

    Swift

    public func reorderParticipants(participants: [QNUser]) async throws

    Parameters

    participants

    The list of group participants with the desired order

    result

    Result with success when the action is completed

  • Change the ringing strategy of the group to the received value

    Declaration

    Swift

    public func changeRingingStrategy(to strategy: QNRingingStrategy) async throws

    Parameters

    to

    The new ringing strategy to the group