- (let* ((user (riece-make-identity (riece-prefix-nickname prefix)
- riece-server-name))
- (parameters (riece-split-parameters string))
- (targets (split-string (car parameters) ","))
- (message (nth 1 parameters)))
- (if (string-match riece-doctor-hello-regexp message)
- (if (riece-identity-member user riece-doctor-patients)
- (riece-doctor-reply
- (car targets)
- (format "%s: You are already talking with me."
- (riece-format-identity user t)))
- (save-excursion
- (set-buffer (get-buffer-create (riece-doctor-buffer-name user)))
- (erase-buffer)
- (doctor-mode))
- (setq riece-doctor-patients (cons user riece-doctor-patients))
- (riece-doctor-reply
- (car targets)
- (format
- "%s: I am the psychotherapist. Please, describe your problems."
- (riece-format-identity user t))))
- (if (string-match riece-doctor-bye-regexp message)
- (let ((pointer (riece-identity-member user riece-doctor-patients)))
- (when pointer
- (kill-buffer (riece-doctor-buffer-name user))
- (setq riece-doctor-patients (delq (car pointer)
- riece-doctor-patients))
- (riece-doctor-reply
- (car targets)
- (format "%s: Good bye." (riece-format-identity user t)))))
- (if (riece-identity-member user riece-doctor-patients)
- (let (string)
+ (if riece-doctor-enabled
+ (let* ((user (riece-prefix-nickname prefix))
+ (parameters (riece-split-parameters string))
+ (targets (split-string (car parameters) ","))
+ (message (nth 1 parameters)))
+ (if (string-match riece-doctor-hello-regexp message)
+ (if (riece-identity-member user riece-doctor-patients t)
+ (riece-doctor-reply
+ (car targets)
+ (format "%s: You are already talking with me." user))