Start a background task during the imdn timeout.

This commit is contained in:
Ghislain MARY 2018-04-17 18:01:40 +02:00
parent 9c673a435c
commit aedd2dd2c1
2 changed files with 5 additions and 0 deletions

View file

@ -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

View file

@ -22,6 +22,8 @@
#include "linphone/utils/general.h"
#include "utils/background-task.h"
#include "private.h"
// =============================================================================
@ -69,6 +71,7 @@ private:
std::list<const std::shared_ptr<ChatMessage>> displayedMessages;
std::list<MessageReason> nonDeliveredMessages;
belle_sip_source_t *timer = nullptr;
BackgroundTask bgTask { "IMDN sending" };
};
LINPHONE_END_NAMESPACE