<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-text-flowed" style="font-family: -moz-fixed;
      font-size: 14px;" lang="x-western"> On 18-03-2010 03:12, Jonathan
      Protzenko wrote:
      <br>
      <blockquote type="cite" style="color: rgb(0, 0, 0);">There also
        seems to be some overlap between what is being rewritten and
        what is legacy code. That's normal but it can get confusing
        sometimes. For instance, there exist both GetMsgFolderFromUri
        and MailUtils.getFolderForURI. But, look, there's this wonderful
        nsIFolderLookupService :: getFolderById ! [4] Wait, there's an
        interface but no implementation ? Oh sure, that's bug 441437...
        the implementation was there before but was backed out. An
        "official reference" would be helpful there.
        <br>
      </blockquote>
      <br>
      That change is my fault -- IIRC I introduced
      MailUtils.getFolderForURI as part of a large patch, and I didn't
      want to complicate the patch further by renaming
      GetMsgFolderFromUri to MailUtils.getFolderForURI everywhere. So I
      made GetMsgFolderFromUri a wrapper around
      MailUtils.getFolderForURI, as you can see at <a
        class="moz-txt-link-rfc2396E"
href="http://mxr.mozilla.org/comm-central/source/mail/base/content/widgetglue.js#77"><http://mxr.mozilla.org/comm-central/source/mail/base/content/widgetglue.js#77></a>,
      and slapped a @deprecated on it.
      <br>
      <br>
      You're right in that I should have filed a followup bug to remove
      GetMsgFolderFromUri entirely. Care to do it?
      <br>
      <br>
      <blockquote type="cite" style="color: rgb(0, 0, 0);">The ideal
        solution would be to have some .jsm that offers helpers for the
        most common actions. I've been doing this more or less for my
        extensions, but I think there should be some "official" way of
        doing this. If this is too hard to maintain, I think updating
        the Thunderbird how-to list on MDC would be a nice alternative.
        I plan to do some of it myself, but I'm no Thunderbird developer
        and I might not always write the best solution.
        <br>
      </blockquote>
      <br>
      That's sort of what MailUtils <a class="moz-txt-link-rfc2396E"
href="http://mxr.mozilla.org/comm-central/source/mail/base/modules/MailUtils.js"><http://mxr.mozilla.org/comm-central/source/mail/base/modules/MailUtils.js></a>
      was intended to be -- and it is deliberately a module so that all
      sorts of code -- chrome, component and module -- could use it, but
      I do realize that it lacks a number of helpers that would be
      useful. (As far as I know, we've added functions to it mostly as
      we've needed them ourselves.)
      <br>
    </div>
  </body>
</html>