From e414951cd9470a8f10e42993702d8464cfff973a Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 1 Sep 2017 11:41:17 +0200 Subject: [PATCH] Really fix duration of remote refresh timer for is-composing. --- src/chat/is-composing.cpp | 9 ++++----- src/chat/is-composing.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/chat/is-composing.cpp b/src/chat/is-composing.cpp index 18e9e0873..a9157ea1d 100644 --- a/src/chat/is-composing.cpp +++ b/src/chat/is-composing.cpp @@ -123,8 +123,10 @@ void IsComposing::startRefreshTimer () { } } -void IsComposing::startRemoteRefreshTimer () { +void IsComposing::startRemoteRefreshTimer (const char *refreshStr) { int duration = getRemoteRefreshTimerDuration(); + if (refreshStr) + duration = atoi(refreshStr); if (!remoteRefreshTimer) { remoteRefreshTimer = sal_create_timer(core->sal, remoteRefreshTimerExpired, this, duration * 1000, "composing remote refresh timeout"); @@ -217,11 +219,8 @@ void IsComposing::parse (xmlparsing_context_t *xmlCtx) { if (stateStr) { if (strcmp(stateStr, "active") == 0) { - //int refreshDuration = getRefreshTimerDuration(); state = true; - //if (refreshStr) - // refreshDuration = atoi(refreshStr); - startRemoteRefreshTimer(); + startRemoteRefreshTimer(refreshStr); } else { stopRemoteRefreshTimer(); } diff --git a/src/chat/is-composing.h b/src/chat/is-composing.h index 4315d230f..a79122729 100644 --- a/src/chat/is-composing.h +++ b/src/chat/is-composing.h @@ -39,7 +39,7 @@ public: void parse (const std::string &content); void startIdleTimer (); void startRefreshTimer (); - void startRemoteRefreshTimer (); + void startRemoteRefreshTimer (const char *refreshStr); void stopComposing (); void stopIdleTimer (); void stopRefreshTimer ();