From 9f5a74bd4232c14d9be52dd81aea4bf4cc03402b Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 13 Feb 2018 14:46:42 +0100 Subject: [PATCH] Added linphone_chat_room_get_last_update_time method --- include/linphone/api/c-chat-room.h | 7 +++++++ src/c-wrapper/api/c-chat-room.cpp | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/include/linphone/api/c-chat-room.h b/include/linphone/api/c-chat-room.h index b3f40bc6f..8fc03d6c6 100644 --- a/include/linphone/api/c-chat-room.h +++ b/include/linphone/api/c-chat-room.h @@ -298,6 +298,13 @@ LINPHONE_PUBLIC LinphoneChatRoomState linphone_chat_room_get_state (const Linpho */ LINPHONE_PUBLIC bool_t linphone_chat_room_has_been_left (const LinphoneChatRoom *cr); +/** + * Return the last updated time for the chat room + * @param[in] cr LinphoneChatRoom object + * @return the last updated time + */ +LINPHONE_PUBLIC time_t linphone_chat_room_get_last_update_time(const LinphoneChatRoom *cr); + /** * Add a participant to a chat room. This may fail if this type of chat room does not handle participants. * Use linphone_chat_room_can_handle_participants() to know if this chat room handles participants. diff --git a/src/c-wrapper/api/c-chat-room.cpp b/src/c-wrapper/api/c-chat-room.cpp index 99d9d2d46..d0cd1c61f 100644 --- a/src/c-wrapper/api/c-chat-room.cpp +++ b/src/c-wrapper/api/c-chat-room.cpp @@ -260,6 +260,10 @@ bool_t linphone_chat_room_has_been_left (const LinphoneChatRoom *cr) { return (bool_t)L_GET_CPP_PTR_FROM_C_OBJECT(cr)->hasBeenLeft(); } +time_t linphone_chat_room_get_last_update_time(const LinphoneChatRoom *cr) { + return L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getLastUpdateTime(); +} + void linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAddress *addr) { L_GET_CPP_PTR_FROM_C_OBJECT(cr)->addParticipant( LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(addr)), nullptr, false