summaryrefslogtreecommitdiff
path: root/utils.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'utils.lisp')
-rw-r--r--utils.lisp7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils.lisp b/utils.lisp
index 691685f..d0dfbd0 100644
--- a/utils.lisp
+++ b/utils.lisp
@@ -2,3 +2,10 @@
(defun string->json-key (s)
(read-from-string (format nil ":|~a|" s)))
+
+(defun readable-username (s)
+ (let ((stop-index (search ":" s)))
+ (if (and stop-index
+ (equal #\@ (aref s 0)))
+ (subseq s 1 stop-index)
+ s)))