Delta Chat Core C Interface
Loading...
Searching...
No Matches
dc_event_channel_t Class Reference

Opaque object that is used to create an event emitter which can be used log events during startup of an accounts manger. More...

#include <deltachat.h>

Public Member Functions

dc_event_emitter_tdc_event_channel_get_event_emitter (dc_event_channel_t *event_channel)
 Create the event emitter that is used to receive events.
 
dc_event_channel_tdc_event_channel_new ()
 Create a new event channel.
 
void dc_event_channel_unref (dc_event_channel_t *event_channel)
 Release/free the events channel structure.
 

Detailed Description

Opaque object that is used to create an event emitter which can be used log events during startup of an accounts manger.

Only used for dc_accounts_new_with_event_channel(). To use it:

  1. create an events channel with dc_event_channel_new().
  2. get an event emitter for it with dc_event_channel_get_event_emitter().
  3. use it to create your account manager with dc_accounts_new_with_event_channel(), which consumes the channel.
  4. free the empty channel wrapper object with dc_event_channel_unref().

Member Function Documentation

◆ dc_event_channel_get_event_emitter()

dc_event_emitter_t * dc_event_channel_get_event_emitter ( dc_event_channel_t * event_channel)

Create the event emitter that is used to receive events.

The library will emit various DC_EVENT events, such as "new message", "message read" etc. To get these events, you have to create an event emitter using this function and call dc_get_next_event() on the emitter.

This is similar to dc_get_event_emitter(), which, however, must not be called for accounts handled by the account manager.

Parameters
Theevent channel.
Returns
Returns the event emitter, NULL on errors. Must be freed using dc_event_emitter_unref() after usage.

Note: Use only one event emitter per account manager / event channel. The result of having multiple event emitters is unspecified. Currently events are broadcasted to all existing event emitters, but previous versions delivered events to only one event emitter and this behavior may change again in the future. Events emitted before creation of event emitter are not available to event emitter.

◆ dc_event_channel_new()

dc_event_channel_t * dc_event_channel_new ( )

Create a new event channel.

Returns
An event channel wrapper object (dc_event_channel_t).

◆ dc_event_channel_unref()

void dc_event_channel_unref ( dc_event_channel_t * event_channel)

Release/free the events channel structure.

This function releases the memory of the dc_event_channel_t structure.

you can call it after calling dc_accounts_new_with_event_channel, which took the events channel out of it already, so this just frees the underlying option.


The documentation for this class was generated from the following file: