Skip to content

Commit

Permalink
SM: Fix stream resumption
Browse files Browse the repository at this point in the history
Stream resumption did not work in the original PR (#99) in 2017.
  • Loading branch information
lnjX committed May 16, 2024
1 parent ccfb3eb commit e60da52
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/base/QXmppStreamManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ void QXmppStreamManagementEnabled::parse(const QDomElement &element)
{
QString resume = element.attribute(QStringLiteral("resume"));
m_resume = resume == QStringLiteral("true") || resume == QStringLiteral("1");
m_id = element.attribute(QStringLiteral("id"));
m_max = element.attribute(QStringLiteral("max")).toUInt();
m_location = element.attribute(QStringLiteral("location"));
}
Expand Down Expand Up @@ -178,6 +179,7 @@ void QXmppStreamManagementResume::parse(const QDomElement &element)
void QXmppStreamManagementResume::toXml(QXmlStreamWriter *writer) const
{
writer->writeStartElement(QStringLiteral("resume"));
writer->writeDefaultNamespace(ns_stream_management);
writer->writeAttribute(QStringLiteral("h"), QString::number(m_h));
writer->writeAttribute(QStringLiteral("previd"), m_previd);
writer->writeEndElement();
Expand Down Expand Up @@ -223,6 +225,7 @@ void QXmppStreamManagementResumed::parse(const QDomElement &element)
void QXmppStreamManagementResumed::toXml(QXmlStreamWriter *writer) const
{
writer->writeStartElement(QStringLiteral("resumed"));
writer->writeDefaultNamespace(ns_stream_management);
writer->writeAttribute(QStringLiteral("h"), QString::number(m_h));
writer->writeAttribute(QStringLiteral("previd"), m_previd);
writer->writeEndElement();
Expand Down

1 comment on commit e60da52

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format reports: 4 file(s) not formatted
  • src/base/QXmppPubSubIq_p.h
  • src/client/QXmppBlockingManager.h
  • tests/qxmppentitytimemanager/tst_qxmppentitytimemanager.cpp
  • tests/qxmppversionmanager/tst_qxmppversionmanager.cpp
clang-tidy reports: 4513 concern(s)

Have any feedback or feature suggestions? Share it here.

Please sign in to comment.