Bug 431126 - Revise calIItipTransport::defaultIdentity. r=philipp

This commit is contained in:
Martin Schroeder 2009-06-30 12:09:19 +02:00
Родитель 0d039f0a71
Коммит 05b8db9104
3 изменённых файлов: 13 добавлений и 34 удалений

Просмотреть файл

@ -1,4 +1,3 @@
/* -*- Mode: idl; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -14,13 +13,15 @@
*
* The Original Code is Simdesk Technologies code.
*
* The Initial Developer of the Original Code is Simdesk Technologies Inc.
* The Initial Developer of the Original Code is
* Simdesk Technologies Inc.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Clint Talbert <ctalbert.moz@gmail.com>
* Philipp Kewisch <mozilla@kewis.ch>
* Martin Schroeder <mschroeder@mozilla.x-home.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -46,22 +47,12 @@ interface calIDateTime;
* calIItipTransport is a generic transport interface that is implemented
* by transports (eg: email, XMPP, etc.) wishing to send calIItipItems
*/
[scriptable, uuid(d9e439da-1014-42f9-be40-aa7e878b8a7d)]
[scriptable, uuid(be4aceee-63dc-11de-a8d5-95f255d89593)]
interface calIItipTransport : nsISupports
{
/**
* Default identity for me within this transport. For example, this is
* your default email address in Thunderbird.
*
* XXX This should probably go away, using the default identity is far
* from practical. Only user right now is calUtils's sendItipInvitation.
* See bug 431126.
*/
readonly attribute AUTF8String defaultIdentity;
/**
* Scheme to be used to prefix attendees. For example, the Email transport
* should reuturn "mailto".
* should return "mailto".
*/
readonly attribute AUTF8String scheme;

Просмотреть файл

@ -23,6 +23,7 @@
* Matthew Willis <lilmatt@mozilla.com>
* Philipp Kewisch <mozilla@kewis.ch>
* Daniel Boelzle <daniel.boelzle@sun.com>
* Martin Schroeder <mschroeder@mozilla.x-home.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -66,16 +67,9 @@ calItipEmailTransport.prototype = {
},
mHasXpcomMail: false,
mAccountMgrSvc: null,
mDefaultAccount: null,
mDefaultSmtpServer: null,
// we need to reconsider whether we should tie the used identity/account to the itip transport
mDefaultIdentity: null,
get defaultIdentity() {
return this.mDefaultIdentity.email;
},
mDefaultSmtpServer: null,
get scheme() {
return "mailto";
@ -168,22 +162,20 @@ calItipEmailTransport.prototype = {
this.mHasXpcomMail = true;
try {
this.mAccountMgrSvc =
Components.classes["@mozilla.org/messenger/account-manager;1"].
getService(Components.interfaces.nsIMsgAccountManager);
var smtpSvc = Components.classes["@mozilla.org/messengercompose/smtp;1"].
getService(Components.interfaces.nsISmtpService);
let smtpSvc = Components.classes["@mozilla.org/messengercompose/smtp;1"]
.getService(Components.interfaces.nsISmtpService);
this.mSmtpServer = smtpSvc.defaultServer;
this.mDefaultAccount = this.mAccountMgrSvc.defaultAccount;
let accountMgrSvc = Components.classes["@mozilla.org/messenger/account-manager;1"]
.getService(Components.interfaces.nsIMsgAccountManager);
this.mDefaultAccount = accountMgrSvc.defaultAccount;
this.mDefaultIdentity = this.mDefaultAccount.defaultIdentity;
if (!this.mDefaultIdentity) {
// If there isn't a default identity (i.e Local Folders is your
// default identity, then go ahead and use the first available
// identity.
var allIdentities = this.mAccountMgrSvc.allIdentities;
let allIdentities = accountMgrSvc.allIdentities;
if (allIdentities.Count() > 0) {
this.mDefaultIdentity = allIdentities.GetElementAt(0)
.QueryInterface(Components.interfaces.nsIMsgIdentity);

Просмотреть файл

@ -2087,10 +2087,6 @@ calDavCalendar.prototype = {
// calIItipTransport interface
//
get defaultIdentity caldav_get_defaultIdentity() {
return this.calendarUserAddress;
},
get scheme caldav_get_scheme() {
return "mailto";
},