Пример #1
0
void TlsHandler::onCertVerifierReady(Tp::PendingOperation *op)
{
    TlsCertVerifierOp *verifier = qobject_cast<TlsCertVerifierOp*>(op);
    Q_ASSERT(mVerifiers.contains(verifier));

    Tp::MethodInvocationContextPtr<> context = mVerifiers.value(verifier);
    context->setFinished();
}
Пример #2
0
void PipeApprover::addDispatchOperation(const Tp::MethodInvocationContextPtr<> &context,
        const Tp::ChannelDispatchOperationPtr &dispatchOperation) 
{
    CaseHandler<void> handler = pipeCM.checkNewChannel(
            dispatchOperation->connection(),
            dispatchOperation->channels());

    pDebug() << "New channels to check at approver";
    if(handler) {
        pDebug() << "Claiming ownership of some channels from: \n"
            << "    Connection: " << dispatchOperation->connection()->busName() 
            << "\n    Channels number: " << dispatchOperation->channels().size();
        MoveOnCopy<CaseHandler<void>> moved_handler(std::move(handler));

        connect(dispatchOperation->claim(), 
                &Tp::PendingOperation::finished, 
                this, 
                [moved_handler](Tp::PendingOperation *op) {
                    if(op->isError()) 
                        pDebug() << "Error while claiming channel: " << op->errorMessage();
                    else moved_handler.value(); 
                });
    } else {
        pDebug() << "New channels are rejected: \n" 
            << "    Connection: " << dispatchOperation->connection()->busName() 
            << "\n    Channels number: " << dispatchOperation->channels().size();
    }
    SCOPE_EXIT( context->setFinished(); );