Fossil SCM
/json/wiki: s/contentLength/size/ and s/lastSavedBy/user/, for consistency. Interface-incompatible change.
Commit
c78773b2fdbdc7b9258269d8d788f41d2453833e
Parent
8f496ed159976bd…
1 file changed
+4
-4
+4
-4
| --- src/json_wiki.c | ||
| +++ src/json_wiki.c | ||
| @@ -99,15 +99,15 @@ | ||
| 99 | 99 | cson_object_set( pay, "parent", json_new_string(pWiki->azParent[0]) ) |
| 100 | 100 | /* Reminder: wiki pages do not branch and have only one parent |
| 101 | 101 | (except for the initial version, which has no parents). */; |
| 102 | 102 | } |
| 103 | 103 | /*cson_object_set(pay,"rid",json_new_int((cson_int_t)rid));*/ |
| 104 | - cson_object_set(pay,"lastSavedBy",json_new_string(pWiki->zUser)); | |
| 104 | + cson_object_set(pay,"user",json_new_string(pWiki->zUser)); | |
| 105 | 105 | cson_object_set(pay,FossilJsonKeys.timestamp, |
| 106 | 106 | json_julian_to_timestamp(pWiki->rDate)); |
| 107 | 107 | if(0 == contentFormat){ |
| 108 | - cson_object_set(pay,"contentLength", | |
| 108 | + cson_object_set(pay,"size", | |
| 109 | 109 | json_new_int((cson_int_t)(zBody?strlen(zBody):0))); |
| 110 | 110 | }else{ |
| 111 | 111 | if( contentFormat>0 ){/*HTML-ize it*/ |
| 112 | 112 | zFormat = "html"; |
| 113 | 113 | Blob content = empty_blob; |
| @@ -115,19 +115,19 @@ | ||
| 115 | 115 | if(zBody && *zBody){ |
| 116 | 116 | blob_append(&raw,zBody,-1); |
| 117 | 117 | wiki_convert(&raw,&content,0); |
| 118 | 118 | len = (unsigned int)blob_size(&content); |
| 119 | 119 | } |
| 120 | - cson_object_set(pay,"contentLength",json_new_int((cson_int_t)len)); | |
| 120 | + cson_object_set(pay,"size",json_new_int((cson_int_t)len)); | |
| 121 | 121 | cson_object_set(pay,"content", |
| 122 | 122 | cson_value_new_string(blob_buffer(&content),len)); |
| 123 | 123 | blob_reset(&content); |
| 124 | 124 | blob_reset(&raw); |
| 125 | 125 | }else{/*raw format*/ |
| 126 | 126 | zFormat = "raw"; |
| 127 | 127 | len = zBody ? strlen(zBody) : 0; |
| 128 | - cson_object_set(pay,"contentLength",json_new_int((cson_int_t)len)); | |
| 128 | + cson_object_set(pay,"size",json_new_int((cson_int_t)len)); | |
| 129 | 129 | cson_object_set(pay,"content",cson_value_new_string(zBody,len)); |
| 130 | 130 | } |
| 131 | 131 | cson_object_set(pay,"contentFormat",json_new_string(zFormat)); |
| 132 | 132 | |
| 133 | 133 | } |
| 134 | 134 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -99,15 +99,15 @@ | |
| 99 | cson_object_set( pay, "parent", json_new_string(pWiki->azParent[0]) ) |
| 100 | /* Reminder: wiki pages do not branch and have only one parent |
| 101 | (except for the initial version, which has no parents). */; |
| 102 | } |
| 103 | /*cson_object_set(pay,"rid",json_new_int((cson_int_t)rid));*/ |
| 104 | cson_object_set(pay,"lastSavedBy",json_new_string(pWiki->zUser)); |
| 105 | cson_object_set(pay,FossilJsonKeys.timestamp, |
| 106 | json_julian_to_timestamp(pWiki->rDate)); |
| 107 | if(0 == contentFormat){ |
| 108 | cson_object_set(pay,"contentLength", |
| 109 | json_new_int((cson_int_t)(zBody?strlen(zBody):0))); |
| 110 | }else{ |
| 111 | if( contentFormat>0 ){/*HTML-ize it*/ |
| 112 | zFormat = "html"; |
| 113 | Blob content = empty_blob; |
| @@ -115,19 +115,19 @@ | |
| 115 | if(zBody && *zBody){ |
| 116 | blob_append(&raw,zBody,-1); |
| 117 | wiki_convert(&raw,&content,0); |
| 118 | len = (unsigned int)blob_size(&content); |
| 119 | } |
| 120 | cson_object_set(pay,"contentLength",json_new_int((cson_int_t)len)); |
| 121 | cson_object_set(pay,"content", |
| 122 | cson_value_new_string(blob_buffer(&content),len)); |
| 123 | blob_reset(&content); |
| 124 | blob_reset(&raw); |
| 125 | }else{/*raw format*/ |
| 126 | zFormat = "raw"; |
| 127 | len = zBody ? strlen(zBody) : 0; |
| 128 | cson_object_set(pay,"contentLength",json_new_int((cson_int_t)len)); |
| 129 | cson_object_set(pay,"content",cson_value_new_string(zBody,len)); |
| 130 | } |
| 131 | cson_object_set(pay,"contentFormat",json_new_string(zFormat)); |
| 132 | |
| 133 | } |
| 134 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -99,15 +99,15 @@ | |
| 99 | cson_object_set( pay, "parent", json_new_string(pWiki->azParent[0]) ) |
| 100 | /* Reminder: wiki pages do not branch and have only one parent |
| 101 | (except for the initial version, which has no parents). */; |
| 102 | } |
| 103 | /*cson_object_set(pay,"rid",json_new_int((cson_int_t)rid));*/ |
| 104 | cson_object_set(pay,"user",json_new_string(pWiki->zUser)); |
| 105 | cson_object_set(pay,FossilJsonKeys.timestamp, |
| 106 | json_julian_to_timestamp(pWiki->rDate)); |
| 107 | if(0 == contentFormat){ |
| 108 | cson_object_set(pay,"size", |
| 109 | json_new_int((cson_int_t)(zBody?strlen(zBody):0))); |
| 110 | }else{ |
| 111 | if( contentFormat>0 ){/*HTML-ize it*/ |
| 112 | zFormat = "html"; |
| 113 | Blob content = empty_blob; |
| @@ -115,19 +115,19 @@ | |
| 115 | if(zBody && *zBody){ |
| 116 | blob_append(&raw,zBody,-1); |
| 117 | wiki_convert(&raw,&content,0); |
| 118 | len = (unsigned int)blob_size(&content); |
| 119 | } |
| 120 | cson_object_set(pay,"size",json_new_int((cson_int_t)len)); |
| 121 | cson_object_set(pay,"content", |
| 122 | cson_value_new_string(blob_buffer(&content),len)); |
| 123 | blob_reset(&content); |
| 124 | blob_reset(&raw); |
| 125 | }else{/*raw format*/ |
| 126 | zFormat = "raw"; |
| 127 | len = zBody ? strlen(zBody) : 0; |
| 128 | cson_object_set(pay,"size",json_new_int((cson_int_t)len)); |
| 129 | cson_object_set(pay,"content",cson_value_new_string(zBody,len)); |
| 130 | } |
| 131 | cson_object_set(pay,"contentFormat",json_new_string(zFormat)); |
| 132 | |
| 133 | } |
| 134 |