summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--granolin.asd11
-rw-r--r--granolin.lisp39
-rw-r--r--package.lisp4
3 files changed, 54 insertions, 0 deletions
diff --git a/granolin.asd b/granolin.asd
new file mode 100644
index 0000000..bdeac36
--- /dev/null
+++ b/granolin.asd
@@ -0,0 +1,11 @@
+;;;; granolin.asd
+
+(asdf:defsystem #:granolin
+ :description "Lisp learns how to spam Matrix servers."
+ :author "thegoofist@protonmail.com"
+ :license "AGPLv3.0"
+ :version "0.0.1"
+ :serial t
+ :depends-on (#:drakma #:jonathan)
+ :components ((:file "package")
+ (:file "granolin")))
diff --git a/granolin.lisp b/granolin.lisp
new file mode 100644
index 0000000..8179a66
--- /dev/null
+++ b/granolin.lisp
@@ -0,0 +1,39 @@
+
+;;;; granolin.lisp
+
+(in-package #:granolin)
+
+;;; Login https://matrix.org/docs/spec/client_server/r0.5.0#id242
+;;; Media Upload https://matrix.org/docs/spec/client_server/r0.5.0#post-matrix-media-r0-upload
+
+
+
+(defclass client ()
+ ((access-token
+ :reader login
+ :initarg :login
+ :initform (error "Clients need an access token."))
+ (homeserver
+ :reader homeserver
+ :initarg :homeserver
+ :initform (error "Clients require a homeserver."))
+ (rooms
+ :accessor rooms
+ :initform nil)
+ (users
+ :accessor users
+ :initform nil)))
+;;TODO add things like transaction ids and time points
+
+
+(defmethod initialize-instance :after ((client client) &key)
+ ;; fetch rooms
+ ;; fetch users
+ ;; fetch any other state that might be useful
+ )
+
+;;; Sending Room Messages
+(defgeneric send-message (client room msg)
+ (:documentation "Ends up sending an http request to the client's homeserver"))
+
+
diff --git a/package.lisp b/package.lisp
new file mode 100644
index 0000000..fce085a
--- /dev/null
+++ b/package.lisp
@@ -0,0 +1,4 @@
+;;;; package.lisp
+
+(defpackage #:granolin
+ (:use #:cl))