Fix -- user list buffer not updating when parts are hidden.
[riece] / lisp / riece-ctcp.el
index 854e416..234a1fe 100644 (file)
@@ -1,4 +1,4 @@
-;;; riece-ctcp.el --- CTCP (Client To Client Protocol) support
+;;; riece-ctcp.el --- CTCP (Client To Client Protocol) support -*- lexical-binding: t -*-
 ;; Copyright (C) 1998-2003 Daiki Ueno
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
@@ -34,6 +34,7 @@
 (require 'riece-display)
 (require 'riece-debug)
 (require 'riece-mcat)
+(require 'riece-message)
 
 (defface riece-ctcp-action-face
   '((((class color)
@@ -90,7 +91,7 @@
                                             message)))
            t)))))
 
-(defun riece-handle-ctcp-version-request (prefix target string)
+(defun riece-handle-ctcp-version-request (prefix target _string)
   (let* ((target-identity (riece-make-identity target riece-server-name))
         (buffer (if (riece-channel-p target)
                     (riece-channel-buffer target-identity)))
               (riece-format-identity target-identity t)))
       "\n"))))
 
-(defun riece-handle-ctcp-clientinfo-request (prefix target string)
+(defun riece-handle-ctcp-clientinfo-request (prefix target _string)
   (let* ((target-identity (riece-make-identity target riece-server-name))
         (buffer (if (riece-channel-p target)
                     (riece-channel-buffer target-identity)))
      "\n")))
 
 (defun riece-handle-ctcp-action-request (prefix target string)
-  (let ((buffer (if (riece-channel-p target)
-                   (riece-channel-buffer (riece-make-identity
-                                          target riece-server-name))))
-       (user (riece-prefix-nickname prefix)))
+  (let ((user (riece-prefix-nickname prefix)))
     (riece-display-message
      (riece-make-message (riece-make-identity user
                                              riece-server-name)
                         (riece-identity-equal-no-server
                          user riece-real-nickname)))))
 
-(defun riece-handle-ctcp-time-request (prefix target string)
+(defun riece-handle-ctcp-time-request (prefix target _string)
   (let* ((target-identity (riece-make-identity target riece-server-name))
         (buffer (if (riece-channel-p target)
                     (riece-channel-buffer target-identity)))
                                             message)))
            t)))))
 
-(defun riece-handle-ctcp-version-response (prefix target string)
+(defun riece-handle-ctcp-version-response (prefix _target string)
   (riece-insert-change
    (list riece-dialogue-buffer riece-others-buffer)
    (concat
             string))
     "\n")))
 
-(defun riece-handle-ctcp-ping-response (prefix target string)
+(defun riece-handle-ctcp-ping-response (prefix _target _string)
   (let* ((now (current-time))
         (elapsed (+ (* 65536 (- (car now) (car riece-ctcp-ping-time)))
                     (- (nth 1 now) (nth 1 riece-ctcp-ping-time)))))
               elapsed))
       "\n"))))
 
-(defun riece-handle-ctcp-clientinfo-response (prefix target string)
+(defun riece-handle-ctcp-clientinfo-response (prefix _target string)
   (riece-insert-change
    (list riece-dialogue-buffer riece-others-buffer)
    (concat
             string))
     "\n")))
 
-(defun riece-handle-ctcp-time-response (prefix target string)
+(defun riece-handle-ctcp-time-response (prefix _target string)
   (riece-insert-change
    (list riece-dialogue-buffer riece-others-buffer)
    (concat
               (read-string (riece-mcat "Action: "))
             (prog1 (read-from-minibuffer (riece-mcat "Action: ")
                                          (cons message 0))
-              (let ((next-line-add-newlines t))
-                (next-line 1)))))))
+              (if (> (forward-line) 0)
+                  (insert "\n")))))))
   (if (equal action "")
       (error "No action"))
   (riece-send-string (format "PRIVMSG %s :\1ACTION %s\1\r\n"