Add DC_EVENT_MSG_DELETE_TIMEOUT_CHANGED

This event tells the client when the next message will be deleted. When
this event is received, the client should start a timer and update
current chat or chatlist when timeout expires.
This commit is contained in:
Alexander Krotov
2020-05-20 01:22:56 +03:00
parent 9d033e2ea1
commit f3137d87c5
5 changed files with 71 additions and 7 deletions

View File

@@ -4405,6 +4405,17 @@ int64_t dc_lot_get_timestamp (const dc_lot_t* lot);
*/
#define DC_EVENT_MSG_READ 2015
/**
* Time left until the next message deletion has changed.
*
* The only parameter is the number of seconds left until next message
* deletion. It is rounded up. If the timer is 0, it means there are no
* messages to be deleted in the future.
*
* @param data1 (int) Timer in seconds
* @param data2 (int) 0
*/
#define DC_EVENT_MSG_DELETE_TIMEOUT_CHANGED 2016
/**
* Chat changed. The name or the image of a chat group was changed or members were added or removed.

View File

@@ -167,6 +167,9 @@ impl ContextWrapper {
msg_id.to_u32() as uintptr_t,
);
}
Event::MsgDeleteTimeoutChanged { timer } => {
ffi_cb(self, event_id, timer as uintptr_t, 0);
}
Event::ChatModified(chat_id) => {
ffi_cb(self, event_id, chat_id.to_u32() as uintptr_t, 0);
}