Backed out changeset cf49ca9bc214 due to wrong version being committed
authorPatrick Cloke <clokep@gmail.com>
Thu, 27 Nov 2014 12:47:34 -0500
changeset 26802 f7d72a7b3cd64dab2dfadcc57fa58b0909f3a168
parent 26801 cf49ca9bc2143d151d1ed6fd3b4d0ad5f826b55c
child 26803 b04d7ef86701e585dbadbb1942e489cd46f50987
push id1932
push userhiikezoe@mozilla-japan.org
push dateFri, 28 Nov 2014 00:34:37 +0000
treeherdertry-comm-central@f917d3921def [default view] [failures only]
backs outcf49ca9bc2143d151d1ed6fd3b4d0ad5f826b55c
Backed out changeset cf49ca9bc214 due to wrong version being committed
chat/components/public/imIAccount.idl
chat/components/public/imIContactsService.idl
chat/components/public/imILogger.idl
chat/components/public/imITagsService.idl
chat/components/public/prplIConversation.idl
chat/components/src/imContacts.js
chat/modules/jsProtoHelper.jsm
im/components/ibConvStatsService.js
im/components/ibIConvStatsService.idl
--- a/chat/components/public/imIAccount.idl
+++ b/chat/components/public/imIAccount.idl
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "prplIConversation.idl"
 #include "imIUserStatusInfo.idl"
 
 interface imITag;
 interface imIBuddy;
-interface prplIAccountBuddy;
+interface imIAccountBuddy;
 interface imIAccount;
 interface prplIAccount;
 interface prplIProtocol;
 interface purpleIProxyInfo;
 interface nsIScriptError;
 interface nsISSLStatus;
 
 /*
@@ -68,17 +68,17 @@ interface prplIRoomInfoCallback: nsISupp
                            in boolean aCompleted,
                            in unsigned long aCount);
 };
 
 
 /*
  * This interface should be implemented by the protocol plugin.
  */
-[scriptable, uuid(55331ab9-54e9-4cd3-bb19-a46da76898e5)]
+[scriptable, uuid(bc540cab-a6e9-4c2c-abff-e95d0d1370a1)]
 interface prplIAccount: nsISupports {
   readonly attribute imIAccount imAccount;
 
   // observe should only be called by the imIAccount
   // implementation to report user status changes that affect this account.
   void observe(in nsISupports aObj, in string aEvent,
                [optional] in wstring aData);
 
@@ -97,17 +97,17 @@ interface prplIAccount: nsISupports {
   void disconnect();
 
   prplIConversation createConversation(in AUTF8String aName);
 
   // Used when the user wants to add a buddy to the buddy list
   void addBuddy(in imITag aTag, in AUTF8String aName);
 
   // Used while loading the buddy list at startup.
-  prplIAccountBuddy loadBuddy(in imIBuddy aBuddy, in imITag aTag);
+  imIAccountBuddy loadBuddy(in imIBuddy aBuddy, in imITag aTag);
 
   /* Request more info on a buddy (typically a chat buddy).
    * The result (if any) will be provided by a user-info-received
    * notification dispatched through the observer service:
    *  - aSubject will be an nsISimpleEnumerator of prplITooltipInfo.
    *  - aData will be aBuddyName.
    */
   void requestBuddyInfo(in AUTF8String aBuddyName);
--- a/chat/components/public/imIContactsService.idl
+++ b/chat/components/public/imIContactsService.idl
@@ -5,41 +5,41 @@
 #include "imIStatusInfo.idl"
 #include "imITagsService.idl"
 #include "nsISupports.idl"
 #include "nsIObserver.idl"
 #include "nsISimpleEnumerator.idl"
 
 interface imIContact;
 interface imIBuddy;
-interface prplIAccountBuddy;
+interface imIAccountBuddy;
 interface imIAccount;
 interface prplIProtocol;
 
-[scriptable, uuid(45ce33d9-d335-4cce-b904-44821987e048)]
+[scriptable, uuid(be0f7dd6-26ca-445c-a265-99cf9612ece8)]
 interface imIContactsService: nsISupports {
   void initContacts();
   void unInitContacts();
 
   imIContact getContactById(in long aId);
   // Get an array of all existing contacts.
   void getContacts([optional] out unsigned long contactCount,
                    [retval, array, size_is(contactCount)] out imIContact contacts);
   imIBuddy getBuddyById(in long aId);
   imIBuddy getBuddyByNameAndProtocol(in AUTF8String aNormalizedName,
                                      in prplIProtocol aPrpl);
-  prplIAccountBuddy getAccountBuddyByNameAndAccount(in AUTF8String aNormalizedName,
-                                                    in imIAccount aAccount);
+  imIAccountBuddy getAccountBuddyByNameAndAccount(in AUTF8String aNormalizedName,
+                                                  in imIAccount aAccount);
 
   // These 3 functions are called by the protocol plugins when
   // synchronizing the buddy list with the server stored list,
   // or after user operations have been performed.
-  void accountBuddyAdded(in prplIAccountBuddy aAccountBuddy);
-  void accountBuddyRemoved(in prplIAccountBuddy aAccountBuddy);
-  void accountBuddyMoved(in prplIAccountBuddy aAccountBuddy,
+  void accountBuddyAdded(in imIAccountBuddy aAccountBuddy);
+  void accountBuddyRemoved(in imIAccountBuddy aAccountBuddy);
+  void accountBuddyMoved(in imIAccountBuddy aAccountBuddy,
                          in imITag aOldTag, in imITag aNewTag);
 
   // These methods are called by the imIAccountsService implementation
   // to keep the accounts table in sync with accounts stored in the
   // preferences.
 
   // Called when an account is created or loaded to store the new
   // account or ensure it doesn't conflict with an existing account
@@ -49,30 +49,16 @@ interface imIContactsService: nsISupport
   void storeAccount(in unsigned long aId, in AUTF8String aUserName,
                     in AUTF8String aPrplId);
   // Check if an account id already exists in the database.
   boolean accountIdExists(in unsigned long aId);
   // Called when deleting an account to remove it from blist.sqlite.
   void forgetAccount(in unsigned long aId);
 };
 
-/*
- * An imIContact represents a person, e.g. our friend Alice. This person might
- * have multiple means of contacting them.
- *
- * Remember that an imIContact can have multiple buddies (imIBuddy instances),
- * each imIBuddy can have multiple account-buddies (prplIAccountBuddy instances)
- * referencing it. To be explicit, the difference is that an imIBuddy represents
- * a contact's account on a network, while a prplIAccountBuddy represents the
- * link between your account and your contact's account.
- *
- * Each of these implement imIStatusInfo: imIContact and imIBuddy should merge
- * the status info based on the information available in their instances of
- * imIBuddy and prplIAccountBuddy, respectively.
- */
 [scriptable, uuid(f585b0df-f6ad-40d5-9de4-c58b14af13e4)]
 interface imIContact: imIStatusInfo {
   // The id will be positive if the contact is real (stored in the
   // SQLite database) and negative if the instance is a dummy contact
   // holding only a single buddy without aliases or additional tags.
   readonly attribute long id;
   attribute AUTF8String alias;
 
@@ -141,54 +127,44 @@ interface imIContact: imIStatusInfo {
    *   contact-no-longer-dummy
    *     When a real contact is created to replace a dummy contact.
    *     The old (negative) id will be given in aData.
    *     See also the comment above the 'id' attribute.
    *   contact-icon-changed
    *
    * Observers will also receive all the (forwarded) notifications
    * from the linked buddies (imIBuddy instances) and their account
-   * buddies (prplIAccountBuddy instances).
+   * buddies (imIAccountBuddy instances).
    */
 
   // Exposed for add-on authors. All internal calls will come from the
   // imIContact implementation itself so it wasn't required to expose this.
   // This can be used to dispatch custom notifications to the
   // observers of the contact and its tags.
   // The notification will also be forwarded to the observer service.
   void notifyObservers(in nsISupports aObj, in string aEvent,
                        [optional] in wstring aData);
 };
 
-/*
- * An imIBuddy represents a person's account on a particular network. Note that
- * what a network is depends on the implementation of the prpl, e.g. for AIM
- * there is only a single network, but both GTalk and XMPP are the same network.
- *
- * E.g. Our contact Alice has two accounts on the Foo network: @lic4 and
- * alice88; and she has a single account on the Bar network: _alice_. This would
- * result in an imIBuddy instance for each of these: @lic4, alice88, and _alice_
- * that would all exist as part of the same imIContact.
- *
- */
-[scriptable, uuid(c56520ba-d923-4b95-8416-ca6733c4a38e)]
+
+[scriptable, uuid(fea582a0-3839-4d80-bcab-0ff82ae8f97f)]
 interface imIBuddy: imIStatusInfo {
   readonly attribute long id;
   readonly attribute prplIProtocol protocol;
   readonly attribute AUTF8String userName; // may be formatted
   // A name that can be used to check for duplicates and is the basis
   // for the directory name for log storage.
   readonly attribute AUTF8String normalizedName;
   // The optional server alias is in displayName (inherited from imIStatusInfo)
   // displayName = serverAlias || userName.
 
   readonly attribute imIContact contact;
-  readonly attribute prplIAccountBuddy preferredAccountBuddy;
+  readonly attribute imIAccountBuddy preferredAccountBuddy;
   void getAccountBuddies([optional] out unsigned long accountBuddyCount,
-                         [retval, array, size_is(accountBuddyCount)] out prplIAccountBuddy accountBuddies);
+                         [retval, array, size_is(accountBuddyCount)] out imIAccountBuddy accountBuddies);
 
   // remove the buddy from the buddy list. If the contact becomes empty, it will be removed too.
   void remove();
 
   void addObserver(in nsIObserver aObserver);
   void removeObserver(in nsIObserver aObserver);
   /* Observers will be notified of changes related to the buddy.
    *  aSubject will point to the imIBuddy object.
@@ -202,67 +178,57 @@ interface imIBuddy: imIStatusInfo {
    *   buddy-display-name-changed
    *     when the serverAlias has changed.
    *     The old display name is provided in aData.
    *   buddy-preferred-account-changed
    *     The account that would be favored to start a conversation has changed.
    *   buddy-icon-changed
    *
    * Observers will also receive all the (forwarded) notifications
-   * from the linked account buddies (prplIAccountBuddy instances).
+   * from the linked account buddies (imIAccountBuddy instances).
    */
 
   // Exposed for add-on authors. All internal calls will come from the
   // imIBuddy implementation itself so it wasn't required to expose this.
   // This can be used to dispatch custom notifications to the
   // observers of the buddy, its contact and its tags.
   // The contact will forward the notifications to the observer service.
   void notifyObservers(in nsISupports aObj, in string aEvent,
                        [optional] in wstring aData);
 
-  // observe should only be called by the prplIAccountBuddy
+  // observe should only be called by the imIAccountBuddy
   // implementations to report changes.
   void observe(in nsISupports aObj, in string aEvent,
                [optional] in wstring aData);
 };
 
-/*
- * A prplIAccountBuddy represents the connection on a network between one of the
- * current user's accounts and a persons's account. E.g. if we're logged into
- * the Foo network as BobbyBoy91 and want to talk to Alice, there are two
- * prplIAccountBuddy instances: @lic4 as seen by BobbyBoy91 or alice88 as seen
- * by BobbyBoy91. Additionally, if we also login as 8ob, there would be @lic4 as
- * seen by 8ob and alice88 as seen by 8ob; but these (now four)
- * prplIAccountBuddy instances would link to only TWO imIBuddy instances (one
- * each for @lic4 and alice88).
+/* imIAccountBuddy implementations can send notifications to their buddy:
  *
- * prplIAccountBuddy implementations send notifications to their buddy:
- *
- * For all of them, aSubject points to the prplIAccountBuddy object.
+ * For all of them, aSubject points to the imIAccountBuddy object.
  *
  * Supported notifications:
  *  account-buddy-availability-changed
  *    when either statusType or availabilityDetails has changed.
  *  account-buddy-signed-on
  *  account-buddy-signed-off
  *  account-buddy-status-changed
  *    when either statusType or statusText has changed.
  *  account-buddy-display-name-changed
  *    when the serverAlias has changed.
  *    The old display name is provided in aData.
  *  account-buddy-icon-changed
  *
  * All notifications (even unsupported ones) will be forwarded to the contact,
  * its tags and nsObserverService.
  */
-[scriptable, uuid(0c5021ac-7acd-4118-bf4f-c0dd9cb3ddef)]
-interface prplIAccountBuddy: imIStatusInfo {
+[scriptable, uuid(114d24ff-56a1-4fd6-9822-4992efb6e036)]
+interface imIAccountBuddy: imIStatusInfo {
   // The setter is for internal use only. buddy will be set by the
   // Contacts service when accountBuddyAdded is called on this
-  // instance of prplIAccountBuddy.
+  // instance of imIAccountBuddy.
            attribute imIBuddy buddy;
   readonly attribute imIAccount account;
   // Setting the tag will move the buddy to a different group on the
   // server-stored buddy list.
            attribute imITag tag;
   readonly attribute AUTF8String userName;
   // A name that can be used to check for duplicates and is the basis
   // for the directory name for log storage.
--- a/chat/components/public/imILogger.idl
+++ b/chat/components/public/imILogger.idl
@@ -2,39 +2,39 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "nsISimpleEnumerator.idl"
 #include "nsIFile.idl"
 
 interface imIAccount;
-interface prplIAccountBuddy;
+interface imIAccountBuddy;
 interface imIBuddy;
 interface imIContact;
 interface imIMessage;
 interface prplIConversation;
 
-[scriptable, uuid(7771402c-ff55-41f5-86b4-59b93f9b0693)]
+[scriptable, uuid(5bc06f3b-33a1-412b-a4d8-4fc7ba4c962b)]
 interface imILogConversation: nsISupports {
   readonly attribute AUTF8String title;
   readonly attribute AUTF8String name;
   // Value in microseconds.
   readonly attribute PRTime startDate;
 
   // Simplified account implementation:
   //  - alias will always be empty
   //  - name (always the normalizedName)
   //  - statusInfo will return Services.core.globalUserStatus
   //  - protocol will only contain a "name" attribute, with the prpl's normalized name.
   // Other methods/attributes aren't implemented.
   readonly attribute imIAccount account;
 
   readonly attribute boolean isChat; // always false (compatibility with prplIConversation).
-  readonly attribute prplIAccountBuddy buddy; // always null (compatibility with prplIConvIM).
+  readonly attribute imIAccountBuddy buddy; // always null (compatibility with prplIConvIM).
 
   void getMessages([optional] out unsigned long messageCount,
                    [retval, array, size_is(messageCount)] out imIMessage messages);
 
   // Callers that process the messages asynchronously should use the enumerator
   // instead of the array version of the getMessages* methods to avoid paying
   // up front the cost of xpconnect wrapping all message objects.
   nsISimpleEnumerator getMessagesEnumerator([optional] out unsigned long messageCount);
@@ -54,33 +54,33 @@ interface imILog: nsISupports {
 [scriptable, function, uuid(2ab5f8ac-4b89-4954-9a4a-7c167f1e3b0d)]
 interface imIProcessLogsCallback: nsISupports {
   // The callback can return a promise. If it does, then it will not be called
   // on the next log until this promise resolves. If it throws (or rejects),
   // iteration will stop.
   jsval processLog(in AUTF8String aLogPath);
 };
 
-[scriptable, uuid(f8ac75ed-e9b5-432e-989b-f01fed2e5a3f)]
+[scriptable, uuid(b9d5701a-df53-4e0e-99b7-706e0118e075)]
 interface imILogger: nsISupports {
   // Returns a promise that resolves to an imILog instance.
   jsval getLogFromFile(in AUTF8String aFilePath, [optional] in boolean aGroupByDay);
   // Returns a promise that resolves to the log file path if a log writer
   // exists for the conversation, or null otherwise. The promise resolves
   // after any pending I/O operations on the file complete.
   jsval getLogPathForConversation(in prplIConversation aConversation);
 
   // Below methods return promises that resolve to nsISimpleEnumerator instances.
 
   // Get logs for a username that may not be in the contact list.
   jsval getLogsForAccountAndName(in imIAccount aAccount,
                                  in AUTF8String aNormalizedName,
                                  [optional] in boolean aGroupByDay);
 
-  jsval getLogsForAccountBuddy(in prplIAccountBuddy aAccountBuddy,
+  jsval getLogsForAccountBuddy(in imIAccountBuddy aAccountBuddy,
                                [optional] in boolean aGroupByDay);
   jsval getLogsForBuddy(in imIBuddy aBuddy,
                         [optional] in boolean aGroupByDay);
   jsval getLogsForContact(in imIContact aContact,
                           [optional] in boolean aGroupByDay);
 
   jsval getLogsForConversation(in prplIConversation aConversation,
                                [optional] in boolean aGroupByDay);
--- a/chat/components/public/imITagsService.idl
+++ b/chat/components/public/imITagsService.idl
@@ -19,17 +19,17 @@ interface imITag: nsISupports {
   void getContacts([optional] out unsigned long contactCount,
                    [retval, array, size_is(contactCount)] out imIContact contacts);
 
   void addObserver(in nsIObserver aObserver);
   void removeObserver(in nsIObserver aObserver);
   /* Observers will be notified of changes related to the contacts
    * that have the tag: contact-*, buddy-*, account-buddy-*
    * notifications forwarded respectively from the imIContact,
-   * imIBuddy and prplIAccountBuddy instances.
+   * imIBuddy and imIAccountBuddy instances.
    */
 
   // Exposed for add-on authors. All internal calls will come from the
   // imITag implementation itself so it wasn't required to expose this.
   // This can be used to dispatch custom notifications to the
   // observers of the tag.
   void notifyObservers(in nsISupports aObj, in string aEvent,
                        [optional] in wstring aData);
--- a/chat/components/public/prplIConversation.idl
+++ b/chat/components/public/prplIConversation.idl
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "nsISupports.idl"
 #include "nsISimpleEnumerator.idl"
 #include "nsIObserver.idl"
 
-interface prplIAccountBuddy;
+interface imIAccountBuddy;
 interface imIAccount;
 interface imIOutgoingMessage;
 interface nsIURI;
 interface nsIDOMDocument;
 interface prplIChatRoomFieldValues;
 
 /*
  * This is the XPCOM purple conversation component, a proxy for PurpleConversation.
@@ -69,21 +69,21 @@ interface prplIConversation: nsISupports
   /* Method to add or remove an observer */
   void addObserver(in nsIObserver aObserver);
   void removeObserver(in nsIObserver aObserver);
 
   /* Observers will be all receive new-text notifications.
      aSubject will contain the message (prplIMessage) */
 };
 
-[scriptable, uuid(c0b5b647-b0ec-4dc6-9e53-31a762a30a6e)]
+[scriptable, uuid(0c072a80-103a-4992-b249-8e442b5f0d46)]
 interface prplIConvIM: prplIConversation {
 
   /* The buddy at the remote end of the conversation */
-  readonly attribute prplIAccountBuddy buddy;
+  readonly attribute imIAccountBuddy buddy;
 
   /* The remote buddy is not currently typing */
   const short NOT_TYPING = 0;
 
   /* The remote buddy is currently typing */
   const short TYPING = 1;
 
   /* The remote buddy started typing, but has stopped typing */
--- a/chat/components/src/imContacts.js
+++ b/chat/components/src/imContacts.js
@@ -1130,17 +1130,17 @@ Buddy.prototype = {
     } catch (e) {
       Cu.reportError(e);
     }
   },
   _notifyObservers: function(aTopic, aData) {
     this.notifyObservers(this, "buddy-" + aTopic, aData);
   },
 
-  // This is called by the prplIAccountBuddy implementations.
+  // This is called by the imIAccountBuddy implementations.
   observe: function(aSubject, aTopic, aData) {
     // Forward the notification.
     this.notifyObservers(aSubject, aTopic, aData);
 
     switch (aTopic) {
       case "account-buddy-availability-changed":
         this._updatePreferredAccount(aSubject);
         break;
@@ -1301,17 +1301,17 @@ ContactsService.prototype = {
       statement.finalize();
     }
     otherContactsTag._initHiddenTags();
   },
   unInitContacts: function() {
     Tags = [];
     TagsById = { };
     // Avoid shutdown leaks caused by references to native components
-    // implementing prplIAccountBuddy.
+    // implementing imIAccountBuddy.
     for each (let buddy in BuddiesById)
       buddy.destroy();
     BuddiesById = { };
     ContactsById = { };
   },
 
   getContactById: function(aId) ContactsById[aId],
   // Get an array of all existing contacts.
@@ -1369,17 +1369,17 @@ ContactsService.prototype = {
         statement.execute();
         buddy =
           new Buddy(DBConn.lastInsertRowID, normalizedName, name, srvAlias, 0);
       } finally {
         statement.finalize();
       }
     }
 
-    // Initialize the 'buddy' field of the prplIAccountBuddy instance.
+    // Initialize the 'buddy' field of the imIAccountBuddy instance.
     aAccountBuddy.buddy = buddy;
 
     // Ensure we aren't storing a duplicate entry.
     let accountId = account.numericId;
     let tagId = aAccountBuddy.tag.id;
     if (buddy._hasAccountBuddy(accountId, tagId)) {
       Cu.reportError("Attempting to store a duplicate account buddy " +
                      normalizedName + ", account id = " + accountId +
--- a/chat/modules/jsProtoHelper.jsm
+++ b/chat/modules/jsProtoHelper.jsm
@@ -237,17 +237,17 @@ const GenericAccountPrototype = {
   get singleFormatting() false,
   get noFontSizes() false,
   get noUrlDesc() false,
   get noImages() true
 };
 
 
 const GenericAccountBuddyPrototype = {
-  __proto__: ClassInfo("prplIAccountBuddy", "generic account buddy object"),
+  __proto__: ClassInfo("imIAccountBuddy", "generic account buddy object"),
   get DEBUG() this._account.DEBUG,
   get LOG() this._account.LOG,
   get WARN() this._account.WARN,
   get ERROR() this._account.ERROR,
 
   _init: function(aAccount, aBuddy, aTag, aUserName) {
     if (!aBuddy && !aUserName)
       throw "aUserName is required when aBuddy is null";
--- a/im/components/ibConvStatsService.js
+++ b/im/components/ibConvStatsService.js
@@ -467,17 +467,17 @@ ConvStatsService.prototype = {
                                  conv.account.normalizedName,
                                  conv.normalizedName, conv.isChat);
       if (!(id in gStatsByConvId))
         gStatsByConvId[id] = new ConversationStats(id);
       this._statsByPrplConvId.set(conv.id, gStatsByConvId[id]);
 
       let possibleConv = null;
       if (conv.buddy) {
-        // First .buddy is a prplIAccountBuddy, second one is an imIBuddy.
+        // First .buddy is an imIAccountBuddy, second one is an imIBuddy.
         let contact = conv.buddy.buddy.contact;
         if (contact)
           possibleConv = this._contactsById.get(contact.id);
       }
       else if (conv.isChat) {
         let chatList = this._chatsByAccountIdAndName.get(conv.account.id);
         if (chatList && chatList.has(conv.normalizedName))
           possibleConv = chatList.get(conv.name);
--- a/im/components/ibIConvStatsService.idl
+++ b/im/components/ibIConvStatsService.idl
@@ -4,16 +4,17 @@
 
 #include "nsISupports.idl"
 #include "nsISimpleEnumerator.idl"
 #include "nsIObserver.idl"
 #include "imIStatusInfo.idl"
 
 interface ibIPossibleConversation;
 interface imIAccount;
+interface imIAccountBuddy;
 interface imIContact;
 
 [scriptable, uuid(1b495592-8512-4443-bcdb-49118f045e42)]
 interface ibIConvStatsService: nsISupports {
   // Returns an enumerator of PossibleConversations which match the given filter string.
   nsISimpleEnumerator getFilteredConvs(in AUTF8String aFilterStr);
   // A stats-service-updated notification is fired when data has been updated.
   void addObserver(in nsIObserver aObserver);