diff --git a/src/client/conversation_interface.cpp b/src/client/conversation_interface.cpp index 80cb2fc18b8c07270c49744776c588c2c313bc41..661832b96f6d53e832c7649446b60d3f47b95043 100644 --- a/src/client/conversation_interface.cpp +++ b/src/client/conversation_interface.cpp @@ -247,4 +247,15 @@ searchConversation(const std::string& accountId, return res; } +void +reloadConversationsAndRequests(const std::string& accountId) +{ + if (auto acc = jami::Manager::instance().getAccount<jami::JamiAccount>(accountId)) { + if (auto convModule = acc->convModule()) { + convModule->reloadRequests(); + convModule->loadConversations(); + } + } +} + } // namespace libjami diff --git a/src/jami/conversation_interface.h b/src/jami/conversation_interface.h index d11ae03b0ec5b5aceab2f40830310a7dc061bc3f..163579a681c102a33e221d473352bc015cb0fdab 100644 --- a/src/jami/conversation_interface.h +++ b/src/jami/conversation_interface.h @@ -98,6 +98,7 @@ LIBJAMI_PUBLIC uint32_t searchConversation(const std::string& accountId, const int64_t& before, const uint32_t& maxResult, const int32_t& flag); +LIBJAMI_PUBLIC void reloadConversationsAndRequests(const std::string& accountId); struct LIBJAMI_PUBLIC ConversationSignal { diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp index 18b5db9a8a1863035c4098891df537ded5537a72..a71a064cabe849019bbbb2b645dd613c9e10f5f4 100644 --- a/src/jamidht/jamiaccount.cpp +++ b/src/jamidht/jamiaccount.cpp @@ -1476,15 +1476,6 @@ void JamiAccount::registerAsyncOps() { auto onLoad = [this, loaded = std::make_shared<std::atomic_uint>()] { - if (auto cm = convModule()) { - /* - On iOS, when the app is in the background, invitations are received - and saved by the notifications extension. - When app becomes active requests need to be reloaded, to retrieve invitations - received when app was in background. - */ - cm->reloadRequests(); - } if (++(*loaded) == 2u) { runOnMainThread([w = weak()] { if (auto s = w.lock()) {