Exemplo n.º 1
0
Arquivo: core.cpp Projeto: mpxc/qTox
/**
 * @brief Checks if we have a friend by public key
 */
bool Core::hasFriendWithPublicKey(const ToxPk& publicKey) const
{
    if (publicKey.isEmpty()) {
        return false;
    }

    // TODO: error handling
    uint32_t friendId = tox_friend_by_public_key(tox, publicKey.getBytes(), nullptr);
    return friendId != std::numeric_limits<uint32_t>::max();
}