From owner-freebsd-gecko@FreeBSD.ORG Wed May 4 13:36:42 2011 Return-Path: Delivered-To: gecko@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E73F1065955 for ; Wed, 4 May 2011 13:36:42 +0000 (UTC) (envelope-from root@ec-m.fr) Received: from melo.ec-m.fr (melo.ec-m.fr [147.94.19.139]) by mx1.freebsd.org (Postfix) with ESMTP id 08DE78FC19 for ; Wed, 4 May 2011 13:36:41 +0000 (UTC) Received: from amavis4.serv.int (amavis4.serv.int [10.3.0.48]) by melo.ec-m.fr (GrosseBox 1743 XXL) with ESMTP id 7BABDAC89D; Wed, 4 May 2011 15:20:27 +0200 (CEST) X-Virus-Scanned: amavisd-new at centrale-marseille.fr Received: from melo.ec-m.fr ([10.3.0.13]) by amavis4.serv.int (amavis4.serv.int [10.3.0.48]) (amavisd-new, port 10024) with LMTP id bphXdx+TfK64; Wed, 4 May 2011 15:20:26 +0200 (CEST) Received: from dgeo.sysadm.ec-m.fr (dgeo.sysadm.ec-m.fr [147.94.19.169]) by melo.ec-m.fr (GrosseBox 1743 XXL) with ESMTP id B0D0FAC895; Wed, 4 May 2011 15:20:26 +0200 (CEST) Received: by dgeo.sysadm.ec-m.fr (Postfix, from userid 0) id 799861CD64; Wed, 4 May 2011 15:20:26 +0200 (CEST) To: FreeBSD-gnats-submit@freebsd.org From: Geoffroy Desvernay X-send-pr-version: 3.113 X-GNATS-Notify: Message-Id: <20110504132026.799861CD64@dgeo.sysadm.ec-m.fr> Date: Wed, 4 May 2011 15:20:26 +0200 (CEST) Cc: gecko@FreeBSD.org, dgeo@centrale-marseille.fr Subject: [PATCH] deskutils/lightning-thunderbird: Patch to require only one time the master password for all distant calendars X-BeenThere: freebsd-gecko@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Gecko Rendering Engine issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 13:36:42 -0000 >Submitter-Id: current-users >Originator: Geoffroy Desvernay >Organization: Ecole Centrale de Marseille >Confidential: no >Synopsis: [PATCH] deskutils/lightning-thunderbird: Patch to require only one time the master password for all distant calendars >Severity: non-critical >Priority: low >Category: ports >Class: change-request >Release: FreeBSD 8.2-RELEASE-p1 amd64 >Environment: System: FreeBSD dgeo.sysadm.ec-m.fr 8.2-RELEASE-p1 FreeBSD 8.2-RELEASE-p1 #0: Fri Apr 22 01:04:23 CEST 2011 >Description: Patch to require only one time the master password for all distant calendars This circumvent an annoying problem in lightning-thunderbird: it opens as many dialog boxes 'Enter master password' as the number of distant calendars registered in lightning (plus one for imap/pop/news/... accounts by thunderbird) With this patch, (that may be included upstream later, see bugzilla), I only get two (one for thunderbird and one for lightning)... Refs: https://bugzilla.mozilla.org/show_bug.cgi?id=349641 Patch: https://bug349641.bugzilla.mozilla.org/attachment.cgi?id=528856 Added file(s): - files/patch-calendar:base:modules:calAuthUtils.jsm Port maintainer (gecko@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.99 >How-To-Repeat: >Fix: --- lightning-thunderbird-1.0_1.patch begins here --- diff -ruN --exclude=CVS /usr/ports/deskutils/lightning-thunderbird.orig/files/patch-calendar:base:modules:calAuthUtils.jsm /usr/ports/deskutils/lightning-thunderbird/files/patch-calendar:base:modules:calAuthUtils.jsm --- /usr/ports/deskutils/lightning-thunderbird.orig/files/patch-calendar:base:modules:calAuthUtils.jsm 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/deskutils/lightning-thunderbird/files/patch-calendar:base:modules:calAuthUtils.jsm 2011-04-28 20:47:47.000000000 +0200 @@ -0,0 +1,73 @@ +--- calendar/base/modules/calAuthUtils.jsm ++++ calendar/base/modules/calAuthUtils.jsm +@@ -314,42 +314,39 @@ cal.auth.Prompt.prototype = { + * the caller should fall back to promptUsernameAndPassword(). + */ + asyncPromptAuth : function capAPA(aChannel, // nsIChannel + aCallback, // nsIAuthPromptCallback + aContext, // nsISupports + aLevel, // PRUint32 + aAuthInfo // nsIAuthInformation + ) { +- let hostRealm = {}; +- hostRealm.prePath = aChannel.URI.prePath; +- hostRealm.realm = aAuthInfo.realm; +- let port = aChannel.URI.port; +- if (port == -1) { +- let handler = cal.getIOService().getProtocolHandler(aChannel.URI.scheme) +- .QueryInterface(Components.interfaces.nsIProtocolHandler); +- port = handler.defaultPort; +- } +- hostRealm.passwordRealm = aChannel.URI.host + ":" + port + " (" + aAuthInfo.realm + ")"; ++ var self=this; ++ ++ let promptlistener={ + +- let pw = this.getPasswordInfo(hostRealm); +- aAuthInfo.username = pw.username; +- if (pw && pw.found) { +- aAuthInfo.password = pw.password; +- // We cannot call the callback directly here so call it from a timer +- let timerCallback = { +- notify: function(timer) { +- aCallback.onAuthAvailable(aContext, aAuthInfo); +- } +- }; +- let timer = Components.classes["@mozilla.org/timer;1"] +- .createInstance(Components.interfaces.nsITimer); +- timer.initWithCallback(timerCallback, +- 0, +- Components.interfaces.nsITimer.TYPE_ONE_SHOT); +- } else { +- let prompter2 = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] +- .getService(Components.interfaces.nsIPromptFactory) +- .getPrompt(null, Components.interfaces.nsIAuthPrompt2); +- prompter2.asyncPromptAuth(aChannel, aCallback, aContext, aLevel, aAuthInfo); +- } ++ onPromptStart : function() { ++ ++ res=self.promptAuth(aChannel, aLevel, aAuthInfo); ++ ++ if (res) { ++ this.onPromptAuthAvailable(); ++ return true; ++ } ++ ++ this.onPromptCanceled(); ++ return false; ++ }, ++ ++ onPromptAuthAvailable : function() { ++ aCallback.onAuthAvailable(aContext, aAuthInfo); ++ }, ++ ++ onPromptCanceled : function() { ++ aCallback.onAuthCancelled(aContext, true); ++ } ++ }; ++ ++ var asyncprompter=Components.classes["@mozilla.org/messenger/msgAsyncPrompter;1"] ++ .getService(Components.interfaces.nsIMsgAsyncPrompter); ++ asyncprompter.queueAsyncAuthPrompt(aChannel.URI.spec, false, promptlistener); + } + }; --- lightning-thunderbird-1.0_1.patch ends here ---