MCPcopy Create free account
hub / github.com/blizzard4591/openMittsu / needToWaitForMissingIdentity

Method needToWaitForMissingIdentity

src/network/ProtocolClient.cpp:502–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)) {

Callers

nothing calls this directly

Calls 5

containsMethod · 0.80
valueMethod · 0.80
toStringMethod · 0.45
enqueueMessageMethod · 0.45
hasIdentityMethod · 0.45

Tested by

no test coverage detected