* riece-commands.el (riece-command-topic): Use
[riece] / lisp / riece-misc.el
index c4fa7bc..0e218e6 100644 (file)
     user-at-host))
 
 (defun riece-get-users-on-server ()
-  (riece-with-server-buffer (riece-identity-server riece-current-channel)
+  (riece-with-server-buffer (if riece-current-channel
+                               (riece-identity-server riece-current-channel)
+                             "")
     (let (users)
       (mapatoms
        (lambda (atom)
          users
        (cons riece-real-nickname users)))))
 
+(defun riece-check-channel-commands-are-usable (&optional channel)
+   (unless riece-current-channel
+     (error (substitute-command-keys
+            "Type \\[riece-command-join] to join a channel")))
+   (if (and channel
+           (not (riece-channel-p (riece-identity-prefix
+                                  riece-current-channel))))
+       (error "Not on a channel")))
+
 (provide 'riece-misc)
 
 ;;; riece-misc.el ends here