diff --git a/src/xmpp/xmpp-im/client.cpp b/src/xmpp/xmpp-im/client.cpp index f42c991a..f9851b45 100644 --- a/src/xmpp/xmpp-im/client.cpp +++ b/src/xmpp/xmpp-im/client.cpp @@ -286,7 +286,7 @@ void Client::setCapsOptimizationAllowed(bool allowed) { d->capsOptimization = al bool Client::capsOptimizationAllowed() const { - if (d->capsOptimization && d->active && d->serverInfoManager->server_features().hasCapsOptimize()) { + if (d->capsOptimization && d->active && d->serverInfoManager->serverFeatures().hasCapsOptimize()) { auto it = d->resourceList.find(d->resource); return it != d->resourceList.end() && it->status().isAvailable(); } diff --git a/src/xmpp/xmpp-im/xmpp_externalservicediscovery.cpp b/src/xmpp/xmpp-im/xmpp_externalservicediscovery.cpp index 5bd33c04..159613c5 100644 --- a/src/xmpp/xmpp-im/xmpp_externalservicediscovery.cpp +++ b/src/xmpp/xmpp-im/xmpp_externalservicediscovery.cpp @@ -250,7 +250,7 @@ ExternalServiceDiscovery::ExternalServiceDiscovery(Client *client) : client_(cli bool ExternalServiceDiscovery::isSupported() const { - return client_->serverInfoManager()->server_features().test("urn:xmpp:extdisco:2"); + return client_->serverInfoManager()->serverFeatures().test("urn:xmpp:extdisco:2"); } void ExternalServiceDiscovery::services(QObject *ctx, ServicesCallback &&callback, std::chrono::minutes minTtl, diff --git a/src/xmpp/xmpp-im/xmpp_serverinfomanager.cpp b/src/xmpp/xmpp-im/xmpp_serverinfomanager.cpp index 317b3be9..0072c80c 100644 --- a/src/xmpp/xmpp-im/xmpp_serverinfomanager.cpp +++ b/src/xmpp/xmpp-im/xmpp_serverinfomanager.cpp @@ -264,12 +264,12 @@ void ServerInfoManager::server_disco_finished() { JT_DiscoInfo *jt = static_cast(sender()); if (jt->success()) { - _server_features = jt->item().features(); + _serverFeatures = jt->item().features(); - if (_server_features.hasMulticast()) + if (_serverFeatures.hasMulticast()) _multicastService = _client->jid().domain(); - _canMessageCarbons = _server_features.hasMessageCarbons(); + _canMessageCarbons = _serverFeatures.hasMessageCarbons(); auto servInfo = jt->item().findExtension(XData::Data_Result, QLatin1String("http://jabber.org/network/serverinfo")); @@ -297,7 +297,7 @@ void ServerInfoManager::account_disco_finished() } } _hasPersistentStorage = jt->item().hasPersistentStorage(); - _account_features = jt->item().features(); + _accountFeatures = jt->item().features(); emit featuresChanged(); } diff --git a/src/xmpp/xmpp-im/xmpp_serverinfomanager.h b/src/xmpp/xmpp-im/xmpp_serverinfomanager.h index 4ced0e78..0bb0343b 100644 --- a/src/xmpp/xmpp-im/xmpp_serverinfomanager.h +++ b/src/xmpp/xmpp-im/xmpp_serverinfomanager.h @@ -81,8 +81,8 @@ class ServerInfoManager : public QObject { const QString &multicastService() const; inline bool hasPEP() const { return _hasPEP; } inline bool hasPersistentStorage() const { return _hasPersistentStorage; } - inline const Features &server_features() const { return _server_features; } - inline const Features &account_features() const { return _account_features; } + inline const Features &serverFeatures() const { return _serverFeatures; } + inline const Features &accountFeatures() const { return _accountFeatures; } bool canMessageCarbons() const; inline const QMap &extraServerInfo() const { return _extraServerInfo; } @@ -128,8 +128,8 @@ private slots: private: XMPP::Client *_client = nullptr; CapsSpec _caps; - Features _server_features; - Features _account_features; + Features _serverFeatures; + Features _accountFeatures; QString _multicastService; QMap _extraServerInfo; // XEP-0128, XEP-0157 diff --git a/src/xmpp/xmpp-im/xmpp_vcard4.cpp b/src/xmpp/xmpp-im/xmpp_vcard4.cpp index c813cb1d..a8732320 100644 --- a/src/xmpp/xmpp-im/xmpp_vcard4.cpp +++ b/src/xmpp/xmpp-im/xmpp_vcard4.cpp @@ -462,6 +462,8 @@ UriValue::UriValue(const QString &uri) } } +UriValue::UriValue(const QByteArray &data, const QString &mime) : data(data), mediaType(mime) { } + QString UriValue::toString() const { if (!mediaType.isEmpty()) { @@ -633,6 +635,8 @@ VCard &VCard::operator=(const VCard &other) return *this; } +void VCard::detach() { d.detach(); } + VCard::VCard(const QDomElement &element) : d(new VCardData(element)) { } VCard::~VCard() = default; diff --git a/src/xmpp/xmpp-im/xmpp_vcard4.h b/src/xmpp/xmpp-im/xmpp_vcard4.h index ff234294..4d945890 100644 --- a/src/xmpp/xmpp-im/xmpp_vcard4.h +++ b/src/xmpp/xmpp-im/xmpp_vcard4.h @@ -102,6 +102,7 @@ class UriValue { public: UriValue() = default; explicit UriValue(const QString &uri); + explicit UriValue(const QByteArray &data, const QString &mime); QString toString() const; inline operator QString() const { return toString(); } bool isEmpty() const { return url.isEmpty() && data.isEmpty(); } @@ -252,6 +253,7 @@ class VCard { ~VCard(); VCard &operator=(const VCard &); + void detach(); bool isEmpty() const;