[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nnimap 0.3.29 released



Bugfixes.

No expunge-config as promised. We need to think this over -- we cannot
just ask the user in nnimap-close-group since (I assume) Gnus can
delete articles without opening/closing the group.

I'm not sure if we should polute Gnus's key bindings any more, but
I've added 'G x' in the group buffer to do expunging. Useless until we
make CLOSE/EXPUNGE configurable though.

Get it from http://vic20.dzp.se/gnus-imap/nnimap.tar.gz.

/s

1998-08-26 14:06:56  Simon Josefsson  <jas@pdc.kth.se>

	* nnimap 0.3.29 released

1998-08-26 13:12:13  Simon Josefsson  <jas@pdc.kth.se>

	* nnimap.el (nnimap-request-update-info): Revert to Jim's patch to
	clear all parameters.

1998-08-26 10:21:24  Simon Josefsson  <jas@pdc.kth.se>

	* nnimap.el (nnimap-request-accept-article): Appenduid is stored
	in current group, not the one we're appending to.

1998-08-26 09:39:57  Simon Josefsson  <jas@pdc.kth.se>

	* hmac.el (hex-alist): New constant.
	(hex-to-int): New function.
	(hmac): Use it.

1998-08-26 09:13:39  Simon Josefsson  <jas@pdc.kth.se>

	* nnimap.el (gnus-group-edit-nnimap-acl): 
	(gnus-group-edit-nnimap-acl-done): Renamed.

1998-08-26 09:05:41  Simon Josefsson  <jas@pdc.kth.se>

	* nnimap.el (nnimap-body-lines): Handle MESSAGE mime-imb.

1998-08-25 18:07:47  Simon Josefsson  <jas@pdc.kth.se>

	* nnimap.el (gnus-group-nnimap-expunge): New function.

	* nnimap.el (nnimap-group-mode-hook): Define-key G x.

Index: nnimap/ChangeLog
diff -c nnimap/ChangeLog:1.65 nnimap/ChangeLog:1.69
*** nnimap/ChangeLog:1.65	Tue Aug 25 07:05:51 1998
--- nnimap/ChangeLog	Wed Aug 26 05:09:07 1998
***************
*** 1,3 ****
--- 1,38 ----
+ 1998-08-26 14:06:56  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap 0.3.29 released
+ 
+ 1998-08-26 13:12:13  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap.el (nnimap-request-update-info): Revert to Jim's patch to
+ 	clear all parameters.
+ 
+ 1998-08-26 10:21:24  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap.el (nnimap-request-accept-article): Appenduid is stored
+ 	in current group, not the one we're appending to.
+ 
+ 1998-08-26 09:39:57  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* hmac.el (hex-alist): New constant.
+ 	(hex-to-int): New function.
+ 	(hmac): Use it.
+ 
+ 1998-08-26 09:13:39  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap.el (gnus-group-edit-nnimap-acl): 
+ 	(gnus-group-edit-nnimap-acl-done): Renamed.
+ 
+ 1998-08-26 09:05:41  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap.el (nnimap-body-lines): Handle MESSAGE mime-imb.
+ 
+ 1998-08-25 18:07:47  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap.el (gnus-group-nnimap-expunge): New function.
+ 
+ 	* nnimap.el (nnimap-group-mode-hook): Define-key G x.
+ 
  1998-08-25 16:04:10  Simon Josefsson  <jas@pdc.kth.se>
  
  	* nnimap 0.3.28 released
Index: nnimap/hmac.el
diff -c nnimap/hmac.el:1.14 nnimap/hmac.el:1.15
*** nnimap/hmac.el:1.14	Sun Aug 23 04:33:19 1998
--- nnimap/hmac.el	Wed Aug 26 00:42:02 1998
***************
*** 37,45 ****
  ;;;
  ;;; 1998-08-16  initial release posted to gnu.emacs.sources
  ;;; 1998-08-17  use append instead of char-list-to-string
   
  (require 'cl)
- (require 'hexl)
  
  ;; Magic character for inner HMAC round. 0x36 == 54 == '6'
  (defconst hmac-ipad ?\x36)
--- 37,45 ----
  ;;;
  ;;; 1998-08-16  initial release posted to gnu.emacs.sources
  ;;; 1998-08-17  use append instead of char-list-to-string
+ ;;; 1998-08-26  don't require hexl.
   
  (require 'cl)
  
  ;; Magic character for inner HMAC round. 0x36 == 54 == '6'
  (defconst hmac-ipad ?\x36)
***************
*** 50,55 ****
--- 50,75 ----
  ;; Not so magic character for padding the key. 0x00
  (defconst hmac-zero ?\x00)
  
+ ;; Alist for converting hex to decimal.
+ (defconst hex-alist '((?0 . 0)	      (?a . 10)	      (?A . 10)
+ 		      (?1 . 1)	      (?b . 11)	      (?B . 11)
+ 		      (?2 . 2)	      (?c . 12)	      (?C . 12)
+ 		      (?3 . 3)	      (?d . 13)	      (?D . 13)
+ 		      (?4 . 4)	      (?e . 14)	      (?E . 14)
+ 		      (?5 . 5)	      (?f . 15)	      (?F . 15)
+ 		      (?6 . 6)
+ 		      (?7 . 7)
+ 		      (?8 . 8)
+ 		      (?9 . 9)))
+ 
+ (defun hex-to-int (str)
+   (if str
+       (if (listp str)
+ 	  (+ (* 16 (hex-to-int (cdr str)))
+ 	     (cdr (assoc (car str) hex-alist)))
+ 	(hex-to-int (reverse (append str nil))))
+     0))
+ 
  (defun hmac (hash block-length hash-length key text)
    (let* (;; if key is longer than B, reset it to HASH(key)
  	 (key (if (> (length key) block-length) 
***************
*** 68,74 ****
      (let ((first-round (funcall hash (concat k_ipad text)))
  	  de-hexed)
        (while (< 0 (length first-round))
! 	(push (hexl-hex-string-to-integer (substring first-round -2)) de-hexed)
  	(setq first-round (substring first-round 0 -2)))
        ;; perform outer hash
        (funcall hash (concat k_opad de-hexed)))))
--- 88,94 ----
      (let ((first-round (funcall hash (concat k_ipad text)))
  	  de-hexed)
        (while (< 0 (length first-round))
! 	(push (hex-to-int (substring first-round -2)) de-hexed)
  	(setq first-round (substring first-round 0 -2)))
        ;; perform outer hash
        (funcall hash (concat k_opad de-hexed)))))
Index: nnimap/imap.el
diff -c nnimap/imap.el:1.29 nnimap/imap.el:1.30
*** nnimap/imap.el:1.29	Tue Aug 25 04:29:08 1998
--- nnimap/imap.el	Wed Aug 26 01:31:27 1998
***************
*** 936,942 ****
      (when var
        (cond ((equal var 'ALERT)
               (y-or-n-p (concat "IMAP: ALERT! " string)))
!             ((equal var 'APPENDUID)
               (imap-folder-set 'appenduid (cons value (caddr code))))
              ((equal var 'PERMANENTFLAGS)
               (imap-folder-set 'permanentflags (mapcar 'symbol-name value)))
--- 936,942 ----
      (when var
        (cond ((equal var 'ALERT)
               (y-or-n-p (concat "IMAP: ALERT! " string)))
!             ((equal var 'APPENDUID) ;; xxx: set in mailbox we're appending to
               (imap-folder-set 'appenduid (cons value (caddr code))))
              ((equal var 'PERMANENTFLAGS)
               (imap-folder-set 'permanentflags (mapcar 'symbol-name value)))
Index: nnimap/nnimap.el
diff -c nnimap/nnimap.el:1.55 nnimap/nnimap.el:1.59
*** nnimap/nnimap.el:1.55	Tue Aug 25 07:02:23 1998
--- nnimap/nnimap.el	Wed Aug 26 05:08:50 1998
***************
*** 102,108 ****
  
  (nnoo-declare nnimap) ; we derive from no one
  
! (defconst nnimap-version "nnimap 0.3.28")
  
  ;; Various server variables.
  
--- 102,108 ----
  
  (nnoo-declare nnimap) ; we derive from no one
  
! (defconst nnimap-version "nnimap 0.3.29")
  
  ;; Various server variables.
  
***************
*** 306,313 ****
  	  nnimap-range-to-string
            nnimap-request-expire-articles
            nnimap-request-move-article
! 	  nnimap-edit-acl-done
! 	  nnimap-edit-acl
            )))
  
  
--- 306,313 ----
  	  nnimap-range-to-string
            nnimap-request-expire-articles
            nnimap-request-move-article
! 	  gnus-group-nnimap-edit-acl-done
! 	  gnus-group-nnimap-edit-acl
            )))
  
  
***************
*** 323,337 ****
  
  (nnoo-define-basics nnimap)
  
- ;; todo:
- ;; handle "MESSAGE" too
  (defun nnimap-body-lines (body)
    (if (listp body)
!       (if (and (stringp (car body))
! 	       (string= (car body) "TEXT")
! 	       (numberp (nth 7 body)))
! 	  (nth 7 body)
!       (apply '+ (mapcar 'nnimap-body-lines body)))
      0))
  
  ;; todo:
--- 323,339 ----
  
  (nnoo-define-basics nnimap)
  
  (defun nnimap-body-lines (body)
    (if (listp body)
!       (if (stringp (car body))
! 	  (cond ((and (string= (car body) "TEXT")
! 		      (numberp (nth 7 body)))
! 		 (nth 7 body))
! 		((and (string= (car body) "MESSAGE")
! 		      (numberp (nth 9 body)))
! 		 (nth 9 body))
! 		(t 0))
! 	(apply '+ (mapcar 'nnimap-body-lines body)))
      0))
  
  ;; todo:
***************
*** 782,789 ****
  (deffoo nnimap-request-update-info (group info &optional server silly)
    (when silly
      ;; We reset the uidvalidity here because we are about to do a full
!     ;; resync.
!     (gnus-group-set-parameter group 'uidvalidity nil)
  
      (when (nnimap-possibly-change-group group server) ;; SELECT
        (with-current-buffer nnimap-server-buffer
--- 784,791 ----
  (deffoo nnimap-request-update-info (group info &optional server silly)
    (when silly
      ;; We reset the uidvalidity here because we are about to do a full
!     ;; resync. xxx: removes timestamp and stuff.
!     (gnus-info-set-params info '((uidvalidity . nil)) t)
  
      (when (nnimap-possibly-change-group group server) ;; SELECT
        (with-current-buffer nnimap-server-buffer
***************
*** 791,798 ****
  	
  	;; extend info to have parameters (otherwise when we set them, 
  	;; they don't get set)
! 	(unless (gnus-info-params info) 
! 	  (gnus-info-set-params info nil t))
  	
  	;; Replace list of read and marked articles with authoritative
  	;; data from server
--- 793,800 ----
  	
  	;; extend info to have parameters (otherwise when we set them, 
  	;; they don't get set)
! 	;;(unless (gnus-info-params info) 
! 	;;  (gnus-info-set-params info nil t))
  	
  	;; Replace list of read and marked articles with authoritative
  	;; data from server
***************
*** 1043,1054 ****
  			  (list (concat "APPEND " group " ") 
  				(current-buffer))
  			  nnimap-server-buffer))
! 	(let ((high (cdr (imap-folder-get 
! 			  (if (memq 'UIDPLUS (imap-capability-get 
! 					      nnimap-server-buffer))
! 			      'appenduid
! 			    'UIDNEXT)
! 			  group nnimap-server-buffer))))
  	  (when high
  	    (cons group high)))))))
  
--- 1045,1056 ----
  			  (list (concat "APPEND " group " ") 
  				(current-buffer))
  			  nnimap-server-buffer))
! 	(let ((high (cdr (if (memq 'UIDPLUS (imap-capability-get
! 					     nnimap-server-buffer))
! 			     (imap-folder-get 'appenduid nil 
! 					      nnimap-server-buffer)
! 			 (imap-folder-get 'UIDNEXT group
! 					  nnimap-server-buffer)))))
  	  (when high
  	    (cons group high)))))))
  
***************
*** 1148,1154 ****
  
  ;;; Other functions
  
! (defun gnus-group-edit-nnimap-acl (group)
    "Edit the Access Control List of current nnimap GROUP."
    (interactive (list (gnus-group-group-name)))
    (let ((mailbox (gnus-group-real-name group))
--- 1150,1170 ----
  
  ;;; Other functions
  
! (defun gnus-group-nnimap-expunge (group)
!   "Expunge deleted articles in current nnimap GROUP."
!   (interactive (list (gnus-group-group-name)))
!   (let ((mailbox (gnus-group-real-name group))
! 	method)
!     (unless group
!       (error "No group on current line"))
!     (unless (gnus-get-info group)
!       (error "Killed group; can't be edited"))
!     (unless (eq 'nnimap (car (setq method (gnus-find-method-for-group group))))
!       (error "Expunging only available for nnimap groups"))
!     (when (nnimap-possibly-change-server (cadr method))
!       (nnimap-send-command-wait "EXPUNGE"))))
! 
! (defun gnus-group-nnimap-edit-acl (group)
    "Edit the Access Control List of current nnimap GROUP."
    (interactive (list (gnus-group-group-name)))
    (let ((mailbox (gnus-group-real-name group))
***************
*** 1192,1201 ****
     d - delete (STORE DELETED flag, perform EXPUNGE)
     a - administer (perform SETACL)" group)
  		      `(lambda (form) 
! 			 (gnus-group-edit-nnimap-acl-done 
  			  ,mailbox ',method ',acl form))))))
  
! (defun gnus-group-edit-nnimap-acl-done (mailbox method old-acls acls)
    (when (nnimap-possibly-change-server (cadr method))
      (with-current-buffer nnimap-server-buffer
        ;; delete all removed identifiers
--- 1208,1217 ----
     d - delete (STORE DELETED flag, perform EXPUNGE)
     a - administer (perform SETACL)" group)
  		      `(lambda (form) 
! 			 (gnus-group-nnimap-edit-acl-done 
  			  ,mailbox ',method ',acl form))))))
  
! (defun gnus-group-nnimap-edit-acl-done (mailbox method old-acls acls)
    (when (nnimap-possibly-change-server (cadr method))
      (with-current-buffer nnimap-server-buffer
        ;; delete all removed identifiers
***************
*** 1228,1234 ****
  (defun nnimap-group-mode-hook ()
    (define-key gnus-group-mode-map (if (fboundp 'kbd) (kbd "G l")
  				    (read-kbd-macro "G l"))
!     'gnus-group-edit-nnimap-acl))
  (add-hook 'gnus-group-mode-hook 'nnimap-group-mode-hook)
  
  ;; We're done.
--- 1244,1253 ----
  (defun nnimap-group-mode-hook ()
    (define-key gnus-group-mode-map (if (fboundp 'kbd) (kbd "G l")
  				    (read-kbd-macro "G l"))
!     'gnus-group-nnimap-edit-acl)
!   (define-key gnus-group-mode-map (if (fboundp 'kbd) (kbd "G x")
! 				    (read-kbd-macro "G x"))
!     'gnus-group-nnimap-expunge))
  (add-hook 'gnus-group-mode-hook 'nnimap-group-mode-hook)
  
  ;; We're done.