diff --git a/include/linphone/api/c-types.h b/include/linphone/api/c-types.h index 7af89ac15..3b7148b3f 100644 --- a/include/linphone/api/c-types.h +++ b/include/linphone/api/c-types.h @@ -22,9 +22,10 @@ // TODO: Remove me in the future. #include "linphone/types.h" -#include "linphone/utils/enum-generator.h" +#include "linphone/enums/chat-message-enums.h" #include "linphone/enums/chat-room-enums.h" #include "linphone/enums/event-log-enums.h" +#include "linphone/utils/enum-generator.h" // ============================================================================= @@ -129,6 +130,12 @@ typedef struct _LinphoneChatMessageEvent LinphoneChatMessageEvent; // C Enums. // ============================================================================= +/** + * LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not. + * @ingroup chatroom + */ +L_DECLARE_C_ENUM(ChatMessageState, L_ENUM_VALUES_CHAT_MESSAGE_STATE); + L_DECLARE_C_ENUM(ChatRoomState, L_ENUM_VALUES_CHAT_ROOM_STATE); L_DECLARE_C_ENUM(EventLogType, L_ENUM_VALUES_EVENT_LOG_TYPE); diff --git a/include/linphone/types.h b/include/linphone/types.h index c8043e4f5..b314051af 100644 --- a/include/linphone/types.h +++ b/include/linphone/types.h @@ -318,21 +318,6 @@ typedef enum _LinphoneCallStatus { LinphoneCallDeclinedElsewhere /** messageStateToSql[] = { - { ChatMessage::Idle, "1" }, - { ChatMessage::InProgress, "2" }, - { ChatMessage::Delivered, "3" }, - { ChatMessage::NotDelivered, "4" }, - { ChatMessage::FileTransferError, "5" }, - { ChatMessage::FileTransferDone, "6" }, - { ChatMessage::DeliveredToUser, "7" }, - { ChatMessage::Displayed, "8" } + { ChatMessage::State::Idle, "1" }, + { ChatMessage::State::InProgress, "2" }, + { ChatMessage::State::Delivered, "3" }, + { ChatMessage::State::NotDelivered, "4" }, + { ChatMessage::State::FileTransferError, "5" }, + { ChatMessage::State::FileTransferDone, "6" }, + { ChatMessage::State::DeliveredToUser, "7" }, + { ChatMessage::State::Displayed, "8" } }; static constexpr const char *mapMessageStateToSql (ChatMessage::State state) { @@ -408,7 +409,7 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {} " )" " )" " AND direction_id = " + string(mapMessageDirectionToSql(ChatMessage::Incoming)) + - " AND state_id = " + string(mapMessageStateToSql(ChatMessage::Displayed)); + " AND state_id = " + string(mapMessageStateToSql(ChatMessage::State::Displayed)); int count = 0; L_BEGIN_LOG_EXCEPTION