mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-25 23:28:09 +00:00
Added method on chat message to know whether or not a download is in progress
This commit is contained in:
parent
9d7a943032
commit
9092d88775
4 changed files with 17 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue