Commit 9092d887 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added method on chat message to know whether or not a download is in progress

parent 9d7a9430
......@@ -362,6 +362,13 @@ LINPHONE_PUBLIC bool_t linphone_chat_message_has_text_content(const LinphoneChat
*/
LINPHONE_PUBLIC const char* linphone_chat_message_get_text_content(const LinphoneChatMessage *msg);
/**
* Gets whether or not a received file is currently being downloaded
* @param[in] msg LinphoneChatMessage object
* @return true if download is in progress, false otherwise
*/
LINPHONE_PUBLIC bool_t linphone_chat_message_is_download_in_progress(LinphoneChatMessage *msg);
/**
* @}
*/
......
......@@ -242,6 +242,10 @@ const char *linphone_chat_message_get_text_content(const LinphoneChatMessage *ms
return L_STRING_TO_C(msg->cache.textContentBody);
}
bool_t linphone_chat_message_is_download_in_progress(LinphoneChatMessage *msg) {
return L_GET_CPP_PTR_FROM_C_OBJECT(msg)->isDownloadInProgress();
}
// =============================================================================
// Old listener
// =============================================================================
......
......@@ -1040,6 +1040,11 @@ bool ChatMessage::downloadFile(FileTransferContent &fileTransferContent) {
return d->fileTransferChatMessageModifier.downloadFile(getSharedFromThis(), &fileTransferContent);
}
bool ChatMessage::isDownloadInProgress() {
L_D();
return d->fileTransferChatMessageModifier.isFileTransferInProgressAndValid();
}
void ChatMessage::cancelFileTransfer () {
L_D();
if (d->fileTransferChatMessageModifier.isFileTransferInProgressAndValid()) {
......
......@@ -106,6 +106,7 @@ public:
void removeCustomHeader (const std::string &headerName);
bool downloadFile (FileTransferContent &content);
bool isDownloadInProgress();
private:
ChatMessage (const std::shared_ptr<AbstractChatRoom> &chatRoom, ChatMessage::Direction direction);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment