summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <cbeok@protonmail.com>2020-04-18 09:54:58 -0500
committerColin Okay <cbeok@protonmail.com>2020-04-18 09:54:58 -0500
commitfef34faeaeadb36c0353ee80c70866810d1ce28e (patch)
treea1abf29c9110ec1ab37b96030fc6a0088fe4d062
parent9df0939d0fc02318905d3c67c589aece8481a6b3 (diff)
added im-the-sender-p
-rw-r--r--granolin.lisp6
-rw-r--r--package.lisp3
2 files changed, 9 insertions, 0 deletions
diff --git a/granolin.lisp b/granolin.lisp
index f1ce5c3..a5a1e66 100644
--- a/granolin.lisp
+++ b/granolin.lisp
@@ -199,6 +199,12 @@
;; the basic-json struct is used as a kind of default in some places
(def-json-wrap basic-json)
+
+;;; Event Utility Functions
+(defun im-the-sender-p (client event)
+ (equal (user-id client)
+ (sender event)))
+
;;; URI constants (format) strings for interacting with the Matrix API
(defparameter +login-path+ "/_matrix/client/r0/login")
diff --git a/package.lisp b/package.lisp
index 7d6664c..b3f18b9 100644
--- a/package.lisp
+++ b/package.lisp
@@ -70,6 +70,9 @@
#:room-state-event
#:invitation-event
+ ;; event utils
+ #:im-the-sender-p
+
;; generic response types
#:basic-json