-
lovetox
flow, i think the reason against text-multi was that most librarys would join all values of a text-multi field
-
lovetox
and not pass them as a list of text values
-
lovetox
XEP-0004: ... Similarly, an application that receives multiple <value/> elements for a field of type "text-multi" SHOULD merge the XML character data of the value elements into one text block for presentation to a user, with each string separated by a newline character as appropriate for that platform.
-
lovetox
and thats also what i would want from a xmpp lib, pass me one text string
-
lovetox
its not hard to do a split(\n) afterwards of course
-
lovetox
but not sure if this is more elegant than the <open> solution
-
flow
lovetox, i am not sure if it is sensible for libraries to loose the "this are single values" information by joining the values together
-
flow
I think the text is more meant for the higher layers, hence the "for presentation to a user" part
-
flow
surely otherwise the usage of text-multi in pubsub would be problematic for users of libraries which do not expose those indivdual values at their interface
-
lovetox
so what does smacks?
-
flow
well, smack keeps the individual values
-
flow
just as it does for jid-multi
-
flow
or, fwiw, list-multi
-
lovetox
yeah but you cant compare them really
-
flow
why should a library suddenly handle, or especially implement, text-multi in a different way than the other *-multi
-
flow
why shouldn't I be able to compare different types of form fields?
-
lovetox
ok other question, if i set a text-multi field in smacks
-
lovetox
do i have to pass a list of values?
-
flow
no, there is addValue(CharSequence) and addValues(List<? extends CharSequence)
-
flow
but all those append to the list of values
-
lovetox
from an application developer standpoint, its not evident why i should split up a string on \n to send it over the wire
-
lovetox
i want to pass a string to the lib and it should send it
-
flow
right, but this is not related to the question
-
lovetox
and on the other side i want my string out
-
lovetox
i dont care about xmpp breaking up on \n and send it as multiple values
-
flow
ahh, I guess the reason is newline portability
-
lovetox
to use your lib, i have to understand XEP-0004, or you write a really good documentation where you tell me i have to join the string afterwards
-
flow
so that could be the reason xep4 talks about "newline character as appropriate for that platform"
-
lovetox
and at that point i seriously ask myself, why doesnt do smacks that
-
flow
well it is a bit trickier
-
flow
if the user ad addValue(CharSequence) with a CharSequence containing a '\n', shall I split it? or does the user want to send it as single value verbatim
-
flow
but again, this is nothing which prevents us from using text-multi in mam
-
lovetox
nobody said it prevents it
-
lovetox
i told you what i heard when they discussed it
-
lovetox
and that was one of the things i heard
-
flow
so that is what I am interested at most right now, but I am also happy to discuss the text-multi newline UI situation if you want
-
lovetox
maybe there are others, but from what i remember it was not a very drawn out decision process
-
lovetox
no actually i dont care about that topic, i just wanted to forward my information
-
lovetox
im sure MattJ is interested
-
flow
but that is also pretty simple: the authors of xep4 basically had two choices: either normalize newline before it is put on the wire, or resort to what they did and split newlines into separte values (if the data is meant for user presentation)
-
flow
I actually think I would have gone for the "normalize newline" thing, but this is what we have right now
-
lovetox
i never have that problem
-
lovetox
in my gui framework there is no thing as platform specific newlines
-
lovetox
if i do a \n in a textview
-
lovetox
its a newline, on windows and on linux
-
flow
yeah, it was probably a different world when xep4 was written
-
lovetox
its probably a problem if i would save the value to a textfile, which is opend by other apps maybe
-
MattJ
IMHO an XMPP library should abstract XMPP, and application devs shouldn't need to be familiar with the representation of multiline strings on the wire
-
MattJ
Therefore it is entirely reasonable for a library with a dataforms API to perform the newline splitting/joining itself