Beispiel #1
0
void ChatForm::onCancelCallTriggered()
{
    qDebug() << "onCancelCallTriggered";

    enableCallButtons();

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

    disableCallButtons();
    if (coreav->startCall(f->getFriendID(), true))
        showOutgoingCall(true);
    else
        enableCallButtons();
}
Beispiel #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();
}
Beispiel #4
0
void ChatForm::onAvCallFailed(uint32_t FriendId)
{
    if (FriendId != f->getFriendID())
        return;

    qDebug() << "onAvCallFailed";

    delete callConfirm;
    callConfirm = nullptr;

    enableCallButtons();
}
Beispiel #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();
}
Beispiel #6
0
void ChatForm::onAvEnd(uint32_t FriendId, int)
{
    if (FriendId != f->getFriendID())
        return;

    qDebug() << "onAvEnd";

    delete callConfirm;
    callConfirm = nullptr;

    enableCallButtons();
    stopCounter();
    hideNetcam();
}
Beispiel #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;
}
Beispiel #8
0
void ChatForm::onRejectCallTriggered()
{
    qDebug() << "onRejectCallTriggered";

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

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

    enableCallButtons();
}
Beispiel #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();
}
Beispiel #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();
}
Beispiel #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());
}
Beispiel #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();
}
Beispiel #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()));
}