Delta Chat Core C Interface
Loading...
Searching...
No Matches
DC_MSG

With these constants the type of a message is defined. More...

Macros

#define DC_MSG_AUDIO   40
 Message containing an audio file.
 
#define DC_MSG_CALL   71
 Message indicating an incoming or outgoing call.
 
#define DC_MSG_FILE   60
 Message containing any file, e.g.
 
#define DC_MSG_GIF   21
 Animated GIF message.
 
#define DC_MSG_IMAGE   20
 Image message.
 
#define DC_MSG_STICKER   23
 Message containing a sticker, similar to image.
 
#define DC_MSG_TEXT   10
 Text message.
 
#define DC_MSG_VCARD   90
 Message containing shared contacts represented as a vCard (virtual contact file) with email addresses and possibly other fields.
 
#define DC_MSG_VIDEO   50
 Video messages.
 
#define DC_MSG_VOICE   41
 A voice message that was directly recorded by the user.
 
#define DC_MSG_WEBXDC   80
 The message is a webxdc instance.
 

Detailed Description

With these constants the type of a message is defined.

From the view of the library, all types are primary types of the same level, e.g. the library does not regard DC_MSG_GIF as a subtype for DC_MSG_IMAGE and it is up to the UI to decide whether a GIF is shown e.g. in an image or in a video container.

If you want to define the type of a dc_msg_t object for sending, use dc_msg_new(). Depending on the type, you will set more properties using e.g. dc_msg_set_text() or dc_msg_set_file_and_deduplicate(). To finally send the message, use dc_send_msg().

To get the types of dc_msg_t objects received, use dc_msg_get_viewtype().

Macro Definition Documentation

◆ DC_MSG_AUDIO

#define DC_MSG_AUDIO   40

Message containing an audio file.

File and duration are set via dc_msg_set_file_and_deduplicate(), dc_msg_set_duration() and retrieved via dc_msg_get_file(), and dc_msg_get_duration().

◆ DC_MSG_CALL

#define DC_MSG_CALL   71

Message indicating an incoming or outgoing call.

These messages are created by dc_place_outgoing_call() and should be rendered by UI similar to text messages, maybe with some "phone icon" at the side.

The message text is updated as needed and UI will be informed via DC_EVENT_MSGS_CHANGED as usual.

Do not start ringing when seeing this message; the mesage may belong e.g. to an old missed call.

Instead, ringing should start on the event DC_EVENT_INCOMING_CALL

◆ DC_MSG_FILE

#define DC_MSG_FILE   60

Message containing any file, e.g.

a PDF. The file is set via dc_msg_set_file_and_deduplicate() and retrieved via dc_msg_get_file().

◆ DC_MSG_GIF

#define DC_MSG_GIF   21

Animated GIF message.

File, width, and height are set via dc_msg_set_file_and_deduplicate(), dc_msg_set_dimension() and retrieved via dc_msg_get_file(), dc_msg_get_width(), and dc_msg_get_height().

◆ DC_MSG_IMAGE

#define DC_MSG_IMAGE   20

Image message.

If the image is an animated GIF, the type DC_MSG_GIF should be used. File, width, and height are set via dc_msg_set_file_and_deduplicate(), dc_msg_set_dimension() and retrieved via dc_msg_get_file(), dc_msg_get_width(), and dc_msg_get_height().

Before sending, the image is recoded to an reasonable size, see dc_set_config()-option media_quality. If you do not want images to be recoded, send them as DC_MSG_FILE.

◆ DC_MSG_STICKER

#define DC_MSG_STICKER   23

Message containing a sticker, similar to image.

NB: When sending, the message viewtype may be changed to Image by some heuristics like checking for transparent pixels. If possible, the UI should display the image without borders in a transparent way. A click on a sticker will offer to install the sticker set in some future.

◆ DC_MSG_TEXT

#define DC_MSG_TEXT   10

Text message.

The text of the message is set using dc_msg_set_text() and retrieved with dc_msg_get_text().

◆ DC_MSG_VIDEO

#define DC_MSG_VIDEO   50

Video messages.

File, width, height, and duration are set via dc_msg_set_file_and_deduplicate(), dc_msg_set_dimension(), dc_msg_set_duration() and retrieved via dc_msg_get_file(), dc_msg_get_width(), dc_msg_get_height(), and dc_msg_get_duration().

◆ DC_MSG_VOICE

#define DC_MSG_VOICE   41

A voice message that was directly recorded by the user.

For all other audio messages, the type DC_MSG_AUDIO should be used. File and duration are set via dc_msg_set_file_and_deduplicate(), dc_msg_set_duration() and retrieved via dc_msg_get_file(), and dc_msg_get_duration().

◆ DC_MSG_WEBXDC

#define DC_MSG_WEBXDC   80

The message is a webxdc instance.

To send data to a webxdc instance, use dc_send_webxdc_status_update().