Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Context

Wrapper around dcn_context_t*

Hierarchy

  • Context

Index

Constructors

constructor

Properties

Readonly account_id

account_id: number

Private inner_dcn_context

inner_dcn_context: NativeContext

Readonly manager

Accessors

dcn_context

Methods

_getNextMedia

  • _getNextMedia(messageId: number, dir: number, msgType1: number, msgType2: number, msgType3: number): number
  • Parameters

    • messageId: number
    • dir: number
    • msgType1: number
    • msgType2: number
    • msgType3: number

    Returns number

acceptChat

  • acceptChat(chatId: number): void

addAddressBook

  • addAddressBook(addressBook: string): any

addContactToChat

  • addContactToChat(chatId: number, contactId: number): boolean
  • Parameters

    • chatId: number
    • contactId: number

    Returns boolean

addDeviceMessage

  • addDeviceMessage(label: string, msg: Message | string): any

blockChat

  • blockChat(chatId: number): void

blockContact

  • blockContact(contactId: number, block: boolean): void
  • Parameters

    • contactId: number
    • block: boolean

    Returns void

checkQrCode

  • checkQrCode(qrCode: string): null | { id: number }

configure

  • configure(opts: any): Promise<void>

continueKeyTransfer

  • continueKeyTransfer(messageId: number, setupCode: string): Promise<unknown>
  • Parameters

    • messageId: number
    • setupCode: string

    Returns Promise<unknown>

createBroadcastList

  • createBroadcastList(): number

createChatByContactId

  • createChatByContactId(contactId: number): number

createContact

  • createContact(name: string, addr: string): number
  • Parameters

    • name: string
    • addr: string

    Returns number

    contactId

createGroupChat

  • createGroupChat(chatName: string, is_protected?: boolean): number
  • Parameters

    • chatName: string

      The name of the chat that should be created

    • Default value is_protected: boolean = false

      Whether the chat should be protected at creation time

    Returns number

    chatId

deleteChat

  • deleteChat(chatId: number): void

deleteContact

  • deleteContact(contactId: number): boolean

deleteMessages

  • deleteMessages(messageIds: number[]): void

downloadFullMessage

  • downloadFullMessage(messageId: number): void

estimateDeletionCount

  • estimateDeletionCount(fromServer: boolean, seconds: number): number
  • Parameters

    • fromServer: boolean
    • seconds: number

    Returns number

forwardMessages

  • forwardMessages(messageIds: number[], chatId: number): void
  • Parameters

    • messageIds: number[]
    • chatId: number

    Returns void

getBlobdir

  • getBlobdir(): string

getBlockedContacts

  • getBlockedContacts(): number[]

getBlockedCount

  • getBlockedCount(): number

getChat

  • getChat(chatId: number): null | Chat

getChatContacts

  • getChatContacts(chatId: number): number[]

getChatEncrytionInfo

  • getChatEncrytionInfo(chatId: number): string
  • Get encryption info for a chat. Get a multi-line encryption info, containing encryption preferences of all members. Can be used to find out why messages sent to group are not encrypted.

    Parameters

    • chatId: number

      ID of the chat to get the encryption info for.

    Returns string

    Multi-line text, must be released using dc_str_unref() after usage.

getChatEphemeralTimer

  • getChatEphemeralTimer(chatId: number): number

getChatIdByContactId

  • getChatIdByContactId(contactId: number): number

getChatList

  • getChatList(listFlags: number, queryStr: string, queryContactId: number): ChatList

getChatMedia

  • getChatMedia(chatId: number, msgType1: number, msgType2: number, msgType3: number): number[]
  • Parameters

    • chatId: number
    • msgType1: number
    • msgType2: number
    • msgType3: number

    Returns number[]

getChatMessages

  • getChatMessages(chatId: number, flags: number, marker1before: number): any
  • Parameters

    • chatId: number
    • flags: number
    • marker1before: number

    Returns any

getChatlistItemSummary

  • getChatlistItemSummary(chatId: number, messageId: number): Lot

getChats

  • getChats(listFlags: number, queryStr: string, queryContactId: number): number[]
  • Parameters

    • listFlags: number
    • queryStr: string
    • queryContactId: number

    Returns number[]

getConfig

  • getConfig(key: string): string

getConnectivity

  • getConnectivity(): number

getConnectivityHTML

  • getConnectivityHTML(): String

getContact

  • getContact(contactId: number): null | Contact

getContactEncryptionInfo

  • getContactEncryptionInfo(contactId: number): any

getContacts

  • getContacts(listFlags: number, query: string): any

getDraft

  • getDraft(chatId: number): null | Message

getFreshMessageCount

  • getFreshMessageCount(chatId: number): number

getFreshMessages

  • getFreshMessages(): any

getInfo

  • getInfo(): {}

getLocations

  • getLocations(chatId: number, contactId: number, timestampFrom?: number, timestampTo?: number): { accuracy: number; chatId: number; contactId: number; isIndependent: boolean; latitude: number; longitude: number; marker: string; msgId: number; timestamp: number }[]
  • Parameters

    • chatId: number
    • contactId: number
    • Default value timestampFrom: number = 0
    • Default value timestampTo: number = 0

    Returns { accuracy: number; chatId: number; contactId: number; isIndependent: boolean; latitude: number; longitude: number; marker: string; msgId: number; timestamp: number }[]

getMessage

  • getMessage(messageId: number): null | Message

getMessageCount

  • getMessageCount(chatId: number): number

getMessageHTML

  • getMessageHTML(messageId: number): string

getMessageInfo

  • getMessageInfo(messageId: number): string

getMimeHeaders

  • getMimeHeaders(messageId: number): string

getNextMediaMessage

  • getNextMediaMessage(messageId: number, msgType1: number, msgType2: number, msgType3: number): number
  • Parameters

    • messageId: number
    • msgType1: number
    • msgType2: number
    • msgType3: number

    Returns number

getPreviousMediaMessage

  • getPreviousMediaMessage(messageId: number, msgType1: number, msgType2: number, msgType3: number): number
  • Parameters

    • messageId: number
    • msgType1: number
    • msgType2: number
    • msgType3: number

    Returns number

getProviderFromEmail

  • getProviderFromEmail(email: string): undefined | { before_login_hint: any; overview_page: any; status: any }
  • get information about the provider

    Parameters

    • email: string

    Returns undefined | { before_login_hint: any; overview_page: any; status: any }

getSecurejoinQrCode

  • getSecurejoinQrCode(chatId: number): string

getSecurejoinQrCodeSVG

  • getSecurejoinQrCodeSVG(chatId: number): string

importExport

  • importExport(what: number, param1: string, param2?: string): void
  • Parameters

    • what: number
    • param1: string
    • Default value param2: string = ""

    Returns void

importExportHasBackup

  • importExportHasBackup(dir: string): any

initiateKeyTransfer

  • initiateKeyTransfer(): Promise<string>

isConfigured

  • isConfigured(): boolean

isContactInChat

  • isContactInChat(chatId: number, contactId: number): boolean
  • Parameters

    • chatId: number
    • contactId: number

    Returns boolean

joinSecurejoin

  • joinSecurejoin(qrCode: string): number
  • Parameters

    • qrCode: string

    Returns number

    resulting chat id or 0 on error

lookupContactIdByAddr

  • lookupContactIdByAddr(addr: string): number

markNoticedChat

  • markNoticedChat(chatId: number): void

markSeenMessages

  • markSeenMessages(messageIds: number[]): void

maybeNetwork

  • maybeNetwork(): void

messageNew

removeContactFromChat

  • removeContactFromChat(chatId: number, contactId: number): boolean
  • Parameters

    • chatId: number
    • contactId: number

    Returns boolean

searchMessages

  • searchMessages(chatId: number, query: string): number[]
  • Parameters

    • chatId: number

      ID of the chat to search messages in. Set this to 0 for a global search.

    • query: string

      The query to search for.

    Returns number[]

sendMessage

  • sendMessage(chatId: number, msg: string | Message): any

sendVideochatInvitation

  • sendVideochatInvitation(chatId: number): Promise<number>
  • Parameters

    • chatId: number

    Returns Promise<number>

    Promise that resolves into the resulting message id

setChatEphemeralTimer

  • setChatEphemeralTimer(chatId: number, timer: number): boolean

setChatMuteDuration

  • setChatMuteDuration(chatId: number, duration: number): boolean
  • Parameters

    • chatId: number
    • duration: number

      The duration (0 for no mute, -1 for forever mute, everything else is is the relative mute duration from now in seconds)

    Returns boolean

setChatName

  • setChatName(chatId: number, name: string): boolean

setChatProfileImage

  • setChatProfileImage(chatId: number, image: string): boolean

setChatProtection

  • setChatProtection(chatId: number, protect: boolean): boolean
  • Parameters

    • chatId: number
    • protect: boolean

    Returns boolean

    success boolean

setChatVisibility

setConfig

  • setConfig(key: string, value: string | boolean | number): number
  • Parameters

    • key: string
    • value: string | boolean | number

    Returns number

setConfigFromQr

  • setConfigFromQr(qrcodeContent: string): boolean

setDraft

  • setDraft(chatId: number, msg: Message): void

setLocation

  • setLocation(latitude: number, longitude: number, accuracy: number): void
  • Parameters

    • latitude: number
    • longitude: number
    • accuracy: number

    Returns void

setStockTranslation

  • setStockTranslation(stockId: number, stockMsg: string): boolean
  • Parameters

    • stockId: number
    • stockMsg: string

    Returns boolean

startIO

  • startIO(): void

stopIO

  • stopIO(): void

stopOngoingProcess

  • stopOngoingProcess(): void

unref

  • unref(): void

wasDeviceMessageEverAdded

  • wasDeviceMessageEverAdded(label: string): boolean

Static getSystemInfo

  • getSystemInfo(): {}

Generated using TypeDoc