summaryrefslogtreecommitdiff
path: root/qkbox
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2020-07-14 05:20:08 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2020-07-14 05:20:18 +0900
commit9835fef07c6e1318aad2c22e2f4f9c0234dbc9e9 (patch)
tree63e339176e5d0eb2570cc58ffdfe26c02c74cb5a /qkbox
parent2fcc69933845adf50220051005729702ae8b0f67 (diff)
qkbox: toot: Rename procedures.
Diffstat (limited to 'qkbox')
-rw-r--r--qkbox/toot.scm32
1 files changed, 17 insertions, 15 deletions
diff --git a/qkbox/toot.scm b/qkbox/toot.scm
index aa8bd8f..8f163c4 100644
--- a/qkbox/toot.scm
+++ b/qkbox/toot.scm
@@ -552,13 +552,13 @@
(define-public (favourite id)
(define-values (res body)
- (get-/api/v1/statuses/:id/favourite id))
+ (post-/api/v1/statuses/:id/favourite id))
(case (response-code res)
((200) #t)
(else
(error "favourite: failed" res body))))
-(define (get-/api/v1/statuses/:id/favourite id)
+(define (post-/api/v1/statuses/:id/favourite id)
(request
'POST
(format #f "/api/v1/statuses/~a/favourite" id)
@@ -572,7 +572,7 @@
(else
(error "unfavourite: failed" res body))))
-(define (get-/api/v1/statuses/:id/unfavourite id)
+(define (post-/api/v1/statuses/:id/unfavourite id)
(request
'POST
(format #f "/api/v1/statuses/~a/unfavourite" id)
@@ -580,13 +580,13 @@
(define-public (reblog id)
(define-values (res body)
- (get-/api/v1/statuses/:id/reblog id))
+ (post-/api/v1/statuses/:id/reblog id))
(case (response-code res)
((200) #t)
(else
(error "reblog: failed" res body))))
-(define (get-/api/v1/statuses/:id/reblog id)
+(define (post-/api/v1/statuses/:id/reblog id)
(request
'POST
(format #f "/api/v1/statuses/~a/reblog" id)
@@ -594,13 +594,13 @@
(define-public (unreblog id)
(define-values (res body)
- (get-/api/v1/statuses/:id/unreblog id))
+ (post-/api/v1/statuses/:id/unreblog id))
(case (response-code res)
((200) #t)
(else
(error "unreblog: failed" res body))))
-(define (get-/api/v1/statuses/:id/unreblog id)
+(define (post-/api/v1/statuses/:id/unreblog id)
(request
'POST
(format #f "/api/v1/statuses/~a/unreblog" id)
@@ -711,14 +711,14 @@
(define* (streaming-public handler #:key only-media?)
(streaming (if only-media?
- get-/api/v1/streaming/public
- get-/api/v1/streaming/public?only_media=true)
+ get-/api/v1/streaming/public?only_media=true
+ get-/api/v1/streaming/public)
handler))
(define* (streaming-local handler #:key only-media?)
(streaming (if only-media?
- get-/api/v1/streaming/local
- get-/api/v1/streaming/local?only_media=true)
+ get-/api/v1/streaming/local?only_media=true
+ get-/api/v1/streaming/local)
handler))
(define (streaming-hashtag hashtag handler)
@@ -759,16 +759,18 @@
((update)
(handler event
(make-status
- (json-string->scm data))))
+ (json-string->scm data)))
+ (loop #f))
((delete)
(handler event data))
((notification)
(handler event
(make-notification
- (json-string->scm data))))
+ (json-string->scm data)))
+ (loop #f))
(else
- (handler event data)))
- (loop #f))
+ (handler event data)
+ (loop #f))))
(else
(format #t "[DEBUG] ~a: ~a" event data)
(loop #f))))))