diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2020-07-15 04:22:48 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2020-07-15 04:22:48 +0900 |
commit | f16c17e7be7c25e3010dba79ccdbad8a1402e425 (patch) | |
tree | c2e05cba9812020acc9a303ea531a3e0cad81199 /qkbox | |
parent | 9835fef07c6e1318aad2c22e2f4f9c0234dbc9e9 (diff) |
qkbox: toot: Unuse define-public.
Diffstat (limited to 'qkbox')
-rw-r--r-- | qkbox/toot.scm | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/qkbox/toot.scm b/qkbox/toot.scm index 8f163c4..83c744e 100644 --- a/qkbox/toot.scm +++ b/qkbox/toot.scm @@ -59,12 +59,12 @@ (define (creation-time->string date) (date->string date "~4")) -(define*-public (post text - #:key - spoiler-text - visibility - sensitive? - reply-to) +(define* (post text + #:key + spoiler-text + visibility + sensitive? + reply-to) (receive (res body) (post-/api/v1/statuses #:status text #:spoiler-text spoiler-text @@ -172,7 +172,7 @@ (creation-time->string time)) (display-status (notification-status notification)))) -(define-public (status-public? status) +(define (status-public? status) (eq? 'public (status-visibility status))) (define (account-to-string account) @@ -182,12 +182,12 @@ (account-acct account) (account-id account))) -(define*-public (display-status status - #:key - (port (current-output-port)) - display-cw? - display-sensitive? - (display-id? #t)) +(define* (display-status status + #:key + (port (current-output-port)) + display-cw? + display-sensitive? + (display-id? #t)) (let ((status (or (status-reblog status) status)) (status/original status)) (let ((account (status-account status))) @@ -250,22 +250,22 @@ (scale status-pict 0.5))))) (else status-pict)))) -(define-public (status-id status) +(define (status-id status) (assoc-ref (status-json status) "id")) -(define-public (status-account status) +(define (status-account status) (make-account (assoc-ref (status-json status) "account"))) -(define-public (status-reblog status) +(define (status-reblog status) (let ((reblog/json (assoc-ref (status-json status) "reblog"))) (if (eq? reblog/json 'null) #f (make-status reblog/json)))) -(define-public (status-sensitive? status) +(define (status-sensitive? status) (assoc-ref (status-json status) "sensitive")) -(define-public (status-content status) +(define (status-content status) (assoc-ref (status-json status) "content")) (define (sanitize x) @@ -305,10 +305,10 @@ (append-map flatten x)) (else (list x)))) -(define-public (status-visibility status) +(define (status-visibility status) (string->symbol (assoc-ref (status-json status) "visibility"))) -(define-public (status-spoiler-text status) +(define (status-spoiler-text status) (let ((s (assoc-ref (status-json status) "spoiler_text"))) (if (zero? (string-length s)) #f @@ -325,7 +325,7 @@ "|") "):")) -(define-public (status-emojis status) +(define (status-emojis status) (map make-emoji (vector->list (assoc-ref (status-json status) "emojis")))) (define-record-type <attachment> @@ -349,7 +349,7 @@ (define (fetch-attachment-pict attachment) (fetch-pict (attachment-url attachment))) -(define-public (status-media-attachments status) +(define (status-media-attachments status) (let ((v (assoc-ref (status-json status) "media_attachments"))) (map make-attachment (vector->list v)))) @@ -416,19 +416,19 @@ (find (lambda (emoji) (equal? shortcode (emoji-shortcode emoji))) emojis)) -(define-public (account-id account) +(define (account-id account) (assoc-ref (account-json account) "id")) -(define-public (account-avatar-static account) +(define (account-avatar-static account) (assoc-ref (account-json account) "avatar_static")) -(define-public (account-acct account) +(define (account-acct account) (assoc-ref (account-json account) "acct")) -(define-public (account-display-name account) +(define (account-display-name account) (assoc-ref (account-json account) "display_name")) -(define-public (account-emojis account) +(define (account-emojis account) (map make-emoji (vector->list (assoc-ref (account-json account) "emojis")))) (define avatar-static-cache (make-hash-table)) @@ -480,7 +480,7 @@ (line 0 0 32 32 #:color "red") (line 0 32 32 0 #:color "red"))) -(define*-public (fetch-status id #:key (authorization? #t)) +(define* (fetch-status id #:key (authorization? #t)) (receive (res body) (get-/api/v1/statuses/:id id #:authorization? authorization?) (case (response-code res) @@ -494,7 +494,7 @@ (format #f "/api/v1/statuses/~a" id) #:authorization? authorization?)) -(define*-public (fetch-home-timeline #:key max-id since-id min-id limit local?) +(define* (fetch-home-timeline #:key max-id since-id min-id limit local?) (receive (res body) (get-/api/v1/timelines/home #:max-id max-id #:since-id since-id @@ -509,7 +509,7 @@ (else (error "fetch-home-timeline: failed" res body))))) -(define*-public (fetch-public-timeline #:key max-id since-id min-id limit local? remote? only-media?) +(define* (fetch-public-timeline #:key max-id since-id min-id limit local? remote? only-media?) (receive (res body) (get-/api/v1/timelines/public #:max-id max-id #:since-id since-id @@ -550,7 +550,7 @@ ,@(and/nil only-media? `((only_media . ,only-media?)))) #:authorization? #t)) -(define-public (favourite id) +(define (favourite id) (define-values (res body) (post-/api/v1/statuses/:id/favourite id)) (case (response-code res) @@ -564,7 +564,7 @@ (format #f "/api/v1/statuses/~a/favourite" id) #:authorization? #t)) -(define-public (unfavourite id) +(define (unfavourite id) (define-values (res body) (get-/api/v1/statuses/:id/unfavourite id)) (case (response-code res) @@ -578,7 +578,7 @@ (format #f "/api/v1/statuses/~a/unfavourite" id) #:authorization? #t)) -(define-public (reblog id) +(define (reblog id) (define-values (res body) (post-/api/v1/statuses/:id/reblog id)) (case (response-code res) @@ -592,7 +592,7 @@ (format #f "/api/v1/statuses/~a/reblog" id) #:authorization? #t)) -(define-public (unreblog id) +(define (unreblog id) (define-values (res body) (post-/api/v1/statuses/:id/unreblog id)) (case (response-code res) @@ -640,7 +640,7 @@ (values res (json-string->scm (utf8->string body))) (values res body)))) -(define*-public (fetch-account id) +(define* (fetch-account id) (receive (res body) (get-/api/v1/accounts/:id id) (case (response-code res) |