Exemplo n.º 1
0
void OtrFingerprintService::writeFingerprints() const
{
	if (!UserStateService)
		return;

	OtrlUserState userState = UserStateService->userState();
	otrl_privkey_write_fingerprints(userState, PathService->fingerprintsStoreFilePath().toUtf8().data());

	emit fingerprintsUpdated();
}
Exemplo n.º 2
0
void OtrPluginObject::init()
{
    if (!m_otrAvailable)
        throw PluginActivationErrorException("encryption_otr", tr("OTR encryption library could not be initialized"));

    m_accountConfigurationWidgetFactoryRepository->registerFactory(m_otrAccountConfigurationWidgetFactory);
    m_buddyConfigurationWidgetFactoryRepository->registerFactory(m_otrBuddyConfigurationWidgetFactory);
    m_chatTopBarWidgetFactoryRepository->registerFactory(m_otrChatTopBarWidgetFactory);

    connect(m_otrFingerprintService, SIGNAL(fingerprintsUpdated()), m_otrTrustLevelService, SLOT(updateTrustLevels()));
    m_otrFingerprintService->readFingerprints();
    m_otrInstanceTagService->readInstanceTags();

    connect(
        m_otrPeerIdentityVerificationService, SIGNAL(questionAnswerRequested(Contact, QString)),
        m_otrPeerIdentityVerificationWindowRepository,
        SLOT(showRespondQuestionAndAnswerVerificationWindow(Contact, QString)));
    connect(
        m_otrPeerIdentityVerificationService, SIGNAL(sharedSecretRequested(Contact)),
        m_otrPeerIdentityVerificationWindowRepository, SLOT(showRespondSharedSecretVerificationWindow(Contact)));

    m_otrPrivateKeyService->readPrivateKeys();

    connect(
        m_otrPrivateKeyService, SIGNAL(createPrivateKeyStarted(Account)), m_otrNotifier,
        SLOT(notifyCreatePrivateKeyStarted(Account)));
    connect(
        m_otrPrivateKeyService, SIGNAL(createPrivateKeyFinished(Account, bool)), m_otrNotifier,
        SLOT(notifyCreatePrivateKeyFinished(Account, bool)));

    connect(
        m_otrRawMessageTransformer, SIGNAL(peerEndedSession(Contact)), m_otrNotifier,
        SLOT(notifyPeerEndedSession(Contact)));

    connect(
        m_otrSessionService, SIGNAL(tryingToStartSession(Contact)), m_otrNotifier,
        SLOT(notifyTryingToStartSession(Contact)));
    connect(
        m_otrSessionService, SIGNAL(tryingToRefreshSession(Contact)), m_otrNotifier,
        SLOT(notifyTryingToRefreshSession(Contact)));
    connect(m_otrSessionService, SIGNAL(goneSecure(Contact)), m_otrNotifier, SLOT(notifyGoneSecure(Contact)));
    connect(m_otrSessionService, SIGNAL(goneInsecure(Contact)), m_otrNotifier, SLOT(notifyGoneInsecure(Contact)));
    connect(m_otrSessionService, SIGNAL(stillSecure(Contact)), m_otrNotifier, SLOT(notifyStillSecure(Contact)));

    m_otrTrustLevelService->updateTrustLevels();

    m_otrRawMessageTransformer->setEnableFragments(fragmentsFixAvailable());
    m_rawMessageTransformerService->registerTransformer(m_otrRawMessageTransformer);

    for (auto notifyEvent : m_otrNotifier->notifyEvents())
        m_notificationEventRepository->addNotificationEvent(notifyEvent);
}