XSF Discussion - 2020-05-02

  1. lovetox

    flow, i think the reason against text-multi was that most librarys would join all values of a text-multi field

  2. lovetox

    and not pass them as a list of text values

  3. 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.

  4. lovetox

    and thats also what i would want from a xmpp lib, pass me one text string

  5. lovetox

    its not hard to do a split(\n) afterwards of course

  6. lovetox

    but not sure if this is more elegant than the <open> solution

  7. 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

  8. flow

    I think the text is more meant for the higher layers, hence the "for presentation to a user" part

  9. 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

  10. lovetox

    so what does smacks?

  11. flow

    well, smack keeps the individual values

  12. flow

    just as it does for jid-multi

  13. flow

    or, fwiw, list-multi

  14. lovetox

    yeah but you cant compare them really

  15. flow

    why should a library suddenly handle, or especially implement, text-multi in a different way than the other *-multi

  16. flow

    why shouldn't I be able to compare different types of form fields?

  17. lovetox

    ok other question, if i set a text-multi field in smacks

  18. lovetox

    do i have to pass a list of values?

  19. flow

    no, there is addValue(CharSequence) and addValues(List<? extends CharSequence)

  20. flow

    but all those append to the list of values

  21. lovetox

    from an application developer standpoint, its not evident why i should split up a string on \n to send it over the wire

  22. lovetox

    i want to pass a string to the lib and it should send it

  23. flow

    right, but this is not related to the question

  24. lovetox

    and on the other side i want my string out

  25. lovetox

    i dont care about xmpp breaking up on \n and send it as multiple values

  26. flow

    ahh, I guess the reason is newline portability

  27. 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

  28. flow

    so that could be the reason xep4 talks about "newline character as appropriate for that platform"

  29. lovetox

    and at that point i seriously ask myself, why doesnt do smacks that

  30. flow

    well it is a bit trickier

  31. 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

  32. flow

    but again, this is nothing which prevents us from using text-multi in mam

  33. lovetox

    nobody said it prevents it

  34. lovetox

    i told you what i heard when they discussed it

  35. lovetox

    and that was one of the things i heard

  36. 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

  37. lovetox

    maybe there are others, but from what i remember it was not a very drawn out decision process

  38. lovetox

    no actually i dont care about that topic, i just wanted to forward my information

  39. lovetox

    im sure MattJ is interested

  40. 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)

  41. flow

    I actually think I would have gone for the "normalize newline" thing, but this is what we have right now

  42. lovetox

    i never have that problem

  43. lovetox

    in my gui framework there is no thing as platform specific newlines

  44. lovetox

    if i do a \n in a textview

  45. lovetox

    its a newline, on windows and on linux

  46. flow

    yeah, it was probably a different world when xep4 was written

  47. lovetox

    its probably a problem if i would save the value to a textfile, which is opend by other apps maybe

  48. 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

  49. MattJ

    Therefore it is entirely reasonable for a library with a dataforms API to perform the newline splitting/joining itself