From aedd2dd2c1668145f16becea0f6844b1a3ea1e18 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 17 Apr 2018 18:01:40 +0200 Subject: [PATCH] Start a background task during the imdn timeout. --- src/chat/notification/imdn.cpp | 2 ++ src/chat/notification/imdn.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/chat/notification/imdn.cpp b/src/chat/notification/imdn.cpp index 203eb7846..27b4776b0 100644 --- a/src/chat/notification/imdn.cpp +++ b/src/chat/notification/imdn.cpp @@ -165,6 +165,7 @@ void Imdn::startTimer () { timer = chatRoom->getCore()->getCCore()->sal->create_timer(timerExpired, this, duration, "imdn timeout"); else belle_sip_source_set_timeout(timer, duration); + bgTask.start(chatRoom->getCore(), 1); } void Imdn::stopTimer () { @@ -175,6 +176,7 @@ void Imdn::stopTimer () { belle_sip_object_unref(timer); timer = nullptr; } + bgTask.stop(); } LINPHONE_END_NAMESPACE diff --git a/src/chat/notification/imdn.h b/src/chat/notification/imdn.h index ca5095319..e9b8c633b 100644 --- a/src/chat/notification/imdn.h +++ b/src/chat/notification/imdn.h @@ -22,6 +22,8 @@ #include "linphone/utils/general.h" +#include "utils/background-task.h" + #include "private.h" // ============================================================================= @@ -69,6 +71,7 @@ private: std::list> displayedMessages; std::list nonDeliveredMessages; belle_sip_source_t *timer = nullptr; + BackgroundTask bgTask { "IMDN sending" }; }; LINPHONE_END_NAMESPACE