XSF Discussion - 2017-11-11


  1. SamWhited

    Guus, Ge0rG: I tried to address some of your feedback as well as make the text clearer in places: https://github.com/xsf/xeps/pull/540/files

  2. Guus

    SamWhited: would it make sense to update the "last updated" timestamp? I was refreshing my page, waiting for the build to succeed by looking at that date...

  3. Ge0rG

    Wow, so much constructive feedback on a Friday night. Breaking the problem space into pieces really pays off :)

  4. Kev

    Ge0rG: Thought it might :)

  5. Ge0rG

    Kev: thanks for making me do it :)

  6. SamWhited

    Guus: oops, sorry, I haven't been pushing versions.

  7. Guus

    SamWhited: no worries. Perhaps something that could be automated?

  8. SamWhited

    Guus: I don't think it's really necessary in this case; generally I just ask authors to update it when they make a PR. I just didn't do it for this because it gets reset to 0.1 when accepted anyways and the old ones would go away

  9. Guus

    Oh, I was referring to the datestamp on top, not then version number

  10. SamWhited

    oh, my mistake

  11. SamWhited

    they're the same thing though

  12. SamWhited

    that's pulled from the last revision block, IIRC

  13. Guus

    jabber.org's cert expired 4 hours ago

  14. Guus

    is that iteam's server to manage?

  15. ralphm

    Guus: no. The jabber.org server is not an XSF activity. That said. There is an overlap between the people running that server and iteam

  16. ralphm

    I'll nudge Edwin

  17. Guus

    thanks

  18. Guus

    Hurgh. Finally implemented most of Message Styling, SamWhited - what a drag :(

  19. Guus

    didn't do the nesting

  20. Guus

    I'm still in the opinion that the amount of complexity in the XEP doesn't warrant the benefits. I expect that a good deal of devs will only do the easy bits, or will do the non-easy-bits wrong.

  21. Guus

    I'd drop the recursion/nesting, and potentially all block definitions completely.

  22. Guus

    _that said_: *yey styles!*

  23. Guus

    (the other way around - the benefits don't warrant the complexity - but you got what I ment)

  24. daniel

    Guus: complexity? My parser (including blocks and nesting) is less than 50 lines

  25. daniel

    And that's Java with all its boilerplate

  26. zinid

    how do you tolerate java btw? the boilerplate is so annoying, I can't stand it

  27. Ge0rG

    daniel: is it easily exportable into other Android projects? 😁

  28. daniel

    Ge0rG, i've been meaning to put this into an actual library. but you could already copy paste two class files and then have a static StylingHelper.style(Editable editable)

  29. daniel

    https://github.com/siacs/Conversations/blob/master/src/main/java/eu/siacs/conversations/utils/StylingHelper.java

  30. zinid

    public static void (c)

  31. daniel

    zinid, it's actually gotten a lot better with Java 8 (which you cant use on Android but i use that for my other projects)

  32. daniel

    plus IDE takes a lot of the pain away

  33. zinid

    I need to look at it then, I have heard java 8 has some improvements

  34. Ge0rG

    daniel: great! But please make it a library... I always wanted to have one that would convert xhtml-im into Android Spannable, but I suppose I can give up hope now

  35. daniel

    yeah i like it a lot. even my seeminly small tools like the complinace tester or the uptime monitor (status.conversations.im) are java 8

  36. daniel

    i very rarely use so called scripting languages

  37. zinid too, I use ocaml for scripting :D

  38. moparisthebest

    zinid: can confirm Java 8 makes a huge difference

  39. SamWhited

    That bad? How did you implement it? I just recursed into the blocks and it was fairly easy

  40. SamWhited

    /cc Guus

  41. Guus

    SamWhited: You just used the words 'recurse' and 'simple' in one sentence.

  42. SamWhited

    What? It made it very simple

  43. SamWhited

    It meant I didn't have to special case the stuff inside blocks, just call the parse function again

  44. Guus

    Recursion is inherently complex. Not MUC complex, but a lot more complex than should be needed to print a couple of words in a bold font.

  45. Ge0rG

    I wonder how many levels of recursion one can get into a single message

  46. Zash

    What stack size limits do you have?

  47. daniel

    Ge0rG, not that many actually. because limited keywords

  48. SamWhited

    I didn't bother setting one, the stack is cheap so if you want to send: > >> >>> >>>> Up to the limit your server allows for body size then be my guest

  49. Ge0rG

    daniel: only if you prevent recusing into a keyword type that's already on the stack

  50. daniel

    i mean you couldn't just write *_*_*test*_*_*

  51. daniel

    thats invalid syntax

  52. SamWhited

    Oh, I didn't do recursion inside spans, that was simpler

  53. Ge0rG

    You could add letters and whitespace?

  54. Zash

    What, can't have bold */and/* italics?!

  55. daniel

    Ge0rG, true

  56. SamWhited

    Zash: that should work

  57. Guus

    If you'd use underscores instead of slashes.

  58. Ge0rG

    SamWhited: without recursion?

  59. Guus

    Bold *_and_* italics.

  60. SamWhited

    Ge0rG: yes, I think so. Let me clean this up and push it

  61. daniel

    or maybe not. i'm confused

  62. Guus

    Daniel, I think that there's a small omission in the preformatted block ending in Conversations

  63. daniel

    Guus:?

  64. Guus

    it appears to end on any occurrance of ```, instead of on a line that only contains ```.

  65. Guus

    This should not be monospaced. ``` if ( foo.equals( "```" ) ) { // This should be monospaced (but is not in Conversations) } ``` again, no longer monospaced.

  66. Guus

    ah, I see that the same applies to the start

  67. daniel

    Yes I think that got changed recently in the xep, right? I didn't follow your discussion yesterday

  68. Guus

    not sure, only worked on that today :)

  69. SamWhited

    Yah, I just tried to clarify that block, I think it makes it a little easier if you can just scan line by line.

  70. Guus

    but it stands to reason that ```this should not be monospaced``` (although `this` should).

  71. SamWhited

    The way I wrote my version having the ``` (which is the start of a block) inline means blocks overlap though, which ends up being way more complicated

  72. SamWhited

    but I could go either way

  73. daniel

    Fwiw in whatsapp triple back ticks don't need to be in their own line

  74. daniel

    Haven't check slack yet

  75. Guus shurgs and mutters something about disliking code blocks in IM in the first place

  76. Guus

    I'll go do my grumpy old man routine in front of the tv. Will lurk on mobile for a bit.

  77. SamWhited really likes pasting code blocks at work

  78. daniel

    I don't really care. It's a simple fix in my parser to only allow it when it starts with a \n

  79. SamWhited

    but could go either way

  80. Zash

    I usually just pastebin stuff I want to show

  81. Zash

    Spoiled by mod_pastebin mayhaps

  82. daniel

    how does the ignoring part go along with the first section where it says that keywords should stay in there?

  83. Flow

    Are, and if, how are, new lines defined in <body/>/XMPP?

  84. SamWhited

    daniel: good point; maybe I should change that to read "it's part of the keyword, not the preformatted block"

  85. SamWhited

    Flow: \n

  86. Flow

    SamWhited, great, where is that specified?

  87. SamWhited

    Flow: I don't follow, that's just a newline… I didn't mean literally typing \\n

  88. Flow

    Well strictly speaking \n is just a line feed

  89. SamWhited

    Oh I see, are you worried about people sending \r\n?

  90. SamWhited

    I have no idea if or where that's specified

  91. Flow

    Even more worse, a line break convention that doesn't end with \n

  92. SamWhited

    I wouldn't worry about it too much.

  93. SamWhited

    Maybe XML specifies a line ending to use? I have no idea. As far as styling is concerned that's deliberately handwavey though.

  94. Flow

    Well if we don't have it specified, and if a XEP speaks of newlines, then it should be specified to be sound

  95. Zash

    I wouldn't count on \r\n surviving exactly like that all the way across the XMPPnet

  96. SamWhited

    My XML decoder appears to normalize to \n

  97. Flow

    Zash, within <body/>? Any sane XML parser would not touch element text.

  98. SamWhited

    Changing everything to \n seems perfectly sane to me

  99. SamWhited

    But I'm still not sure if everything does that, maybe that's just this one

  100. ralphm

    https://www.w3.org/TR/REC-xml/#sec-line-ends

  101. Zash

    IIRC we looked at having Prosody preserve all kinds of whitespace, and everything broke.

  102. SamWhited

    Thanks ralphm

  103. SamWhited

    There we go then. That explains why this has never been an issue in any XMPP clients I've ever used.

  104. Flow

    "MUST behave as if". I wonder what that is supposed to mean. But yes, looks like that any sane XML parser is supposed to normalize line endings to \n. XML 1.1. converts even more to \n

  105. Zash

    There was something that at least Prosody did to whitespace in some places. Maybe attributes? I forget.

  106. Flow

    Zash, maybe the whitespace between attributes?

  107. Zash

    Yes but no, that's not what we were looking at.

  108. Zash

    https://hg.prosody.im/trunk/rev/6e67c73f730c https://hg.prosody.im/trunk/rev/9030b056bd4a

  109. Zash

    https://www.w3.org/TR/REC-xml/#AVNormalize

  110. ralphm

    Well, XML 1.1 is much too newfangled for XMPP.