Constructors

Properties

auth?: null | CurrentUserInfo
catchingUp: boolean = false
catchUpOnStart: boolean
channelDiffTimeouts: Map<number, Timer> = ...
channelsOpened: Map<number, number> = ...
cpts: Map<number, number> = ...
cptsMod: Map<number, number> = ...
date?: number
hasTimedoutPostponed: boolean = false
keepAliveInterval?: Interval
lock: AsyncLock = ...
log: Logger
noDispatchEnabled: boolean
noDispatchMsg: Map<number, Set<number>> = ...
noDispatchPts: Map<number, Set<number>> = ...
noDispatchQts: Set<number> = ...
oldDate?: number
oldPts?: number
oldQts?: number
oldSeq?: number
pendingPtsUpdates: SortedLinkedList<PendingUpdate> = ...
pendingPtsUpdatesPostponed: SortedLinkedList<PendingUpdate> = ...
pendingQtsUpdates: SortedLinkedList<PendingUpdate> = ...
pendingQtsUpdatesPostponed: SortedLinkedList<PendingUpdate> = ...
pendingUnorderedUpdates: Deque<PendingUpdate> = ...
pendingUpdateContainers: SortedLinkedList<PendingUpdateContainer> = ...
postponedTimer: EarlyTimer = ...
pts?: number
qts?: number
seq?: number
updatesLoopActive: boolean = false
updatesLoopCv: ConditionVariable = ...

Methods

  • Parameters

    Returns void

  • Parameters

    • channelId: number
    • OptionalfallbackPts: number

    Returns Promise<boolean>

  • Parameters

    • requestedDiff: Map<number, Promise<void>>
    • channelId: number
    • OptionalfallbackPts: number

    Returns void

  • Parameters

    • channelId: number
    • Optionalpts: number

    Returns void

  • Parameters

    • requestedDiff: Map<number, Promise<void>>

    Returns Promise<void>

  • Parameters

    • requestedDiff: Map<number, Promise<void>>

    Returns void

  • Parameters

    Returns Promise<Set<number>>

  • Returns Promise<void>

  • Returns Promise<void>

  • Returns Promise<void>

  • Parameters

    • pending: PendingUpdate
    • requestedDiff: Map<number, Promise<void>>
    • postponed: boolean = false
    • unordered: boolean = false

    Returns Promise<void>

  • Parameters

    • save: boolean = false

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

  • Catch up with the server by loading missed updates. .

    Note: In case the storage was not properly closed the last time, "catching up" might result in duplicate updates.

    Returns void

  • Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • ADVANCED

    Notify the updates manager that some channel was "closed". Basically the opposite of notifyChannelOpened. This is a low-level method, prefer using closeChat instead.

    Parameters

    • channelId: number

      Bare channel ID

    Returns boolean

    true if the chat was closed for the last time, false otherwise

  • ADVANCED

    Notify the updates manager that some channel was "opened". Channel difference for "opened" channels will be fetched on a regular basis. This is a low-level method, prefer using openChat instead.

    Channel must be resolve-able with resolvePeer method (i.e. be in cache); base chat PTS must either be passed (e.g. from Dialog), or cached in storage.

    Parameters

    • channelId: number

      Bare ID of the channel

    • Optionalpts: number

      PTS of the channel, if known (e.g. from Dialog)

    Returns boolean

    true if the channel was opened for the first time, false if it is already opened

  • Returns void

  • Parameters

    • handler: (catchingUp: boolean) => void

    Returns void

  • Returns Promise<void>

  • Start updates loop.

    You must first call enableUpdatesProcessing to use this method.

    It is recommended to use this method in callback to start, or otherwise make sure the user is logged in.

    Note: If you are using UpdatesManagerParams.catchUp option, catching up will be done in background, you can't await it. Instead, listen for the updating and connected connection state events.

    Returns Promise<void>

  • ADVANCED

    Manually stop updates loop. Usually done automatically when stopping the client with close

    Returns void