From f4005c3832ece10cc76679bdecdcb5fedcd5f942 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Tue, 11 Jan 2000 09:51:28 +0000 Subject: [PATCH] fix bug #23249. prepopulate the address widget the newsgroup name (not the full uri). also, if they had a news server selected, treat this like a normal "To:" compose. --- mailnews/base/resources/content/commandglue.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mailnews/base/resources/content/commandglue.js b/mailnews/base/resources/content/commandglue.js index fe1881c1bf5..9ee888449de 100644 --- a/mailnews/base/resources/content/commandglue.js +++ b/mailnews/base/resources/content/commandglue.js @@ -89,7 +89,14 @@ function ComposeMessage(type, format) //type is a nsIMsgCompType and format is a if (type == msgComposeType.New) { if (server.type == "nntp") { type = msgComposeType.NewsPost; - newsgroup = uri; + + // from the uri, get the newsgroup name + var resource = RDF.GetResource(uri); + var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); + if (msgfolder.isServer) + newsgroup = ""; + else + newsgroup = msgfolder.name; } } // dump("server = " + server + "\n"); @@ -125,7 +132,7 @@ function ComposeMessage(type, format) //type is a nsIMsgCompType and format is a } else if (type == msgComposeType.NewsPost) { - //dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); + dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity); return; }