Fix sub-comments OCS generation
Closed, ResolvedPublic

Description

Currently, export of comments through OCS is not done quite right, and subcomments lack their <comment></comment> wrap tag. An example of the issue can be seen here, and looks as below:

<ocs>
<meta>
<status>ok</status>
<statuscode>100</statuscode>
<message/>
</meta>
<data>
<comment>
<id>1470458</id>
<subject/>
<text>
+Wonderful! Love the Green focus color! Thank you so much!
</text>
<childcount>1</childcount>
<user>Trinity</user>
<date>2019-04-21T16:54:21+00:00</date>
<score>0</score>
<children>
<id>1470485</id>
<subject/>
<text>Thank You, Trinity!</text>
<childcount>0</childcount>
<user>l4k1</user>
<date>2019-04-22T02:46:35+00:00</date>
<score>0</score>
</children>
</comment>
<comment>
<id>1470405</id>
<subject/>
<text>+</text>
<childcount>1</childcount>
<user>charlie-henson</user>
<date>2019-04-21T01:34:10+00:00</date>
<score>0</score>
<children>
<id>1470411</id>
<subject/>
<text>Thank You, Charlie! </text>
<childcount>0</childcount>
<user>l4k1</user>
<date>2019-04-21T02:13:02+00:00</date>
<score>0</score>
</children>
</comment>
<comment>
<id>1470360</id>
<subject/>
<text>+</text>
<childcount>1</childcount>
<user>qajqii</user>
<date>2019-04-20T09:59:55+00:00</date>
<score>0</score>
<children>
<id>1470363</id>
<subject/>
<text>Thank You, qajqii !</text>
<childcount>0</childcount>
<user>l4k1</user>
<date>2019-04-20T11:36:30+00:00</date>
<score>0</score>
</children>
</comment>
</data>
</ocs>

As visible above, the children are simply output in a <children> tag, which will fail to be read by e.g. Attica, which expects each child to be a fully formed comment.

(also sorry for not opening an actual task and just sending you a message about it, this should be a bit easier to track, i hope ;) )

leinir created this task.Jun 21 2019, 10:16 AM

The issue is fixed now:

<ocs>
<meta>
<status>ok</status>
<statuscode>100</statuscode>
<message></message>
</meta>
<data>
<comment>
<id>1475836</id>
<subject></subject>
<text>10 the best</text>
<childcount>1</childcount>
<user>freefreeno</user>
<date>2019-06-20T20:44:27+00:00</date>
<score>0</score>
<children>
<comment>
<id>1475954</id>
<subject>
</subject>
<text>Thank You! </text>
<childcount>0</childcount>
<user>l4k1</user>
<date>2019-06-21T04:53:04+00:00</date>
<score>0</score>
</comment>
</children>
</comment>
</data>
<data>
<comment>
<id>1470458</id>
<subject></subject>
<text>+Wonderful! Love the Green focus color! Thank you so much!</text>
<childcount>1</childcount>
<user>Trinity</user>
<date>2019-04-21T16:54:21+00:00</date>
<score>0</score>
<children>
<comment>
<id>1470485</id>
<subject></subject>
<text>Thank You, Trinity!</text>
<childcount>0</childcount>
<user>l4k1</user>
<date>2019-04-22T02:46:35+00:00</date>
<score>0</score>
</comment>
</children>
</comment>
</data>
<data>
<comment>
<id>1470360</id>
<subject></subject>
<text>+</text>
<childcount>1</childcount>
<user>qajqii</user>
<date>2019-04-20T09:59:55+00:00</date>
<score>0</score>
<children>
<comment>
<id>1470363</id>
<subject></subject>
<text>Thank You, qajqii !</text>
<childcount>0</childcount>
<user>l4k1</user>
<date>2019-04-20T11:36:30+00:00</date>
<score>0</score>
</comment>
</children>
</comment>
</data>
</ocs>
ronaldv moved this task from To Do to Needs Review on the KDE Store board.Jun 28 2019, 10:08 AM

Awesomesauce, thank you :D Currently poking about with some of the guts in the client, but i shall test it out asap and report back, but the output data looks good!

leinir closed this task as Resolved.Jun 28 2019, 1:46 PM

i can confirm that it is now indeed working as expected, thank you very much! :)

leinir moved this task from Needs Review to Done on the KDE Store board.Jun 28 2019, 1:47 PM