-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mam in progress #59
mam in progress #59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nearly all QLatin1String usages are plain wrong here.
QLatin1String make sense only if the api you will use has an overload taking a QLatin1String in plus to a QString overload.
If there is only QString parameters and you know you only deal with latin 1 content then just use QString::fromLatin1() then.
QDomElement e = s.createElement("urn:xmpp:carbons:2","private"); | ||
s.appendChild(e); | ||
if (d->carbonsPrivate || d->wasEncrypted) { | ||
s.appendChild(CarbonsManager::privateElement(stream->doc())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to xep 280, a private stanza also need a <no-copy/>
node.
disable.setAttribute(QLatin1String("xmlns"), xmlns_carbons); | ||
iq.appendChild(disable); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is clearly rooms to create an helper taking a bool enabled parameter to change the enable/disable element name.
src/xmpp/xmpp-im/xmpp_carbons.cpp
Outdated
bool JT_MessageCarbons::take(const QDomElement &e) | ||
{ | ||
if (iqVerify(e, Jid(), id())) { | ||
if (e.attribute(QLatin1String("type")) != QLatin1String("result")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no QLatin1String variant for QDN::attribute() so it's waonas you domore allocations.
Use QString::fromLatin1("...")
src/xmpp/xmpp-im/xmpp_forwarding.cpp
Outdated
if (type_ == ForwardedNone || !msg_) | ||
return QDomElement(); | ||
|
||
QDomElement e = stream->doc().createElement(QLatin1String("forwarded")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no QDomNode::createElement() taking a QLatin1String, so it's useless as you make 2 allocations, one for QLatin1String and one for QString, just use QString::fromLatin1("...") then.
It will be merged one day? |
I think it will be nice to add this in the Google Summer of Code 2023: |
@yatigautam, @butyoutried, @tech-bash: Maybe you could you continue the current PR? Linked to: XEP-0313: Message Archive Management: MAM: |
* move here from the mam branch, fix filtering, semantics, logic, etc * add id filter * actually add the id filtering logic * some code cleanup * add better error handling * add `xmpp_mamtask` to cmake and fix compilation errors * add mam manager (untested, compiles) * add ability to get last messages from archive, fix some naming * add ability to get messages before id * make the manager just return the activated MAM task instead of handling the result * fix archive behavior and return value for mam manager --------- Co-authored-by: mcneb10 <[email protected]>
A new XEP-0313 version has been released - 1.1.2 (2024-09-18):
It is good? Linked to: |
No description provided.