diff options
Diffstat (limited to 'chess-irc.el')
| -rw-r--r-- | chess-irc.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chess-irc.el b/chess-irc.el index 7f432dd..2f5d2c8 100644 --- a/chess-irc.el +++ b/chess-irc.el @@ -46,7 +46,7 @@ (message "Connecting to IRC server '%s:%d'..." chess-irc-host chess-irc-port) (let ((engine (current-buffer)) proc) - (with-current-buffer (generate-new-buffer "*chess-irc*") + (with-current-buffer (generate-new-buffer " *chess-irc*") (setq chess-irc-engine engine proc (open-network-stream "*chess-irc*" (current-buffer) chess-irc-host chess-irc-port)) @@ -76,6 +76,16 @@ (t (apply 'chess-network-handler event args)))) +(defun chess-irc-engage (nick) + "Begin playing with another chess-irc user with the given NICK. +NOTE: This function is meant to be called from a display buffer!" + (interactive "sYour opponent's IRC nick: ") + (with-current-buffer + (cdr (assq 'chess-engine-event-handler + (chess-game-hooks (chess-display-game nil)))) + (setq chess-irc-opponent nick) + (chess-engine-send engine (format "name %s\n" (user-full-name))))) + ;; This filter translates IRC syntax into basic chess-network protocol (defun chess-irc-filter (proc string) (let ((buf (process-buffer proc))) |
