deltachat

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2023 License: MPL-2.0 Imports: 9 Imported by: 7

Documentation

Index

Constants

View Source
const (
	//Special contact ids
	CONTACT_SELF         uint64 = 1
	CONTACT_INFO         uint64 = 2
	CONTACT_DEVICE       uint64 = 5
	CONTACT_LAST_SPECIAL uint64 = 9

	// Chatlist Flags
	CHATLIST_FLAG_ARCHIVED_ONLY    uint = 0x01
	CHATLIST_FLAG_NO_SPECIALS      uint = 0x02
	CHATLIST_FLAG_ADD_ALLDONE_HINT uint = 0x04
	CHATLIST_FLAG_FOR_FORWARDING   uint = 0x08

	// Contact Flags
	CONTACT_FLAG_VERIFIED_ONLY = 0x01
	CONTACT_FLAG_ADD_SELF      = 0x02

	//Chat types
	CHAT_TYPE_UNDEFINED   uint = 0
	CHAT_TYPE_SINGLE      uint = 100
	CHAT_TYPE_GROUP       uint = 120
	CHAT_TYPE_MAILINGLIST uint = 140
	CHAT_TYPE_BROADCAST   uint = 160

	// Chat visibility types
	CHAT_VISIBILITY_NORMAL   = "Normal"
	CHAT_VISIBILITY_ARCHIVED = "Archived"
	CHAT_VISIBILITY_PINNED   = "Pinned"

	//Message download states
	DOWNLOAD_STATE_DONE        = "Done"
	DOWNLOAD_STATE_AVAILABLE   = "Available"
	DOWNLOAD_STATE_FAILURE     = "Failure"
	DOWNLOAD_STATE_IN_PROGRESS = "InProgress"

	//Message view types
	MSG_TYPE_UNKNOWN              = "Unknown"
	MSG_TYPE_TEXT                 = "Text"
	MSG_TYPE_IMAGE                = "Image"
	MSG_TYPE_GIF                  = "Gif"
	MSG_TYPE_STICKER              = "Sticker"
	MSG_TYPE_AUDIO                = "Audio"
	MSG_TYPE_VOICE                = "Voice"
	MSG_TYPE_VIDEO                = "Video"
	MSG_TYPE_FILE                 = "File"
	MSG_TYPE_VIDEOCHAT_INVITATION = "VideochatInvitation"
	MSG_TYPE_WEBXDC               = "Webxdc"

	//System message types
	SYSMSG_TYPE_UNKNOWN                    = "Unknown"
	SYSMSG_TYPE_GROUP_NAME_CHANGED         = "GroupNameChanged"
	SYSMSG_TYPE_GROUP_IMAGE_CHANGED        = "GroupImageChanged"
	SYSMSG_TYPE_MEMBER_ADDED_TO_GROUP      = "MemberAddedToGroup"
	SYSMSG_TYPE_MEMBER_REMOVED_FROM_GROUP  = "MemberRemovedFromGroup"
	SYSMSG_TYPE_AUTOCRYPT_SETUP_MESSAGE    = "AutocryptSetupMessage"
	SYSMSG_TYPE_SECUREJOIN_MESSAGE         = "SecurejoinMessage"
	SYSMSG_TYPE_LOCATION_STREAMING_ENABLED = "LocationStreamingEnabled"
	SYSMSG_TYPE_LOCATION_ONLY              = "LocationOnly"
	SYSMSG_TYPE_CHAT_PROTECTION_ENABLED    = "ChatProtectionEnabled"
	SYSMSG_TYPE_CHAT_PROTECTION_DISABLED   = "ChatProtectionDisabled"
	SYSMSG_TYPE_WEBXDC_STATUS_UPDATE       = "WebxdcStatusUpdate"
	SYSMSG_TYPE_EPHEMERAL_TIMER_CHANGED    = "EphemeralTimerChanged"
	SYSMSG_TYPE_MULTI_DEVICE_SYNC          = "MultiDeviceSync"
	SYSMSG_TYPE_WEBXDC_INFO_MESSAGE        = "WebxdcInfoMessage"

	// Event types
	EVENT_INFO                          = "Info"
	EVENT_SMTP_CONNECTED                = "SmtpConnected"
	EVENT_IMAP_CONNECTED                = "ImapConnected"
	EVENT_SMTP_MESSAGE_SENT             = "SmtpMessageSent"
	EVENT_IMAP_MESSAGE_DELETED          = "ImapMessageDeleted"
	EVENT_IMAP_MESSAGE_MOVED            = "ImapMessageMoved"
	EVENT_NEW_BLOB_FILE                 = "NewBlobFile"
	EVENT_DELETED_BLOB_FILE             = "DeletedBlobFile"
	EVENT_WARNING                       = "Warning"
	EVENT_ERROR                         = "Error"
	EVENT_ERROR_SELF_NOT_IN_GROUP       = "ErrorSelfNotInGroup"
	EVENT_MSGS_CHANGED                  = "MsgsChanged"
	EVENT_REACTIONS_CHANGED             = "ReactionsChanged"
	EVENT_INCOMING_MSG                  = "IncomingMsg"
	EVENT_INCOMING_MSG_BUNCH            = "IncomingMsgBunch"
	EVENT_MSGS_NOTICED                  = "MsgsNoticed"
	EVENT_MSG_DELIVERED                 = "MsgDelivered"
	EVENT_MSG_FAILED                    = "MsgFailed"
	EVENT_MSG_READ                      = "MsgRead"
	EVENT_CHAT_MODIFIED                 = "ChatModified"
	EVENT_CHAT_EPHEMERAL_TIMER_MODIFIED = "ChatEphemeralTimerModified"
	EVENT_CONTACTS_CHANGED              = "ContactsChanged"
	EVENT_LOCATION_CHANGED              = "LocationChanged"
	EVENT_CONFIGURE_PROGRESS            = "ConfigureProgress"
	EVENT_IMEX_PROGRESS                 = "ImexProgress"
	EVENT_IMEX_FILE_WRITTEN             = "ImexFileWritten"
	EVENT_SECUREJOIN_INVITER_PROGRESS   = "SecurejoinInviterProgress"
	EVENT_SECUREJOIN_JOINER_PROGRESS    = "SecurejoinJoinerProgress"
	EVENT_CONNECTIVITY_CHANGED          = "ConnectivityChanged"
	EVENT_SELFAVATAR_CHANGED            = "SelfavatarChanged"
	EVENT_WEBXDC_STATUS_UPDATE          = "WebxdcStatusUpdate"
	EVENT_WEBXDC_INSTANCE_DELETED       = "WebxdcInstanceDeleted"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Manager *AccountManager
	Id      uint64
}

Delta Chat account.

func (*Account) AddDeviceMsg

func (self *Account) AddDeviceMsg(label, text string) (*Message, error)

Add a text message in the "Device messages" chat and return the resulting Message instance.

func (*Account) Avatar

func (self *Account) Avatar() (string, error)

Get self avatar path.

func (*Account) BlockedContacts

func (self *Account) BlockedContacts() ([]ContactSnapshot, error)

Return a list with snapshots of all blocked contacts.

func (*Account) ChatListEntries

func (self *Account) ChatListEntries() ([]*Chat, error)

Return the default chat list entries.

func (*Account) ChatListItems

func (self *Account) ChatListItems() ([]*ChatListItem, error)

Return the default chat list items

func (*Account) Configure

func (self *Account) Configure() error

Configure an account.

func (*Account) Contacts

func (self *Account) Contacts() ([]*Contact, error)

Get the contacts list.

func (*Account) CreateBroadcastList

func (self *Account) CreateBroadcastList() (*Chat, error)

Create a new broadcast list.

func (*Account) CreateContact

func (self *Account) CreateContact(addr string, name string) (*Contact, error)

Create a new Contact or return an existing one. If there already is a Contact with that e-mail address, it is unblocked and its display name is updated if specified.

func (*Account) CreateGroup

func (self *Account) CreateGroup(name string, protected bool) (*Chat, error)

Create a new group chat. After creation, the group has only self-contact as member and is in unpromoted state.

func (*Account) DeleteMsgs

func (self *Account) DeleteMsgs(messages []*Message) error

Delete the given set of messages (local and remote).

func (*Account) ExportBackup

func (self *Account) ExportBackup(destination, passphrase string) error

Export account backup.

func (*Account) ExportSelfKeys

func (self *Account) ExportSelfKeys(destination, passphrase string) error

Export public and private keys to the specified directory. Note that the account does not have to be started.

func (*Account) FreshMsgCount

func (self *Account) FreshMsgCount() (uint, error)

Get the number of fresh messages in this account.

func (*Account) FreshMsgs

func (self *Account) FreshMsgs() ([]*Message, error)

Return the list of fresh messages, newest messages first. This call is intended for displaying notifications.

func (*Account) FreshMsgsInArrivalOrder

func (self *Account) FreshMsgsInArrivalOrder() ([]*Message, error)

Return fresh messages list sorted in the order of their arrival, with ascending IDs.

func (*Account) GetConfig

func (self *Account) GetConfig(key string) (string, error)

Get configuration value.

func (*Account) GetContactByAddr

func (self *Account) GetContactByAddr(addr string) (*Contact, error)

Check if an e-mail address belongs to a known and unblocked contact.

func (*Account) GetEventChannel

func (self *Account) GetEventChannel() <-chan *Event

Get this account's event channel.

func (*Account) ImportBackup

func (self *Account) ImportBackup(path, passphrase string) error

Import account backup.

func (*Account) ImportSelfKeys

func (self *Account) ImportSelfKeys(path, passphrase string) error

Import private keys found in the specified directory.

func (*Account) Info

func (self *Account) Info() (map[string]string, error)

Return map of this account configuration parameters.

func (*Account) InitiateAutocryptKeyTransfer

func (self *Account) InitiateAutocryptKeyTransfer() (string, error)

Start the AutoCrypt key transfer process.

func (*Account) IsConfigured

func (self *Account) IsConfigured() (bool, error)

Return true if this account is configured, false otherwise.

func (*Account) MarkSeenMsgs

func (self *Account) MarkSeenMsgs(messages []*Message) error

Mark the given set of messages as seen.

func (*Account) Me

func (self *Account) Me() *Contact

This account's identity as a Contact.

func (*Account) QrCode

func (self *Account) QrCode() ([2]string, error)

Get Setup-Contact QR Code text and SVG data.

func (*Account) QueryChatListEntries

func (self *Account) QueryChatListEntries(query string, contact *Contact, listFlags uint) ([]*Chat, error)

Return chat list entries matching the given query.

func (*Account) QueryChatListItems

func (self *Account) QueryChatListItems(query string, contact *Contact, listFlags uint) ([]*ChatListItem, error)

Return chat list items matching the given query.

func (*Account) QueryContacts

func (self *Account) QueryContacts(query string, listFlags uint) ([]*Contact, error)

Get the list of contacts matching the given query.

func (*Account) Remove

func (self *Account) Remove() error

Remove the account.

func (*Account) SecureJoin

func (self *Account) SecureJoin(qrdata string) (*Chat, error)

Continue a Setup-Contact or Verified-Group-Invite protocol started on another device.

func (*Account) Select

func (self *Account) Select() error

Select the account. The selected account will be returned by AccountManager.SelectedAccount()

func (*Account) SetAvatar

func (self *Account) SetAvatar(path string) error

Set self avatar. Passing nil will discard the currently set avatar.

func (*Account) SetConfig

func (self *Account) SetConfig(key string, value string) error

Set configuration value.

func (*Account) Size

func (self *Account) Size() (int, error)

Get the combined filesize of an account in bytes.

func (*Account) StartIO

func (self *Account) StartIO() error

Start the account I/O.

func (*Account) StopIO

func (self *Account) StopIO() error

Stop the account I/O.

func (*Account) String

func (self *Account) String() string

Implement Stringer.

func (*Account) UpdateConfig

func (self *Account) UpdateConfig(config map[string]string) error

Tweak several configuration values in a batch.

type AccountManager

type AccountManager struct {
	Rpc Rpc
}

Delta Chat accounts manager. This is the root of the API.

func (*AccountManager) Accounts

func (self *AccountManager) Accounts() ([]*Account, error)

Return all available accounts.

func (*AccountManager) AddAccount

func (self *AccountManager) AddAccount() (*Account, error)

Create a new account.

func (*AccountManager) Connectivity

func (self *AccountManager) Connectivity() (uint, error)

Get the current connectivity, i.e. whether the device is connected to the IMAP server. One of: - DC_CONNECTIVITY_NOT_CONNECTED (1000-1999): Show e.g. the string "Not connected" or a red dot - DC_CONNECTIVITY_CONNECTING (2000-2999): Show e.g. the string "Connecting…" or a yellow dot - DC_CONNECTIVITY_WORKING (3000-3999): Show e.g. the string "Getting new messages" or a spinning wheel - DC_CONNECTIVITY_CONNECTED (>=4000): Show e.g. the string "Connected" or a green dot

func (*AccountManager) MaybeNetwork

func (self *AccountManager) MaybeNetwork() error

Indicate that the network likely has come back or just that the network conditions might have changed.

func (*AccountManager) SelectedAccount

func (self *AccountManager) SelectedAccount() (*Account, error)

Get the selected account.

func (*AccountManager) SetTranslations

func (self *AccountManager) SetTranslations(translations map[uint]string) error

Set stock translation strings.

func (*AccountManager) StartIO

func (self *AccountManager) StartIO() error

Start the I/O of all accounts.

func (*AccountManager) StopIO

func (self *AccountManager) StopIO() error

Stop the I/O of all accounts.

func (*AccountManager) String

func (self *AccountManager) String() string

Implement Stringer.

func (*AccountManager) SystemInfo

func (self *AccountManager) SystemInfo() (map[string]string, error)

Get information about the Delta Chat core in this system.

type BasicChatSnapshot

type BasicChatSnapshot struct {
	Id               uint64
	Name             string
	IsProtected      bool
	ProfileImage     string
	Archived         bool
	ChatType         uint
	IsUnpromoted     bool
	IsSelfTalk       bool
	Color            string
	IsContactRequest bool
	IsDeviceChat     bool
	IsMuted          bool
}

Cheaper version of FullChatSnapshot.

type Bot

type Bot struct {
	Account *Account
	// contains filtered or unexported fields
}

Delta Chat bot that listen to events of a single account.

func NewBot

func NewBot(account *Account) *Bot

Create a new Bot that will process events from the given account

func NewBotFromAccountManager

func NewBotFromAccountManager(manager *AccountManager) *Bot

Helper function to create a new Bot from the given AccountManager. The first available account will be used, a new account will be created if none exists.

func (*Bot) Configure

func (self *Bot) Configure(addr string, password string) error

Configure the bot's account.

func (*Bot) GetConfig

func (self *Bot) GetConfig(key string) (string, error)

Get configuration value.

func (*Bot) IsConfigured

func (self *Bot) IsConfigured() bool

Return true if the bot's account is configured, false otherwise.

func (*Bot) Me

func (self *Bot) Me() *Contact

This bot's contact object.

func (*Bot) On

func (self *Bot) On(event string, handler EventHandler)

Set an EventHandler for the given event type. Calling On() several times with the same event type will override the previously set EventHandler.

func (*Bot) OnNewMsg

func (self *Bot) OnNewMsg(handler NewMsgHandler)

Set the NewMsgHandler for this bot.

func (*Bot) Run

func (self *Bot) Run()

Process events until Stop() is called.

func (*Bot) SetConfig

func (self *Bot) SetConfig(key string, value string) error

Set configuration value.

func (*Bot) Stop added in v0.2.0

func (self *Bot) Stop()

Stop processing events.

func (*Bot) String

func (self *Bot) String() string

Implement Stringer.

func (*Bot) UpdateConfig

func (self *Bot) UpdateConfig(config map[string]string) error

Tweak several account configuration values in a batch.

type Chat

type Chat struct {
	Account *Account
	Id      uint64
}

Delta Chat Chat.

func (*Chat) Accept

func (self *Chat) Accept() error

Accept this contact request chat.

func (*Chat) AddContact

func (self *Chat) AddContact(contact *Contact) error

Add contact to this group.

func (*Chat) Archive

func (self *Chat) Archive() error

Archive this chat.

func (*Chat) BasicSnapshot

func (self *Chat) BasicSnapshot() (*BasicChatSnapshot, error)

Get a chat snapshot with basic info about this chat.

func (*Chat) Block

func (self *Chat) Block() error

Block this chat.

func (*Chat) Contacts

func (self *Chat) Contacts() ([]*Contact, error)

Get the list of contacts in this chat.

func (*Chat) Delete

func (self *Chat) Delete() error

Delete this chat and all its messages.

func (*Chat) DeleteMsgs

func (self *Chat) DeleteMsgs(messages []*Message) error

Forward a list of messages to this chat.

func (*Chat) EncryptionInfo

func (self *Chat) EncryptionInfo() (string, error)

Get encryption info for this 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.

returns Multi-line text

func (*Chat) EphemeralTimer

func (self *Chat) EphemeralTimer() (uint, error)

Get ephemeral timer of this chat.

func (*Chat) FirstUnreadMsg

func (self *Chat) FirstUnreadMsg() (*Message, error)

Get first unread message in this chat.

func (*Chat) FreshMsgCount

func (self *Chat) FreshMsgCount() (uint, error)

Get the number of fresh messages in this chat.

func (*Chat) FullSnapshot

func (self *Chat) FullSnapshot() (*FullChatSnapshot, error)

Get a full snapshot of this chat.

func (*Chat) Leave

func (self *Chat) Leave() error

Leave this group chat.

func (*Chat) MarkNoticed

func (self *Chat) MarkNoticed() error

Mark all messages in this chat as noticed.

func (*Chat) Messages

func (self *Chat) Messages(infoOnly, addDaymarker bool) ([]*Message, error)

Get the list of messages in this chat.

func (*Chat) Pin

func (self *Chat) Pin() error

Pin this chat.

func (*Chat) QrCode

func (self *Chat) QrCode() ([2]string, error)

Get Join-Group QR code text and SVG data.

func (*Chat) RemoveContact

func (self *Chat) RemoveContact(contact *Contact) error

Remove contact from this group.

func (*Chat) RemoveImage

func (self *Chat) RemoveImage() error

Remove profile image of this chat.

func (*Chat) SendMsg

func (self *Chat) SendMsg(msgData MsgData) (*Message, error)

Send a message and return the resulting Message instance.

func (*Chat) SendText

func (self *Chat) SendText(text string) (*Message, error)

Send a text message and return the resulting Message instance.

func (*Chat) SendVideoChatInvitation

func (self *Chat) SendVideoChatInvitation() (*Message, error)

Send a video chat invitation.

func (*Chat) SetEphemeralTimer

func (self *Chat) SetEphemeralTimer(timer uint) error

Set ephemeral timer of this chat.

func (*Chat) SetImage

func (self *Chat) SetImage(path string) error

Set profile image of this chat.

func (*Chat) SetName

func (self *Chat) SetName(name string) error

Set name of this chat.

func (*Chat) String

func (self *Chat) String() string

Implement Stringer.

func (*Chat) Unarchive

func (self *Chat) Unarchive() error

Unarchive this chat.a

func (*Chat) Unpin

func (self *Chat) Unpin() error

Unpin this chat.

type ChatListItem

type ChatListItem struct {
	Id                  uint64
	Name                string
	AvatarPath          string
	Color               string
	LastUpdated         int64
	SummaryText1        string
	SummaryText2        string
	SummaryStatus       uint32
	IsProtected         bool
	IsGroup             bool
	FreshMessageCounter uint
	IsSelfTalk          bool
	IsDeviceTalk        bool
	IsSendingLocation   bool
	IsSelfInGroup       bool
	IsArchived          bool
	IsPinned            bool
	IsMuted             bool
	IsContactRequest    bool
	IsBroadcast         bool
	DmChatContact       uint64
	WasSeenRecently     bool

	// Error
	// Id uint64
	Error string
}

Chat list item snapshot

type Contact

type Contact struct {
	Account *Account
	Id      uint64
}

Delta Chat Contact.

func (*Contact) Block

func (self *Contact) Block() error

Block contact.

func (*Contact) CreateChat

func (self *Contact) CreateChat() (*Chat, error)

Create or get an existing 1:1 chat for this contact.

func (*Contact) Delete

func (self *Contact) Delete() error

Delete contact.

func (*Contact) EncryptionInfo

func (self *Contact) EncryptionInfo() (string, error)

Get encryption info for this contact. Get a multi-line encryption info, containing your fingerprint and the fingerprint of the contact, used e.g. to compare the fingerprints for a simple out-of-band verification.

func (*Contact) SetName

func (self *Contact) SetName(name string) error

Set name of this contact.

func (*Contact) Snapshot

func (self *Contact) Snapshot() (*ContactSnapshot, error)

Return a map with a snapshot of all contact properties.

func (*Contact) String

func (self *Contact) String() string

Implement Stringer.

func (*Contact) Unblock

func (self *Contact) Unblock() error

Unblock contact.

type ContactSnapshot

type ContactSnapshot struct {
	Address         string
	Color           string
	AuthName        string
	Status          string
	DisplayName     string
	Id              uint64
	Name            string
	ProfileImage    string
	NameAndAddr     string
	IsBlocked       bool
	IsVerified      bool
	VerifierAddr    string
	VerifierId      uint64
	LastSeen        uint64
	WasSeenRecently bool
}

Delta Chat Contact snapshot.

type Event

type Event struct {
	Type               string
	Msg                string
	File               string
	ChatId             uint64
	MsgId              uint64
	ContactId          uint64
	MsgIds             []uint64
	Timer              int
	Progress           uint
	Comment            string
	Path               string
	StatusUpdateSerial uint
}

Delta Chat core Event

type EventHandler

type EventHandler func(event *Event)

type FullChatSnapshot

type FullChatSnapshot struct {
	Id                  uint64
	Name                string
	IsProtected         bool
	ProfileImage        string
	Archived            bool
	ChatType            uint
	IsUnpromoted        bool
	IsSelfTalk          bool
	Contacts            []*ContactSnapshot
	ContactIds          []uint64
	Color               string
	FreshMessageCounter uint
	IsContactRequest    bool
	IsDeviceChat        bool
	SelfInGroup         bool
	IsMuted             bool
	EphemeralTimer      uint
	CanSend             bool
	WasSeenRecently     bool
	MailingListAddress  string
}

Full chat snapshot.

type Message

type Message struct {
	Account *Account
	Id      uint64
}

Delta Chat Message.

func (*Message) ContinueAutocryptKeyTransfer

func (self *Message) ContinueAutocryptKeyTransfer(setupCode string) error

Continue the AutoCrypt key transfer process.

func (*Message) Delete

func (self *Message) Delete() error

Delete message.

func (*Message) Download

func (self *Message) Download() error

Asks the core to start downloading a message fully.

func (*Message) Html

func (self *Message) Html() (string, error)

Get the HTML part of this message.

func (*Message) Info

func (self *Message) Info() (string, error)

Get an informational text for a single message.

func (*Message) MarkSeen

func (self *Message) MarkSeen() error

Mark the message as seen.

func (*Message) SendReaction

func (self *Message) SendReaction(reaction ...string) error

Send a reaction to this message.

func (*Message) SendStatusUpdate

func (self *Message) SendStatusUpdate(update, description string) error

Send status update for the webxdc instance of this message.

func (*Message) Snapshot

func (self *Message) Snapshot() (*MsgSnapshot, error)

Return map of this account configuration parameters.

func (*Message) StatusUpdates

func (self *Message) StatusUpdates(lastKnownSerial uint) (string, error)

Get the status updates of this webxdc message as a JSON string.

func (*Message) String

func (self *Message) String() string

Implement Stringer.

func (*Message) WebxdcInfo

func (self *Message) WebxdcInfo() (*WebxdcMsgInfo, error)

Get info from this webxdc message.

type MsgData

type MsgData struct {
	Text               string      `json:"text,omitempty"`
	Html               string      `json:"html,omitempty"`
	ViewType           string      `json:"viewtype,omitempty"`
	File               string      `json:"file,omitempty"`
	Location           *[2]float64 `json:"location,omitempty"`
	OverrideSenderName string      `json:"overrideSenderName,omitempty"`
	QuotedMessageId    uint64      `json:"quotedMessageId,omitempty"`
}

Message data provided to Chat.SendMsg()

type MsgQuote

type MsgQuote struct {
	Text               string
	MessageId          uint64
	AuthorDisplayName  string
	AuthorDisplayColor string
	OverrideSenderName string
	Image              string
	IsForwarded        bool
	ViewType           string
}

Message quote. Only the Text property is warrantied to be present, all other fields are optional.

type MsgSnapshot

type MsgSnapshot struct {
	Id                    uint64
	ChatId                uint64
	FromId                uint64
	Quote                 *MsgQuote
	ParentId              uint64
	Text                  string
	HasLocation           bool
	HasHtml               bool
	ViewType              string
	State                 int
	Error                 string
	Timestamp             int
	SortTimestamp         int
	ReceivedTimestamp     int
	HasDeviatingTimestamp bool
	Subject               string
	ShowPadlock           bool
	IsSetupmessage        bool
	IsInfo                bool
	IsForwarded           bool
	IsBot                 bool
	SystemMessageType     string
	Duration              int
	DimensionsHeight      int
	DimensionsWidth       int
	VideochatType         int
	VideochatUrl          string
	OverrideSenderName    string
	Sender                *ContactSnapshot
	SetupCodeBegin        string
	File                  string
	FileMime              string
	FileBytes             uint64
	FileName              string
	WebxdcInfo            *WebxdcMsgInfo
	DownloadState         string
	Reactions             *Reactions
}

Message snapshot.

type NewMsgHandler

type NewMsgHandler func(msg *Message)

type Reactions

type Reactions struct {
	ReactionsByContact map[uint64][]string
	Reactions          map[string]int // Unique reactions and their count
}

type Rpc

type Rpc interface {
	Start() error
	Stop()
	GetEventChannel(accountId uint64) <-chan *Event
	Call(method string, params ...any) error
	CallResult(result any, method string, params ...any) error
	String() string
}

Delta Chat core RPC

type RpcIO

type RpcIO struct {
	Stderr      *os.File
	AccountsDir string
	Cmd         string
	// contains filtered or unexported fields
}

Delta Chat core RPC working over IO

func NewRpcIO

func NewRpcIO() *RpcIO

func (*RpcIO) Call

func (self *RpcIO) Call(method string, params ...any) error

func (*RpcIO) CallResult

func (self *RpcIO) CallResult(result any, method string, params ...any) error

func (*RpcIO) GetEventChannel

func (self *RpcIO) GetEventChannel(accountId uint64) <-chan *Event

func (*RpcIO) Start

func (self *RpcIO) Start() error

func (*RpcIO) Stop

func (self *RpcIO) Stop()

func (*RpcIO) String

func (self *RpcIO) String() string

Implement Stringer.

type WebxdcMsgInfo

type WebxdcMsgInfo struct {
	Name           string
	Icon           string
	Document       string
	Summary        string
	SourceCodeUrl  string
	InternetAccess bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL