*_retval = nsIMsgCompConvertible::Yes;
static inline nsresult TagConvertible(nsIDOMNode *node,  PRInt32 *_retval){    nsresult rv;    nsAutoString aStr;    nsCOMPtr<nsIDOMNode> pItem;    PRBool hasChild;    *_retval = nsIMsgCompConvertible::No;    rv = node->GetNodeName(aStr);    if (NS_FAILED(rv))      return rv;    nsCAutoString aCStr; aCStr.AssignWithConversion(aStr);    if (aCStr.EqualsIgnoreCase("a"))    {      /* Ignore anchor tag, if the URI is the same as the text         (as inserted by recognizers) */      nsAutoString href;      nsCOMPtr<nsIDOMNamedNodeMap> pAttributes;      rv = node->GetAttributes(getter_AddRefs(pAttributes));      if (NS_SUCCEEDED(rv) && pAttributes)      {        nsAutoString attributeName; attributeName.AssignWithConversion("href");        pAttributes->GetNamedItem(attributeName, getter_AddRefs(pItem));        if (NS_SUCCEEDED(rv) && pItem)        {          rv = pItem->GetNodeValue(href);          if (NS_SUCCEEDED(rv))          {            rv = node->HasChildNodes(&hasChild);            if (NS_SUCCEEDED(rv) && hasChild)            {              nsCOMPtr<nsIDOMNodeList> children;              rv = node->GetChildNodes(getter_AddRefs(children));              if (NS_SUCCEEDED(rv) && children)              {                rv = children->Item(0, getter_AddRefs(pItem));                if (NS_SUCCEEDED(rv) && pItem)                {                  rv = pItem->GetNodeValue(aStr);                  if (NS_SUCCEEDED(rv))                  {                    if (aStr.Compare(href) == 0)                      *_retval = nsIMsgCompConvertible::Plain;                  }                }              }            }          }        }      }      // It isn't, so don't ignore      *_retval = nsIMsgCompConvertible::Altering;    }    else if (aCStr.EqualsIgnoreCase("blockquote"))    {      // Skip <blockquote type=cite>      nsCOMPtr<nsIDOMNamedNodeMap> pAttributes;      rv = node->GetAttributes(getter_AddRefs(pAttributes));      if (NS_SUCCEEDED(rv) && pAttributes)      {        nsAutoString attributeName; attributeName.AssignWithConversion("type");        pAttributes->GetNamedItem(attributeName, getter_AddRefs(pItem));        if (NS_SUCCEEDED(rv) && pItem)        {          rv = pItem->GetNodeValue(aStr);          if (NS_SUCCEEDED(rv))          {            aCStr.StripChars("\"");            if (aCStr.EqualsIgnoreCase("cite"))              *_retval = nsIMsgCompConvertible::Plain;          }        }      }      // It isn't, so don't ignore      *_retval = nsIMsgCompConvertible::Yes;    }#if 0    /* This is for an edge case: A Mozilla user replies to plaintext per HTML       and the recipient of that HTML msg, also a Mozilla user, replies to       that again. Then we'll have to recognize the stuff inserted by our       TXT->HTML converter. Let's see, if this is actually a problem and       worth the processing time.       Bug 44552. */    else if (aCStr.EqualsIgnoreCase("div") ||             aCStr.EqualsIgnoreCase("span") ||             aCStr.EqualsIgnoreCase("em") ||             aCStr.EqualsIgnoreCase("strong") ||             aCStr.EqualsIgnoreCase("a"))    {      /* skip only if inserted by our [TXT|HTML]->HTML converter         (might be in a quote) */      nsCOMPtr<nsIDOMNamedNodeMap> pAttributes;      rv = node->GetAttributes(getter_AddRefs(pAttributes));      if (NS_SUCCEEDED(rv) && pAttributes)      {        nsAutoString attributeName; attributeName.AssignWithConversion("class");        pAttributes->GetNamedItem(attributeName, getter_AddRefs(pItem));        if (NS_SUCCEEDED(rv) && pItem)        {          rv = pItem->GetNodeValue(aStr);          if (NS_SUCCEEDED(rv)              && (aCStr.EqualsIgnoreCase("txt", 3) ||                  aCStr.EqualsIgnoreCase("\"txt", 4)))            *_retval = nsIMsgCompConvertible::Plain;        }      }    }#endif    else if (              aCStr.EqualsIgnoreCase("html") ||              aCStr.EqualsIgnoreCase("head") ||              aCStr.EqualsIgnoreCase("body") ||              aCStr.EqualsIgnoreCase("p") ||              aCStr.EqualsIgnoreCase("br") ||              aCStr.EqualsIgnoreCase("pre") ||              aCStr.EqualsIgnoreCase("tt") ||              aCStr.EqualsIgnoreCase("#text")            )    {      *_retval = nsIMsgCompConvertible::Plain;    }    else if (              //aCStr.EqualsIgnoreCase("blockquote") || // see above              aCStr.EqualsIgnoreCase("ul") ||              aCStr.EqualsIgnoreCase("ol") ||              aCStr.EqualsIgnoreCase("li") ||              aCStr.EqualsIgnoreCase("dl") ||              aCStr.EqualsIgnoreCase("dt") ||              aCStr.EqualsIgnoreCase("dd")            )    {      *_retval = nsIMsgCompConvertible::Yes;    }    else if (              aCStr.EqualsIgnoreCase("h1") ||              aCStr.EqualsIgnoreCase("h2") ||              aCStr.EqualsIgnoreCase("h3") ||              aCStr.EqualsIgnoreCase("h4") ||              aCStr.EqualsIgnoreCase("h5") ||              aCStr.EqualsIgnoreCase("h6") ||              //aCStr.EqualsIgnoreCase("a") || // see above              aCStr.EqualsIgnoreCase("em") ||              aCStr.EqualsIgnoreCase("strong") ||              aCStr.EqualsIgnoreCase("code") ||              aCStr.EqualsIgnoreCase("b") ||              aCStr.EqualsIgnoreCase("i") ||              aCStr.EqualsIgnoreCase("u") ||              aCStr.EqualsIgnoreCase("hr")            )    {      *_retval = nsIMsgCompConvertible::Altering;    }    return rv;}