From 244ecb5781bd89d34ec34fa05c0469ac7fb080b2 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 10 Jun 2000 20:59:58 +0000 Subject: [PATCH] Use NAMESPACE information to setup prefix to URL prompts. --- v7/src/imail/imail-imap.scm | 29 ++++++++++++++++++++++++----- v7/src/imail/todo.txt | 6 +----- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/v7/src/imail/imail-imap.scm b/v7/src/imail/imail-imap.scm index 7d6d6b9d5..21492c3b3 100644 --- a/v7/src/imail/imail-imap.scm +++ b/v7/src/imail/imail-imap.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-imap.scm,v 1.115 2000/06/10 20:17:57 cph Exp $ +;;; $Id: imail-imap.scm,v 1.116 2000/06/10 20:59:40 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -78,10 +78,29 @@ (imap-url-mailbox url)) (define-method url-body-container-string ((url )) - (make-imap-url-string (imap-url-user-id url) - (imap-url-host url) - (imap-url-port url) - "")) + (make-imap-url-string + (imap-url-user-id url) + (imap-url-host url) + (imap-url-port url) + (with-open-imap-connection url + (lambda (connection) + (let ((namespace + (let ((namespace (imap-connection-namespace connection))) + (and namespace + (let ((personal + (imap:response:namespace-personal namespace))) + (and (pair? personal) + (car personal))))))) + (if (and namespace (cadr namespace)) + (let ((prefix (car namespace)) + (delimiter (cadr namespace))) + (if (and (fix:= (string-length prefix) 6) + (string-prefix-ci? "inbox" prefix) + (not (string-prefix? "inbox" prefix)) + (string-suffix? delimiter prefix)) + (string-append "inbox" delimiter) + prefix)) + "")))))) (define-method url-exists? ((url )) (not diff --git a/v7/src/imail/todo.txt b/v7/src/imail/todo.txt index 23f818996..8ca2fe728 100644 --- a/v7/src/imail/todo.txt +++ b/v7/src/imail/todo.txt @@ -1,5 +1,5 @@ IMAIL To-Do List -$Id: todo.txt,v 1.74 2000/06/10 12:10:11 cph Exp $ +$Id: todo.txt,v 1.75 2000/06/10 20:59:58 cph Exp $ Bug fixes --------- @@ -20,10 +20,6 @@ Bug fixes New features ------------ -* It would be nice if URL prompts could fill in the leading "inbox" - that is nearly always required with Cyrus. Use NAMESPACE feature to - do this. - * Support the "flagged" message flag by highlighting messages with this flag in the summary buffer. -- 2.25.1