Presence in the SharePoint UI is rendered very simply, as an image tag (WSS V2) or anchor tag (WSS V3) tag that calls into JavaScript functions that actually render the presence info SmartTag (ActiveX object) on the page. In each case, the user’s email address is placed as a parameter to a JavaScript call that actually adds the presence info SmartTag to the page’s DOM. The SmartTag invokes the Windows Messenger / MSN Messenger client applications to actually determine the presence of the email address passed as the parameter to the SmartTag through the JavaScript call.

WSS V2:

Here is the code that gives you presence awareness:

<img border=”0″ height=”12″ width=”12″ src=”http://portal.blackbladesystems.com/_layouts/images/blank.gif” onload=”IMNRC(‘erosenfeld@blackbladesystems.com‘)” id=”imn0″ >

Easiest way to override WSS presence info is to override the IMNRC JavaScript function with your own.

WSS V3:

Here is the code that gives you presence awareness:

<a href=”javascript:” onclick=”IMNImageOnClick();return false;” class=”ms-imnlink”><img title=”” alt=”No presence information” name=”imnmark” border=”0″ valign=”middle” height=”12″ width=”12″ src=”/_layouts/images/blank.gif” sip=”administrator@trainsbydave.com” id=”imn0,type=smtp” ></a>

All presence information elements in WSS V3 are tagged with the “imnmark” name.

In WSS V2, the IMNRC method was called directly from the img tags that showed the presence information.

Here’s how things work in WSS V3:

  • _spBodyOnLoadWrapper
    • Called from the page’s BODY onload event
    • <BODY scroll=”yes” onload=”javascript:if (typeof(_spBodyOnLoadWrapper) != ‘undefined’) _spBodyOnLoadWrapper();”>
  • ProcessDefaultOnLoad(onLoadFunctionNames)
    • onLoadFunctionNames: array of function to call in the page onload event
  • ProcessImn()
  • ProcessImnMarkers()
    • For each “imnmark” element: IMNRC(name, elem):
      • name: SIP address
      • elem: the element on the page whose image will be updated