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 a new participant to group

    Declaration

    Swift

    public func add(user: QNUser, result: @escaping (Result<Void, ResourceError>) -> Void)

    Parameters

    user

    User to be added

    result

    Result with success when actions is completed

  • As group owners expel a participant from group

    Declaration

    Swift

    public func expel(user: QNUser, result: @escaping (Result<Void, ResourceError>) -> Void)

    Parameters

    participant

    Participant to be expelled

    result

    Result with success when actions is completed

  • Leave the group

    Declaration

    Swift

    public func leave(result: @escaping (Result<Void, ResourceError>) -> Void)

    Parameters

    result

    Result with success when actions is completed

  • As group owner expel all participants

    Declaration

    Swift

    public func removeAllUsers(result: @escaping (Result<Void, ResourceError>) -> Void)

    Parameters

    result

    Result with success when actions is completed

  • Check if a participant belongs to the group

    Declaration

    Swift

    public func hasParticipant(userId: String, result: @escaping (Result<Bool, ResourceError>) -> Void)

    Parameters

    participant

    Participant to check

    result

    Result with true if group contains the participant

  • Fetch phonebooks associated to the group

    Declaration

    Swift

    public func getPhonebooks(result: @escaping (Result<[QNPhonebook], ResourceError>) -> Void)

    Parameters

    result

    Result with phonebooks

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

    Declaration

    Swift

    public func reorderParticipants(participants: [QNUser], result: @escaping (Result<Void, ResourceError>) -> Void)

    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 ringingStrategy: QNRingingStrategy, result: @escaping (Result<Void, ResourceError>) -> Void)

    Parameters

    to

    The new ringing strategy to the group