Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Jun 12, 2024
1 parent 8ddfef1 commit 46c3528
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/xmpp/xmpp-im/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/xmpp/xmpp-im/xmpp_externalservicediscovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions src/xmpp/xmpp-im/xmpp_serverinfomanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ void ServerInfoManager::server_disco_finished()
{
JT_DiscoInfo *jt = static_cast<JT_DiscoInfo *>(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"));
Expand Down Expand Up @@ -297,7 +297,7 @@ void ServerInfoManager::account_disco_finished()
}
}
_hasPersistentStorage = jt->item().hasPersistentStorage();
_account_features = jt->item().features();
_accountFeatures = jt->item().features();

emit featuresChanged();
}
Expand Down
8 changes: 4 additions & 4 deletions src/xmpp/xmpp-im/xmpp_serverinfomanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString, QStringList> &extraServerInfo() const { return _extraServerInfo; }

Expand Down Expand Up @@ -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<QString, QStringList> _extraServerInfo; // XEP-0128, XEP-0157

Expand Down
4 changes: 4 additions & 0 deletions src/xmpp/xmpp-im/xmpp_vcard4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/xmpp/xmpp-im/xmpp_vcard4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down Expand Up @@ -252,6 +253,7 @@ class VCard {
~VCard();

VCard &operator=(const VCard &);
void detach();

bool isEmpty() const;

Expand Down

0 comments on commit 46c3528

Please sign in to comment.