本文整理汇总了C++中QXmppConfiguration::domain方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmppConfiguration::domain方法的具体用法?C++ QXmppConfiguration::domain怎么用?C++ QXmppConfiguration::domain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmppConfiguration
的用法示例。
在下文中一共展示了QXmppConfiguration::domain方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connectToServer
void ChatClient::connectToServer(const QString &jid, const QString &password)
{
QXmppConfiguration config;
config.setResource(qApp->applicationName());
config.setJid(jid);
config.setPassword(password);
// don't ignore SSL errors for wifirst and gmail, but do for other domains
if (config.domain() == "wifirst.net" || config.domain() == "gmail.com" || config.domain() == "googlemail.com") {
config.setStreamSecurityMode(QXmppConfiguration::TLSRequired);
config.setIgnoreSslErrors(false);
}
QXmppClient::connectToServer(config);
}
示例2: connectToGoogle
void ChatClient::connectToGoogle(const QString &jid, const QString &accessToken)
{
QXmppConfiguration config;
config.setResource(qApp->applicationName());
config.setGoogleAccessToken(accessToken);
config.setJid(jid);
config.setSaslAuthMechanism("X-OAUTH2");
config.setStreamSecurityMode(QXmppConfiguration::TLSRequired);
// don't ignore SSL errors for gmail, but do for other domains (google apps hosted domains)
if (config.domain() == "gmail.com" || config.domain() == "googlemail.com")
config.setIgnoreSslErrors(false);
QXmppClient::connectToServer(config);
}
示例3: InsertGlobalData
void FreyaMSConfig::InsertGlobalData(const QXmppConfiguration &config)
{
QVariantMap globalConfigMap;
globalConfigMap.insert(FREYAMS_CFG_CONFIDSERVER, config.host());
globalConfigMap.insert(FREYAMS_CFG_CONFIDPORT, config.port());
globalConfigMap.insert(FREYAMS_CFG_CONFIDDOMAIN, config.domain());
globalConfigMap.insert(FREYAMS_CFG_CONFIDRESOURCE, FREYAMS_INF_DEFCONFRESOURCE);
globalConfigMap.insert(FREYAMS_CFG_CONFIDACCOUND, config.jidBare().split("@").at(0));
QVariantMap defaultConfig;
defaultConfig.insert(FREYAMS_CFG_CONFIDDEFAULT, globalConfigMap);
defaultConfig.insert(FREYAMS_CFG_CONFIDNONE, FreyaCryptogram::EnCryptogram(config.password()));
FreyaBaseControl::GetFreyaControl()->SetConfigToFile(FREYAMS_PTH_GLOBALCONFIGPATH, defaultConfig);
}
示例4: connectToHost
void QXmppOutgoingClientPrivate::connectToHost(const QString &host, quint16 port)
{
q->info(QString("Connecting to %1:%2").arg(host, QString::number(port)));
// override CA certificates if requested
if (!config.caCertificates().isEmpty())
q->socket()->setCaCertificates(config.caCertificates());
// respect proxy
q->socket()->setProxy(config.networkProxy());
#if (QT_VERSION >= QT_VERSION_CHECK(4, 8, 0))
// set the name the SSL certificate should match
q->socket()->setPeerVerifyName(config.domain());
#endif
// connect to host
q->socket()->connectToHost(host, port);
}
示例5: connectToHost
void QXmppOutgoingClientPrivate::connectToHost(const QString &host, quint16 port)
{
q->info(QString("Connecting to %1:%2").arg(host, QString::number(port)));
// override CA certificates if requested
if (!config.caCertificates().isEmpty())
q->socket()->setCaCertificates(config.caCertificates());
// set private key and certificate if available
if (!config.sslPrivateKey().isNull())
{
q->socket()->setPrivateKey(config.sslPrivateKey());
}
if (!config.localSslCertificate().isNull())
{
q->socket()->setLocalCertificate(config.localSslCertificate());
}
// respect proxy
q->socket()->setProxy(config.networkProxy());
#if (QT_VERSION >= QT_VERSION_CHECK(4, 8, 0))
// set the name the SSL certificate should match
q->socket()->setPeerVerifyName(config.domain());
#endif
// connect to host
const QXmppConfiguration::StreamSecurityMode localSecurity = q->configuration().streamSecurityMode();
if (localSecurity == QXmppConfiguration::LegacySSL) {
if (!q->socket()->supportsSsl()) {
q->warning("Not connecting as legacy SSL was requested, but SSL support is not available");
return;
}
q->socket()->connectToHostEncrypted(host, port);
} else {
q->socket()->connectToHost(host, port);
}
}