mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
api: cffi: add dc_event_get_json which gives the jsonrpc representation of an event
This has the advantage that fields are named/labled and there can be potentially more than 2 (data1 & data2) fields on the events. This removes the need for the (potentialy confusing) overloading data1 with `dc_event_get_data1_str` to add more information to events. And also allows gradual/partial moving to the jsonrpc api, when needed or wanted.
This commit is contained in:
@@ -5951,6 +5951,19 @@ char* dc_event_get_data2_str(dc_event_t* event);
|
||||
*/
|
||||
uint32_t dc_event_get_account_id(dc_event_t* event);
|
||||
|
||||
/**
|
||||
* Get the json representation of the event as the jsonrpc api would return it.
|
||||
* For documentation on this json object see <https://js.jsonrpc.delta.chat/types/T.Event.html>.
|
||||
*
|
||||
* The difference to the cffi is that the fields are named,
|
||||
* and can also contain more fields than the cffi api (which only has data1 and data2).
|
||||
*
|
||||
* @memberof dc_event_t
|
||||
* @param event The event object as returned from dc_get_next_event().
|
||||
* @return The json representation of the event as string or NULL.
|
||||
* Must be freed using dc_str_unref().
|
||||
*/
|
||||
uint32_t dc_event_get_json(dc_event_t* event);
|
||||
|
||||
/**
|
||||
* Free memory used by an event object.
|
||||
|
||||
Reference in New Issue
Block a user