diff --git a/src/jamidht/conversation_module.cpp b/src/jamidht/conversation_module.cpp index 36d75db4de590cde4a98cf06302d249cbc65b9e5..a58442eeac5ef76b2f9108426c2b3b820c0c4159 100644 --- a/src/jamidht/conversation_module.cpp +++ b/src/jamidht/conversation_module.cpp @@ -1108,6 +1108,12 @@ ConversationModule::clearPendingFetch() } } +void +ConversationModule::reloadRequests() +{ + pimpl_->conversationsRequests_ = convRequests(pimpl_->accountId_); +} + std::vector<std::string> ConversationModule::getConversations() const { diff --git a/src/jamidht/conversation_module.h b/src/jamidht/conversation_module.h index 4ddce27f0f4c2d0f7399f08bd29284077fe256c8..8b9d89862732e2f10bfdb75efc62e1c56e5be88c 100644 --- a/src/jamidht/conversation_module.h +++ b/src/jamidht/conversation_module.h @@ -73,6 +73,11 @@ public: */ void clearPendingFetch(); + /** + * Reload requests from file + */ + void reloadRequests(); + /** * Return all conversation's id (including syncing ones) */ @@ -432,4 +437,4 @@ private: std::shared_ptr<Impl> pimpl_; }; -} // namespace jami \ No newline at end of file +} // namespace jami diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp index 4a4025e1d50744c1215779dfa72d6085eb29db9b..7340f639144543703ac383a1f63848f0ac4fca84 100644 --- a/src/jamidht/jamiaccount.cpp +++ b/src/jamidht/jamiaccount.cpp @@ -1453,6 +1453,15 @@ 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()) {