Changeset 14671 in project


Ignore:
Timestamp:
05/17/09 12:44:53 (10 years ago)
Author:
azul
Message:
  1. Move 'stream-string-max' to svnwiki-extensions as 'svnwiki-stream-cut-with-ellipsis'. 2. Don't show a 'Subscribe' link in tag pages.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/svnwiki-mail/trunk/svnwiki-mail.scm

    r12877 r14671  
    88(define (mail-subscribe-link env)
    99  (let-from-environment env (path-in path)
    10     (svnwiki-file-action-link
    11       env
    12       (format #f "~A~A?action=extension&extension=mail&request=subscribeform"
    13               (get-props-parents-first "svnwiki:application-url" path-in path)
    14               path)
    15       "Subscribe")))
     10    (unless (string=? path "xsvnwiki-tags")
     11      (svnwiki-file-action-link
     12        env
     13        (format #f "~A~A?action=extension&extension=mail&request=subscribeform"
     14                (get-props-parents-first "svnwiki:application-url" path-in path)
     15                path)
     16        "Subscribe"))))
    1617
    1718(define (mail-request-handle env)
     
    805806        (format (current-error-port) "Notifications sent~%")))))
    806807
    807 (define (stream-string-max str len)
    808   (assert (stream? str))
    809   (if (stream-length>= str (+ len 1))
    810     (stream-append
    811       (stream-take str (- len 3))
    812       (string->stream "..."))
    813     str))
    814 
    815 (define (stream-string-max-test str)
    816   (stream->string (stream-string-max (string->stream str) 10)))
    817 
    818 (test-group stream-string-max
    819   (test (stream-string-max-test "") "")
    820   (test (stream-string-max-test "foobar") "foobar")
    821   (test (stream-string-max-test "012345678") "012345678")
    822   (test (stream-string-max-test "0123456789") "0123456789")
    823   (test (stream-string-max-test "01234567890") "0123456..."))
    824 
    825808; type is either 'add, 'modify or 'delete.
    826809
     
    912895              (changed-file-revision rev)
    913896              ; TODO: quoted-printable, instead of iconv above
    914               (stream->string (stream-string-max description 60))))
     897              (stream->string (svnwiki-stream-cut-with-ellipsis description 60))))
    915898      (format #t "To: ~A~%" address)
    916899      (format #t "From: ~A~%" (make-mail-gateway-address env "xsvnwiki-mail/notifications/"))
Note: See TracChangeset for help on using the changeset viewer.