context: function setTagHeader(){  // it would be nice if we passed in the msg hdr from the back end    var msgHdr;  try {    msgHdr = gDBView.hdrForFirstSelectedMessage;  }  catch (ex) { return; } // no msgHdr to add our tags to.    var tagsString = "";    // extract the tags from the msg hdr  var tags = msgHdr.getStringProperty('keywords');   var label = msgHdr.label;  if (label > 0)  {    var labelTag = '$label' + label;    if (!tags.search(labelTag)) // don't add the label if it's already in our keyword list      tagsString = encodeURIComponent(gPrefBranch.getComplexValue("mailnews.labels.description." + label,                    Components.interfaces.nsIPrefLocalizedString).data);  }    // now convert the list of tag ids into user presentable strings, separate by commas  var tagService = Components.classes["@mozilla.org/messenger/tagservice;1"]                   .getService(Components.interfaces.nsIMsgTagService);  // tokenize the keywords based on ' '  var tagsArray = tags.split(' ');  for (var index = 0; index < tagsArray.length; index++)  {    if (tagsArray[index])    {      var tagName;      try {        // if we got a bad tag name, getTagForKey will throw an exception, skip it         // and go to the next one.        tagName = tagService.getTagForKey(tagsArray[index]);      } catch (ex) { continue; }            if (tagName)      {                  if (tagsString)          tagsString += " ";        tagsString += encodeURIComponent(tagName);      }    }  }    if (tagsString)    currentHeaderData['tags'] = { headerName: 'tags', headerValue: tagsString};  else if (currentHeaderData['tags']) // no more tags, so clear out the header field    currentHeaderData['tags'] = null;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/a7d872845b1330bc2c1ea0b6cd9f5e41531adb6a/msgHdrViewOverlay.js/buggy/mail/base/content/msgHdrViewOverlay.js