nsCOMPtr<nsIPref> prefs(do_GetService(kPrefCID, &res)); if (NS_SUCCEEDED(res) && prefs) res = prefs->GetIntPref("mail.show_headers", &show_headers);
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &res)); if (NS_SUCCEEDED(res)) prefBranch->GetIntPref("mail.show_headers", &show_headers);
mime_insert_forwarded_message_headers(char            **body,                                       MimeHeaders     *headers,                                      MSG_ComposeFormat composeFormat,                                      char            *mailcharset){  if (!body || !headers)    return;  PRInt32     show_headers = 0;  nsresult    res;  nsCOMPtr<nsIPref> prefs(do_GetService(kPrefCID, &res));   if (NS_SUCCEEDED(res) && prefs)    res = prefs->GetIntPref("mail.show_headers", &show_headers);  switch (show_headers)  {  case 0:    mime_insert_micro_headers(body, headers, composeFormat, mailcharset);    break;  default:  case 1:    mime_insert_normal_headers(body, headers, composeFormat, mailcharset);    break;  case 2:    mime_insert_all_headers(body, headers, composeFormat, mailcharset);    break;  }}