Esempio n. 1
0
void ChatForm::onCancelCallTriggered()
{
    qDebug() << "onCancelCallTriggered";

    enableCallButtons();

    hideNetcam();
    emit cancelCall(callId, f->getFriendID());
}
Esempio n. 2
0
void ChatForm::onVideoCallTriggered()
{
    qDebug() << "onVideoCallTriggered";

    disableCallButtons();
    if (coreav->startCall(f->getFriendID(), true))
        showOutgoingCall(true);
    else
        enableCallButtons();
}
Esempio n. 3
0
void ChatForm::onCancelCallTriggered()
{
    qDebug() << "onCancelCallTriggered";

    if (!coreav->cancelCall(f->getFriendID()))
        qWarning() << "Failed to cancel a call! Assuming we're not in call";

    enableCallButtons();
    stopCounter();
    hideNetcam();
}
Esempio n. 4
0
void ChatForm::onAvCallFailed(uint32_t FriendId)
{
    if (FriendId != f->getFriendID())
        return;

    qDebug() << "onAvCallFailed";

    delete callConfirm;
    callConfirm = nullptr;

    enableCallButtons();
}
Esempio n. 5
0
void ChatForm::onHangupCallTriggered()
{
    qDebug() << "onHangupCallTriggered";

    //Fixes an OS X bug with ending a call while in full screen
    if (netcam && netcam->isFullScreen())
        netcam->showNormal();

    audioInputFlag = false;
    audioOutputFlag = false;
    emit hangupCall(callId);

    enableCallButtons();
}
Esempio n. 6
0
void ChatForm::onAvEnd(uint32_t FriendId, int)
{
    if (FriendId != f->getFriendID())
        return;

    qDebug() << "onAvEnd";

    delete callConfirm;
    callConfirm = nullptr;

    enableCallButtons();
    stopCounter();
    hideNetcam();
}
Esempio n. 7
0
void ChatForm::onFriendStatusChanged(uint32_t friendId, Status status)
{
    // Disable call buttons if friend is offline
    if(friendId != f->getFriendID())
        return;

    Status old = oldStatus.value(friendId, Status::Offline);

    if (old != Status::Offline && status == Status::Offline)
        disableCallButtons();
    else if (old == Status::Offline && status != Status::Offline)
        enableCallButtons();

    oldStatus[friendId] = status;
}
Esempio n. 8
0
void ChatForm::onRejectCallTriggered()
{
    qDebug() << "onRejectCallTriggered";

    if (callConfirm)
    {
        delete callConfirm;
        callConfirm = nullptr;
    }

    audioInputFlag = false;
    audioOutputFlag = false;
    emit rejectCall(callId);

    enableCallButtons();
}
Esempio n. 9
0
void ChatForm::onAvRejected(uint32_t FriendId, int)
{
    if (FriendId != f->getFriendID())
        return;

    qDebug() << "onAvRejected";

    delete callConfirm;
    callConfirm = nullptr;

    enableCallButtons();

    insertChatMessage(ChatMessage::createChatInfoMessage(tr("Call rejected"), ChatMessage::INFO, QDateTime::currentDateTime()));

    hideNetcam();
}
Esempio n. 10
0
void ChatForm::onHangupCallTriggered()
{
    qDebug() << "onHangupCallTriggered";

    //Fixes an OS X bug with ending a call while in full screen
    if (netcam && netcam->isFullScreen())
        netcam->showNormal();

    audioInputFlag = false;
    audioOutputFlag = false;
    coreav->cancelCall(f->getFriendID());

    stopCounter();
    enableCallButtons();
    hideNetcam();
}
Esempio n. 11
0
void ChatForm::onAvCancel(uint32_t FriendId, int)
{
    if (FriendId != f->getFriendID())
        return;

    qDebug() << "onAvCancel";

    delete callConfirm;
    callConfirm = nullptr;

    enableCallButtons();
    stopCounter();

    hideNetcam();

    addSystemInfoMessage(tr("%1 stopped calling").arg(f->getDisplayedName()), ChatMessage::INFO, QDateTime::currentDateTime());
}
Esempio n. 12
0
void ChatForm::onRejectCallTriggered()
{
    qDebug() << "onRejectCallTriggered";

    if (callConfirm)
    {
        delete callConfirm;
        callConfirm = nullptr;
    }

    Audio::getInstance().stopLoop();

    audioInputFlag = false;
    audioOutputFlag = false;
    coreav->cancelCall(f->getFriendID());

    enableCallButtons();
    stopCounter();
}
Esempio n. 13
0
void ChatForm::onAnswerCallTriggered()
{
    qDebug() << "onAnswerCallTriggered";

    if (callConfirm)
    {
        delete callConfirm;
        callConfirm = nullptr;
    }

    Audio::getInstance().stopLoop();

    disableCallButtons();

    if (!coreav->answerCall(f->getFriendID()))
    {
        enableCallButtons();
        stopCounter();
        hideNetcam();
        return;
    }

    onAvStart(f->getFriendID(), coreav->isCallVideoEnabled(f->getFriendID()));
}