       (added (set-difference current-buffers floobits-open-buffers))
       (deleted (set-difference floobits-open-buffers current-buffers)))
     (when (or added deleted)
+      (when (and added (not (member "patch" floobits-perms)))
+        (mapcar
+          (lambda (buf-path)
+            (with-current-buffer (find-buffer-visiting buf-path)
+              (setq buffer-read-only t)))
+          added))
       (setq floobits-open-buffers current-buffers)
       (let* (
           (added-text

(setq floobits-current-position '((mark . 1) (point . 1) (name . "")))
(setq floobits-open-buffers nil)
(setq floobits-follow-mode nil)
(setq floobits-user-highlights (make-hash-table :test 'equal))
(setq floobits-python-path (concat floobits-plugin-dir "floobits.py"))

(defun floobits-add-hooks ()
  (add-hook 'after-change-functions 'floobits-after-change nil nil)


(defun floobits-event-room_info (req)
  (message "Successfully joined room %s" floobits-room)
  (setq floobits-share-dir (floo-get-item req 'project_path))
  (message "project path is %s" floobits-share-dir)
  (setq floobits-perms (append (floo-get-item req 'perms) nil))
;  (message "perms are %s" floobits-perms)
  (floobits-add-hooks)
  (dired floobits-share-dir))

(defun floobits-event-join (req)
  (message "%s" req)
