| 500 | } |
| 501 | |
| 502 | bool ProtocolClient::needToWaitForMissingIdentity(openmittsu::protocol::ContactId const& contactId, openmittsu::messages::MessageWithEncryptedPayload const*const messageWithEncryptedPayload) { |
| 503 | if (missingIdentityProcessors.contains(contactId)) { |
| 504 | LOGGER()->info("Enqueing incoming message on existing MissingIdentityProcessor for ID {}.", contactId.toString()); |
| 505 | missingIdentityProcessors.constFind(contactId).value()->enqueueMessage(*messageWithEncryptedPayload); |
| 506 | return true; |
| 507 | } else if ((!m_cryptoBox->getKeyRegistry().hasIdentity(contactId))) { |
| 508 | std::shared_ptr<MissingIdentityProcessor> missingIdentityProcessor = std::make_shared<MissingIdentityProcessor>(contactId); |
| 509 | missingIdentityProcessor->enqueueMessage(*messageWithEncryptedPayload); |
| 510 | missingIdentityProcessors.insert(contactId, missingIdentityProcessor); |
| 511 | LOGGER()->info("Enqueing MissingIdentityProcessor for ID {}.", contactId.toString()); |
| 512 | |
| 513 | openmittsu::tasks::CallbackTask* callbackTask = new openmittsu::tasks::IdentityReceiverCallbackTask(m_serverConfiguration, contactId); |
| 514 | |
| 515 | enqeueCallbackTask(callbackTask); |
| 516 | return true; |
| 517 | } |
| 518 | |
| 519 | return false; |
| 520 | } |
| 521 | |
| 522 | bool ProtocolClient::needToWaitForGroupData(openmittsu::protocol::GroupId const& groupId, openmittsu::messages::MessageWithEncryptedPayload const*const messageWithEncryptedPayload, bool isGroupCreationMessage) { |
| 523 | if (needToWaitForMissingIdentity(groupId.getOwner(), messageWithEncryptedPayload)) { |
nothing calls this directly
no test coverage detected