summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <cbeok@protonmail.com>2020-04-18 08:40:08 -0500
committerColin Okay <cbeok@protonmail.com>2020-04-18 08:40:08 -0500
commit9df0939d0fc02318905d3c67c589aece8481a6b3 (patch)
tree2d87cd2dea6c7a3d24bb33cf2be563ea8994b4c6
parent57551ab436677d4a8560e840629db43b2cc2e02c (diff)
utf-8 external format in send and sync messages
-rw-r--r--granolin.lisp12
1 files changed, 8 insertions, 4 deletions
diff --git a/granolin.lisp b/granolin.lisp
index 4a9c7cf..f1ce5c3 100644
--- a/granolin.lisp
+++ b/granolin.lisp
@@ -254,7 +254,9 @@
:additional-headers (add-auth-header ,client ,headers)
:method ,method
:content ,content
- :content-type ,content-type)
+ :content-type ,content-type
+ :external-format-out :utf-8
+ :external-format-in :utf-8)
(if (= 200 *response-status*)
(let ((*response-object*
(,wrap
@@ -279,7 +281,9 @@
(drakma:http-request (make-matrix-path ,client ,path)
:additional-headers (add-auth-header ,client ,headers)
:parameters ,params
- :method :get)
+ :method :get
+ :external-format-out :utf-8
+ :external-format-in :utf-8)
(if (= 200 *response-status*)
(let ((*response-object*
(,wrap
@@ -295,7 +299,7 @@
;;; API Calls
-(defun login (client user password)
+(defun login (client user password &key (device-name "Granolin"))
"Logs CLIENT into its HOMESERVER withthe provided USER and PASSWORD.
If successful, sets the ACCESS-TOKEN of the CLIENT. Otherwise raises an
@@ -304,7 +308,7 @@
:|identifier| (list :|type| "m.id.user"
:|user| user)
:|password| password
- :|initial_device_display_name| "Granolin")))
+ :|initial_device_display_name| device-name)))
(send (client +login-path+ body
:method :post