-
Notifications
You must be signed in to change notification settings - Fork 196
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
refactor to add 3.4 Multiple Items in Form Results #60
base: master
Are you sure you want to change the base?
Conversation
On the whole this looks good, though I will need to read it more in depth. Georg: any thoughts on the non-const accessors? I understand the motivation, but we do not use them much in the rest of the API. |
but it will be needed in some of XEP Protocol like XEP-0055 Jabber Search |
it might not be super useful for other API, |
QSharedDataPointer<QXmppDataFormItemPrivate> d; | ||
}; | ||
|
||
class QXMPP_EXPORT Reported |
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.
I am not entirely sure I understand the purpose of the Item / Reported classes. Unless I am mistaken, they both seem to describe a list/vector of Fields?
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.
yes, both of them described a list of fields, the difference between them is reported stand for "table haed" and item stand for "talbe cell".
reference:
the definition
http://xmpp.org/extensions/xep-0004.html#protocol-results
the example
https://xmpp.org/extensions/xep-0055.html#example-9
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.
OK I guess my question was: do we need two separate classes for this?
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 a little different xml tag name and element between reported, item
if you would like it to use only item, it is possible, but there will be some specific logic for this kind purpose. it looks wired to me.
like below
"<x xmlns=\"jabber:x:data\" type=\"result\">"
"<reported>"
"<field type=\"jid-single\" label=\"JID\" var=\"jid\"/>"
"<field type=\"text-single\" label=\"Username\" var=\"Username\"/>"
"<field type=\"text-single\" label=\"Name\" var=\"Name\"/>"
"<field type=\"text-single\" label=\"Email\" var=\"Email\"/>"
"</reported>"
"<item>"
"<field type=\"text-single\" var=\"jid\">"
"<value>Zam@im-BestTaiwan.com.tw</value>"
"</field>"
"<field type=\"text-single\" var=\"Username\">"
"<value>Zam</value>"
"</field>"
"<field type=\"text-single\" var=\"Name\">"
"<value>Zam</value>"
"</field>"
"<field type=\"text-single\" var=\"Email\">"
"<value>Zam@BestTaiwan.com.tw</value>"
"</field>"
"</item>"
"</x>"
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.
@jlaine
if you are having any considering or suggestion, please shoot to me.
it would be great to have that.
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.
OK so "reported" has "label" but no "value", right? Let's keep the classes separate then.
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.
yes, it is
81b12d9
to
cd81054
Compare
Could you please address my question: can't we use "Item" class for the "reported" member ? |
@0xd34df00d ^^^ |
Could we re-push this branch to get coverage to run please? Also does doc/xep.doc need updating? |
@tehnick re non-const getters — I'm generally fine with them if they're providing direct access to some |
84168ac
to
e614dcc
Compare
XEP-0004, 3.4 Multiple Items in Form Results
http://xmpp.org/extensions/xep-0004.html#protocol-results
refactor :
add Fileld::parse to refactor QXmppDataForm::parse
add Fileld::toXml to refactor QXmppDataForm::toXml
add Media::parse to refactor QXmppDataForm::parse
add Media::toXml to refactor QXmppDataForm::toXml
new feature :
add Item, reported class to achieve XEP-0004 3.4
unit test for XEP-0004 3.4 Multiple Items in Form Results