ios: add type for cloneConversation

If iOS is in deep sleep mode, it will only wake up the daemon if
a new activity needs to be shown (call, message or contact).
If the peer accepts a trust request, it will clone and join the
conversation (so a new message will be shown). So, cloning
a conversation should notify the iOS device that the daemon MUST
be started.

GitLab: #776
Change-Id: I639a5f928fec2970909a29b9f3c33c165ac201c8
This commit is contained in:
Sébastien Blin
2022-10-14 10:52:37 -04:00
parent 443901c789
commit 613aede46c
3 changed files with 8 additions and 8 deletions

View File

@ -337,7 +337,7 @@ ConversationModule::Impl::cloneConversation(const std::string& deviceId,
}
}
return false;
});
}, "application/im-gitmessage-id");
JAMI_INFO("[Account %s] New conversation detected: %s. Ask device %s to clone it",
accountId_.c_str(),
@ -456,7 +456,7 @@ ConversationModule::Impl::fetchNewCommits(const std::string& peer,
},
commitId);
return true;
});
}, "");
} else {
if (getRequest(conversationId) != std::nullopt)
return;
@ -1261,7 +1261,7 @@ ConversationModule::cloneConversationFrom(const std::string& conversationId,
}
}
return false;
});
}, "application/im-gitmessage-id");
});
ConvInfo info;
info.id = conversationId;

View File

@ -42,9 +42,9 @@ struct SyncMsg
};
using ChannelCb = std::function<bool(const std::shared_ptr<ChannelSocket>&)>;
using NeedSocketCb = std::function<void(const std::string&, const std::string&, ChannelCb&&)>;
using NeedSocketCb = std::function<void(const std::string&, const std::string&, ChannelCb&&, const std::string&)>;
using SengMsgCb
= std::function<uint64_t(const std::string&, std::map<std::string, std::string>&&, uint64_t)>;
= std::function<uint64_t(const std::string&, std::map<std::string, std::string>, uint64_t)>;
using NeedsSyncingCb = std::function<void(std::shared_ptr<SyncMsg>&&)>;
using UpdateConvReq = std::function<void(const std::string&, const std::string&, bool)>;

View File

@ -2350,8 +2350,8 @@ JamiAccount::convModule()
// main thread.
return sendTextMessage(uri, msg, token);
},
[this](const auto& convId, const auto& deviceId, auto&& cb) {
runOnMainThread([w = weak(), convId, deviceId, cb = std::move(cb)] {
[this](const auto& convId, const auto& deviceId, auto cb, const auto& type) {
runOnMainThread([w = weak(), convId, deviceId, cb = std::move(cb), type] {
auto shared = w.lock();
if (!shared)
return;
@ -2384,7 +2384,7 @@ JamiAccount::convModule()
socket->shutdown();
} else
cb({});
});
}, false, false, type);
});
},
[this](auto&& convId, auto&& contactUri, bool accept) {