Diff
Not logged in

Differences From:

File src/timeline.c part of check-in [20553a420c] - Patch problems with timeline. Need to rethink the whole implementation. by drh on 2007-12-03 00:27:15. [view]

To:

File src/timeline.c part of check-in [ebb2765954] - Add the timeline display preferences page with the ability to turn on and off block markup in timeline comments and to limit the length of timeline comments. by drh on 2007-12-04 02:47:49. Also file src/timeline.c part of check-in [d0305b305a] - Merged mainline into my branch to get the newest application. by aku on 2007-12-05 08:07:46. [view]

@@ -97,11 +97,20 @@
   int (*xCallback)(int, Blob*),
   Blob *pArg
  ){
   int cnt = 0;
+  int wikiFlags;
+  int mxWikiLen;
   Blob comment;
   char zPrevDate[20];
   zPrevDate[0] = 0;
+
+  mxWikiLen = db_get_int("timeline-max-comment", 0);
+  if( db_get_boolean("timeline-block-markup", 0) ){
+    wikiFlags = WIKI_INLINE;
+  }else{
+    wikiFlags = WIKI_INLINE | WIKI_NOBLOCK;
+  }
 
   db_multi_exec(
      "CREATE TEMP TABLE IF NOT EXISTS seen(rid INTEGER PRIMARY KEY);"
      "DELETE FROM seen;"
@@ -158,17 +167,17 @@
     }else{
       hyperlink_to_uuid(zUuid);
     }
     db_column_blob(pQuery, 3, &comment);
-    if( blob_size(&comment)>200 ){
+    if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
       Blob truncated;
       blob_zero(&truncated);
-      blob_append(&truncated, blob_buffer(&comment), 200);
+      blob_append(&truncated, blob_buffer(&comment), mxWikiLen);
       blob_append(&truncated, "...", 3);
-      wiki_convert(&truncated, 0, WIKI_INLINE);
+      wiki_convert(&truncated, 0, wikiFlags);
       blob_reset(&truncated);
     }else{
-      wiki_convert(&comment, 0, WIKI_INLINE);
+      wiki_convert(&comment, 0, wikiFlags);
     }
     blob_reset(&comment);
     @ (by %h(zUser))</td></tr>
   }