Be consistent when using encoded strings in nnimap data
* lisp/gnus/nnimap.el (nnimap-encode-gnus-group): New function (nnimap-request-list): Use it. (nnimap-request-newgroups): Ditto. Copyright-paperwork-exempt: yes
This commit is contained in:
parent
3ed423bc35
commit
691feae283
1 changed files with 16 additions and 10 deletions
|
@ -113,6 +113,12 @@ some servers.")
|
||||||
|
|
||||||
(defvoo nnimap-current-infos nil)
|
(defvoo nnimap-current-infos nil)
|
||||||
|
|
||||||
|
(defun nnimap-decode-gnus-group (group)
|
||||||
|
(decode-coding-string group 'utf-8))
|
||||||
|
|
||||||
|
(defun nnimap-encode-gnus-group (group)
|
||||||
|
(encode-coding-string group 'utf-8))
|
||||||
|
|
||||||
(defvoo nnimap-fetch-partial-articles nil
|
(defvoo nnimap-fetch-partial-articles nil
|
||||||
"If non-nil, Gnus will fetch partial articles.
|
"If non-nil, Gnus will fetch partial articles.
|
||||||
If t, Gnus will fetch only the first part. If a string, it
|
If t, Gnus will fetch only the first part. If a string, it
|
||||||
|
@ -794,9 +800,6 @@ textual parts.")
|
||||||
(incf num)))
|
(incf num)))
|
||||||
(nreverse parts)))
|
(nreverse parts)))
|
||||||
|
|
||||||
(defun nnimap-decode-gnus-group (group)
|
|
||||||
(decode-coding-string group 'utf-8))
|
|
||||||
|
|
||||||
(deffoo nnimap-request-group (group &optional server dont-check info)
|
(deffoo nnimap-request-group (group &optional server dont-check info)
|
||||||
(setq group (nnimap-decode-gnus-group group))
|
(setq group (nnimap-decode-gnus-group group))
|
||||||
(let ((result (nnimap-change-group
|
(let ((result (nnimap-change-group
|
||||||
|
@ -825,7 +828,7 @@ textual parts.")
|
||||||
(- (cdr active) (car active))
|
(- (cdr active) (car active))
|
||||||
(car active)
|
(car active)
|
||||||
(cdr active)
|
(cdr active)
|
||||||
group))
|
(nnimap-encode-gnus-group group)))
|
||||||
t))))
|
t))))
|
||||||
|
|
||||||
(deffoo nnimap-request-group-scan (group &optional server info)
|
(deffoo nnimap-request-group-scan (group &optional server info)
|
||||||
|
@ -860,7 +863,8 @@ textual parts.")
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(insert
|
(insert
|
||||||
(format
|
(format
|
||||||
"211 %d %d %d %S\n" (1+ (- high low)) low high group))
|
"211 %d %d %d %S\n" (1+ (- high low)) low high
|
||||||
|
(nnimap-encode-gnus-group group)))
|
||||||
t))))
|
t))))
|
||||||
|
|
||||||
(deffoo nnimap-request-create-group (group &optional server _args)
|
(deffoo nnimap-request-create-group (group &optional server _args)
|
||||||
|
@ -1323,7 +1327,7 @@ If LIMIT, first try to limit the search to the N last articles."
|
||||||
(let* ((sequence (car response))
|
(let* ((sequence (car response))
|
||||||
(response (cadr response))
|
(response (cadr response))
|
||||||
(group (cadr (assoc sequence sequences)))
|
(group (cadr (assoc sequence sequences)))
|
||||||
(egroup (encode-coding-string group 'utf-8)))
|
(egroup (nnimap-encode-gnus-group group)))
|
||||||
(when (and group
|
(when (and group
|
||||||
(equal (caar response) "OK"))
|
(equal (caar response) "OK"))
|
||||||
(let ((uidnext (nnimap-find-parameter "UIDNEXT" response))
|
(let ((uidnext (nnimap-find-parameter "UIDNEXT" response))
|
||||||
|
@ -1354,7 +1358,7 @@ If LIMIT, first try to limit the search to the N last articles."
|
||||||
(nnimap-get-groups)))
|
(nnimap-get-groups)))
|
||||||
(unless (assoc group nnimap-current-infos)
|
(unless (assoc group nnimap-current-infos)
|
||||||
;; Insert dummy numbers here -- they don't matter.
|
;; Insert dummy numbers here -- they don't matter.
|
||||||
(insert (format "%S 0 1 y\n" (encode-coding-string group 'utf-8)))))
|
(insert (format "%S 0 1 y\n" (nnimap-encode-gnus-group group)))))
|
||||||
t)))
|
t)))
|
||||||
|
|
||||||
(deffoo nnimap-retrieve-group-data-early (server infos)
|
(deffoo nnimap-retrieve-group-data-early (server infos)
|
||||||
|
@ -1453,8 +1457,9 @@ If LIMIT, first try to limit the search to the N last articles."
|
||||||
(active (gnus-active group)))
|
(active (gnus-active group)))
|
||||||
(when active
|
(when active
|
||||||
(insert (format "%S %d %d y\n"
|
(insert (format "%S %d %d y\n"
|
||||||
(decode-coding-string
|
(nnimap-encode-gnus-group
|
||||||
(gnus-group-real-name group) 'utf-8)
|
(nnimap-decode-gnus-group
|
||||||
|
(gnus-group-real-name group)))
|
||||||
(cdr active)
|
(cdr active)
|
||||||
(car active))))))))))))
|
(car active))))))))))))
|
||||||
|
|
||||||
|
@ -1672,7 +1677,8 @@ If LIMIT, first try to limit the search to the N last articles."
|
||||||
(nreverse result))))
|
(nreverse result))))
|
||||||
|
|
||||||
(defun nnimap-store-info (info active)
|
(defun nnimap-store-info (info active)
|
||||||
(let* ((group (gnus-group-real-name (gnus-info-group info)))
|
(let* ((group (nnimap-decode-gnus-group
|
||||||
|
(gnus-group-real-name (gnus-info-group info))))
|
||||||
(entry (assoc group nnimap-current-infos)))
|
(entry (assoc group nnimap-current-infos)))
|
||||||
(if entry
|
(if entry
|
||||||
(setcdr entry (list info active))
|
(setcdr entry (list info active))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue