*** tnt-idle-patch.el Tue Mar 23 22:24:47 1999 --- tnt.el.orig Thu Apr 8 23:01:59 1999 *************** *** 38,46 **** (provide 'tnt) (require 'toc) ! (defconst tnt-version "TNT 1.7 with idle patch") ! ;; patches from Eyal Soha ;;; Config variables (defvar tnt-toc-host "toc.oscar.aol.com") --- 38,46 ---- (provide 'tnt) (require 'toc) ! (defconst tnt-version "TNT 1.7") + ;;; Config variables (defvar tnt-toc-host "toc.oscar.aol.com") *************** *** 410,417 **** (defvar tnt-buddy-blist nil) (defvar tnt-buddy-alist nil) - (defvar tnt-idle-alist nil) (define-abbrev-table 'tnt-buddy-list-mode-abbrev-table ()) --- 410,417 ---- (defvar tnt-buddy-blist nil) (defvar tnt-buddy-alist nil) + (define-abbrev-table 'tnt-buddy-list-mode-abbrev-table ()) *************** *** 472,488 **** (erase-buffer) (tnt-blist-to-buffer tnt-buddy-blist '(lambda (nick) ! (let ((unick (tnt-buddy-status nick)) ! (idle (tnt-buddy-idle nick))) ! (if unick (format " %s \t(%d)" unick idle))))) (set-buffer-modified-p nil)))) (defun tnt-im-buddy () "Initiates an IM conversation with the selected buddy." (interactive) (save-excursion (beginning-of-line) ! (if (null (re-search-forward " *\\([A-Za-z0-9_]*\\).*\n" nil t)) (error "Position cursor on a buddy name") (tnt-im (buffer-substring (match-beginning 1) (match-end 1)))))) --- 472,488 ---- (erase-buffer) (tnt-blist-to-buffer tnt-buddy-blist '(lambda (nick) ! (let ((unick (tnt-buddy-status nick))) ! (if unick (format " %s" unick))))) (set-buffer-modified-p nil)))) + (defun tnt-im-buddy () "Initiates an IM conversation with the selected buddy." (interactive) (save-excursion (beginning-of-line) ! (if (null (re-search-forward " *\\([^\n]*\\)\n" nil t)) (error "Position cursor on a buddy name") (tnt-im (buffer-substring (match-beginning 1) (match-end 1)))))) *************** *** 534,573 **** (defun tnt-buddy-shutdown () (setq tnt-buddy-blist nil ! tnt-buddy-alist nil ! tnt-idle-alist nil) (tnt-build-buddy-buffer)) ! (defun tnt-set-buddy-status (nick onlinep idle) (let* ((nnick (toc-normalize nick)) (pair (assoc nnick tnt-buddy-alist)) - (pair2 (assoc nnick tnt-idle-alist)) (status (if onlinep nick)) ! (idletime (if onlinep idle)) ! (old-status (and pair (cdr pair))) ! (old-idle (and pair2 (cdr pair2)))) (if pair ! (setcdr pair status) ! (setq tnt-buddy-alist (cons (cons nnick status) ! tnt-buddy-alist))) ! (if pair2 ! (setcdr pair2 idletime) ! (setq tnt-idle-alist (cons (cons nnick idletime) tnt-idle-alist))) ! (if (or (string= status old-status) ! (and idletime old-idle (= old-idle idletime))) ! () (tnt-build-buddy-buffer)))) (defun tnt-buddy-status (nick) (let* ((nnick (toc-normalize nick)) (pair (assoc nnick tnt-buddy-alist))) (if pair (cdr pair)))) - (defun tnt-buddy-idle (nick) - (let* ((nnick (toc-normalize nick)) - (pair (assoc nnick tnt-idle-alist))) - (if pair (cdr pair)))) (defun tnt-buddy-official-name (buddy) ;; Return official screen name of buddy if known, otherwise --- 534,561 ---- (defun tnt-buddy-shutdown () (setq tnt-buddy-blist nil ! tnt-buddy-alist nil) (tnt-build-buddy-buffer)) ! (defun tnt-set-buddy-status (nick onlinep) (let* ((nnick (toc-normalize nick)) (pair (assoc nnick tnt-buddy-alist)) (status (if onlinep nick)) ! (old-status (and pair (cdr pair)))) (if pair ! (setcdr pair status) ! (setq tnt-buddy-alist (cons (cons nnick status) tnt-buddy-alist))) ! (if (string= status old-status) ! () (tnt-build-buddy-buffer)))) + (defun tnt-buddy-status (nick) (let* ((nnick (toc-normalize nick)) (pair (assoc nnick tnt-buddy-alist))) (if pair (cdr pair)))) (defun tnt-buddy-official-name (buddy) ;; Return official screen name of buddy if known, otherwise *************** *** 874,880 **** (defun tnt-handle-update-buddy (nick online evil signon idle) ! (tnt-set-buddy-status nick online idle)) (defun tnt-handle-im-in (user auto message) --- 862,868 ---- (defun tnt-handle-update-buddy (nick online evil signon idle) ! (tnt-set-buddy-status nick online)) (defun tnt-handle-im-in (user auto message)