Ejemplo n.º 1
0
Archivo: core.cpp Proyecto: mpxc/qTox
int Core::createGroup(uint8_t type)
{
    if (type == TOX_CONFERENCE_TYPE_TEXT) {
        TOX_ERR_CONFERENCE_NEW error;
        uint32_t groupId = tox_conference_new(tox, &error);

        switch (error) {
        case TOX_ERR_CONFERENCE_NEW_OK:
            emit emptyGroupCreated(groupId);
            return groupId;

        case TOX_ERR_CONFERENCE_NEW_INIT:
            qCritical() << "The conference instance failed to initialize";
            return std::numeric_limits<uint32_t>::max();

        default:
            return std::numeric_limits<uint32_t>::max();
        }
    } else if (type == TOX_CONFERENCE_TYPE_AV) {
        uint32_t groupId = toxav_add_av_groupchat(tox, CoreAV::groupCallCallback, this);
        emit emptyGroupCreated(groupId);
        return groupId;
    } else {
        qWarning() << "createGroup: Unknown type " << type;
        return -1;
    }
}
Ejemplo n.º 2
0
void Core::createGroup(uint8_t type)
{
    if (type == TOX_GROUPCHAT_TYPE_TEXT)
    {
        emit emptyGroupCreated(tox_add_groupchat(tox));
    }
    else if (type == TOX_GROUPCHAT_TYPE_AV)
    {
        emit emptyGroupCreated(toxav_add_av_groupchat(tox, &Audio::playGroupAudioQueued, this));
    }
    else
    {
        qWarning() << "createGroup: Unknown type "<<type;
    }
}
Ejemplo n.º 3
0
int Core::createGroup(uint8_t type)
{
    if (type == TOX_GROUPCHAT_TYPE_TEXT)
    {
        int group = tox_add_groupchat(tox);
        emit emptyGroupCreated(group);
        return group;
    }
    else if (type == TOX_GROUPCHAT_TYPE_AV)
    {
        int group = toxav_add_av_groupchat(tox, &Audio::playGroupAudioQueued, this);
        emit emptyGroupCreated(group);
        return group;
    }
    else
    {
        qWarning() << "createGroup: Unknown type "<<type;
        return -1;
    }
}
Ejemplo n.º 4
0
void Core::createGroup()
{
    emit emptyGroupCreated(tox_add_groupchat(tox));
}