Skip to content

Commit 46c3528

Browse files
committed
code style
1 parent 8ddfef1 commit 46c3528

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

src/xmpp/xmpp-im/client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ void Client::setCapsOptimizationAllowed(bool allowed) { d->capsOptimization = al
286286

287287
bool Client::capsOptimizationAllowed() const
288288
{
289-
if (d->capsOptimization && d->active && d->serverInfoManager->server_features().hasCapsOptimize()) {
289+
if (d->capsOptimization && d->active && d->serverInfoManager->serverFeatures().hasCapsOptimize()) {
290290
auto it = d->resourceList.find(d->resource);
291291
return it != d->resourceList.end() && it->status().isAvailable();
292292
}

src/xmpp/xmpp-im/xmpp_externalservicediscovery.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ ExternalServiceDiscovery::ExternalServiceDiscovery(Client *client) : client_(cli
250250

251251
bool ExternalServiceDiscovery::isSupported() const
252252
{
253-
return client_->serverInfoManager()->server_features().test("urn:xmpp:extdisco:2");
253+
return client_->serverInfoManager()->serverFeatures().test("urn:xmpp:extdisco:2");
254254
}
255255

256256
void ExternalServiceDiscovery::services(QObject *ctx, ServicesCallback &&callback, std::chrono::minutes minTtl,

src/xmpp/xmpp-im/xmpp_serverinfomanager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ void ServerInfoManager::server_disco_finished()
264264
{
265265
JT_DiscoInfo *jt = static_cast<JT_DiscoInfo *>(sender());
266266
if (jt->success()) {
267-
_server_features = jt->item().features();
267+
_serverFeatures = jt->item().features();
268268

269-
if (_server_features.hasMulticast())
269+
if (_serverFeatures.hasMulticast())
270270
_multicastService = _client->jid().domain();
271271

272-
_canMessageCarbons = _server_features.hasMessageCarbons();
272+
_canMessageCarbons = _serverFeatures.hasMessageCarbons();
273273

274274
auto servInfo
275275
= jt->item().findExtension(XData::Data_Result, QLatin1String("http://jabber.org/network/serverinfo"));
@@ -297,7 +297,7 @@ void ServerInfoManager::account_disco_finished()
297297
}
298298
}
299299
_hasPersistentStorage = jt->item().hasPersistentStorage();
300-
_account_features = jt->item().features();
300+
_accountFeatures = jt->item().features();
301301

302302
emit featuresChanged();
303303
}

src/xmpp/xmpp-im/xmpp_serverinfomanager.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ class ServerInfoManager : public QObject {
8181
const QString &multicastService() const;
8282
inline bool hasPEP() const { return _hasPEP; }
8383
inline bool hasPersistentStorage() const { return _hasPersistentStorage; }
84-
inline const Features &server_features() const { return _server_features; }
85-
inline const Features &account_features() const { return _account_features; }
84+
inline const Features &serverFeatures() const { return _serverFeatures; }
85+
inline const Features &accountFeatures() const { return _accountFeatures; }
8686
bool canMessageCarbons() const;
8787
inline const QMap<QString, QStringList> &extraServerInfo() const { return _extraServerInfo; }
8888

@@ -128,8 +128,8 @@ private slots:
128128
private:
129129
XMPP::Client *_client = nullptr;
130130
CapsSpec _caps;
131-
Features _server_features;
132-
Features _account_features;
131+
Features _serverFeatures;
132+
Features _accountFeatures;
133133
QString _multicastService;
134134
QMap<QString, QStringList> _extraServerInfo; // XEP-0128, XEP-0157
135135

src/xmpp/xmpp-im/xmpp_vcard4.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ UriValue::UriValue(const QString &uri)
462462
}
463463
}
464464

465+
UriValue::UriValue(const QByteArray &data, const QString &mime) : data(data), mediaType(mime) { }
466+
465467
QString UriValue::toString() const
466468
{
467469
if (!mediaType.isEmpty()) {
@@ -633,6 +635,8 @@ VCard &VCard::operator=(const VCard &other)
633635
return *this;
634636
}
635637

638+
void VCard::detach() { d.detach(); }
639+
636640
VCard::VCard(const QDomElement &element) : d(new VCardData(element)) { }
637641

638642
VCard::~VCard() = default;

src/xmpp/xmpp-im/xmpp_vcard4.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class UriValue {
102102
public:
103103
UriValue() = default;
104104
explicit UriValue(const QString &uri);
105+
explicit UriValue(const QByteArray &data, const QString &mime);
105106
QString toString() const;
106107
inline operator QString() const { return toString(); }
107108
bool isEmpty() const { return url.isEmpty() && data.isEmpty(); }
@@ -252,6 +253,7 @@ class VCard {
252253
~VCard();
253254

254255
VCard &operator=(const VCard &);
256+
void detach();
255257

256258
bool isEmpty() const;
257259

0 commit comments

Comments
 (0)