diff options
| author | Sacha Chua <sacha@sachachua.com> | 2026-10-25 20:25:54 -0400 |
|---|---|---|
| committer | Sacha Chua <sacha@sachachua.com> | 2026-10-25 20:25:54 -0400 |
| commit | 832422efbadfb7c1d1f4ee6707243c2eda18edd3 (patch) | |
| tree | f7e5b43272ec6b9e95e6c64d5907081d1e6adec7 /emacsconf-bbb.el | |
| parent | b0a86b4540154fb032f2a06ecbd841eccc3dd3f3 (diff) | |
| download | emacsconf-el-832422efbadfb7c1d1f4ee6707243c2eda18edd3.tar.xz emacsconf-el-832422efbadfb7c1d1f4ee6707243c2eda18edd3.zip | |
bbb: load the user id
Diffstat (limited to 'emacsconf-bbb.el')
| -rw-r--r-- | emacsconf-bbb.el | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/emacsconf-bbb.el b/emacsconf-bbb.el index ee6eefe..968bb4d 100644 --- a/emacsconf-bbb.el +++ b/emacsconf-bbb.el @@ -56,24 +56,32 @@ (or info (emacsconf-active-talks (emacsconf-filter-talks (emacsconf-get-talk-info)))))))) (defvar emacsconf-bbb-prefix "EC26" "Prefix for conference rooms.") +(defvar emacsconf-bbb-user-email "emacsconf@sachachua.com" "E-mail address for the BBB account.") + ;;;###autoload (defun emacsconf-bbb-create-rooms () "Copy the commands needed to create the rooms. docker exec -it greenlight-v3 /bin/bash -c \"bundle exec rails console\" user_id = User.find_by_email(\"emacsconf@sachachua.com\").id" (interactive) - (kill-new - (mapconcat (lambda (group) - (format - "Room.create(user_id: user_id, name: \"%s: %s - %s\")\n" - emacsconf-bbb-prefix - (plist-get (cadr group) :speakers) - (string-join (mapcar (lambda (talk) (plist-get talk :slug)) - (cdr group)) - ", "))) - (emacsconf-mail-groups (emacsconf-active-talks (emacsconf-get-talk-info))) - "")) - (message "Copied. Run it inside the greenlight-v3 rails console.")) + (let ((rooms (emacsconf-mail-groups (seq-remove (lambda (o) (plist-get o :bbb-room)) (emacsconf-active-talks (emacsconf-get-talk-info)))))) + (if rooms + (progn + (kill-new + (format "user_id = User.find_by_email(\"%s\").id\n%s\nRoom.all.each { |x| puts x.friendly_id + \" \" + x.name }\nnil" + emacsconf-bbb-user-email + (mapconcat (lambda (group) + (format + "Room.create(user_id: user_id, name: \"%s: %s - %s\")\n" + emacsconf-bbb-prefix + (plist-get (cadr group) :speakers) + (string-join (mapcar (lambda (talk) (plist-get talk :slug)) + (cdr group)) + ", "))) + rooms + ""))) + (message "Copied. Run it inside the greenlight-v3 rails console.")) + (message "No more rooms needed.")))) ;;;###autoload (defun emacsconf-bbb-load-rooms (string) |
