text
stringlengths
0
357
}
return dc_strdup_keep_null(lot->text1);
}
/**
* Get second string. The meaning of the string is defined by the creator of the object.
*
* @memberof dc_lot_t
*
* @param lot The lot object.
*
* @return A string, the string may be empty and the returned value must be free()'d . NULL if there is no such string.
*/
char* dc_lot_get_text2(const dc_lot_t* lot)
{
if (lot==NULL || lot->magic!=DC_LOT_MAGIC) {
return NULL;
}
return dc_strdup_keep_null(lot->text2);
}
/**
* Get the meaning of the first string. Posssible meanings of the string are defined by the creator of the object and may be returned eg.
* as DC_TEXT1_DRAFT, DC_TEXT1_USERNAME or DC_TEXT1_SELF.
*
* @memberof dc_lot_t
* @param lot The lot object.
* @return Returns the meaning of the first string, possible meanings are defined by the creator of the object.
* 0 if there is no concrete meaning or on errors.
*/
int dc_lot_get_text1_meaning(const dc_lot_t* lot)
{
if (lot==NULL || lot->magic!=DC_LOT_MAGIC) {
return 0;
}
return lot->text1_meaning;
}
/**
* Get the associated state. The meaning of the state is defined by the creator of the object.
*
* @memberof dc_lot_t
*
* @param lot The lot object.
*
* @return The state as defined by the creator of the object. 0 if there is not state or on errors.
*/
int dc_lot_get_state(const dc_lot_t* lot)
{
if (lot==NULL || lot->magic!=DC_LOT_MAGIC) {
return 0;
}
return lot->state;
}
/**
* Get the associated ID. The meaning of the ID is defined by the creator of the object.
*
* @memberof dc_lot_t
* @param lot The lot object.
* @return The state as defined by the creator of the object. 0 if there is not state or on errors.
*/
uint32_t dc_lot_get_id(const dc_lot_t* lot)
{
if (lot==NULL || lot->magic!=DC_LOT_MAGIC) {
return 0;
}
return lot->id;
}
/**
* Get the associated timestamp.
* The timestamp is returned as a unix timestamp in seconds.
* The meaning of the timestamp is defined by the creator of the object.
*
* @memberof dc_lot_t
*
* @param lot The lot object.
*
* @return The timestamp as defined by the creator of the object. 0 if there is not timestamp or on errors.
*/
time_t dc_lot_get_timestamp(const dc_lot_t* lot)
{
if (lot==NULL || lot->magic!=DC_LOT_MAGIC) {
return 0;
}
return lot->timestamp;
}
void dc_lot_fill(dc_lot_t* lot, const dc_msg_t* msg, const dc_chat_t* chat, const dc_contact_t* contact, dc_context_t* context)
{
if (lot==NULL || lot->magic!=DC_LOT_MAGIC || msg==NULL) {
return;
}