Skip to content

Commit

Permalink
Message: Serialize fallback markers in both public/private SCE mode
Browse files Browse the repository at this point in the history
This is needed to allow fallback markers for private content, e.g.
for message replies.
  • Loading branch information
lnjX committed Aug 18, 2024
1 parent c997ff3 commit e474da0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/base/QXmppMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1953,11 +1953,6 @@ void QXmppMessage::serializeExtensions(QXmlStreamWriter *writer, QXmpp::SceMode
d->omemoElement->toXml(writer);
}
#endif

// XEP-0428: Fallback Indication
for (const auto &fallback : d->fallbackMarkers) {
fallback.toXml(writer);
}
}

if (sceMode & QXmpp::SceSensitive) {
Expand Down Expand Up @@ -2151,6 +2146,15 @@ void QXmppMessage::serializeExtensions(QXmlStreamWriter *writer, QXmpp::SceMode
d->callInviteElement->toXml(writer);
}
}

// serialize in private and in public part

// XEP-0428: Fallback Indication
// fallback markers may be used in the private part (e.g. message replies) but also in the
// public part (e.g. the fallback body for e2ee messages)
for (const auto &fallback : d->fallbackMarkers) {
fallback.toXml(writer);
}
}

struct QXmppFallbackPrivate : QSharedData {
Expand Down

0 comments on commit e474da0

Please sign in to comment.