Our infrastructure exposes APIs to signin...PeerCollabSignin(). There are two primary aspects of signing in:
1. Signing in to People Near Me (PNM): Signing into PNM means that you are publishing a nickname (which the user entered when our infrastructure was used for the first time) to the people on the same subnet. In addition, you can enumerate the people who have opted in to PNM as well. Applications can also choose to make capabilities and any objects available as well.
2. Signing in to "Internet": The notion of signing into the Internet is actually a little different from signing into PNM. The idea with signing in to the Internet is that you have the ability to see the presence of your contacts, not of everyone on the Internet :) Consequently, signing into the Internet requires that you have contacts, so that you can get their presence. However, just because you have added someone as a contact does not mean that you can get that person's presence. The contact on the other end actually needs to have approved you viewing their presence.
If you look at the PEER_CONTACT structure, there are two fields - fWatch and PEER_WATCHER_PERMISSIONS. You need to add a person as a contact, once you do that you can get a contact structure from it. The fWatch field in this structure is used to tell our infrastructure to get that particular contact's presence. The PEER_WATCHER_PERMISSIONS structure is used to authorize our infrastructure to release my presence to that contact.
For instance, if Adrian wants to view my presence, then he will mark the fWatch field on my contact to true. However, he will only get my presence after I mark the PEER_WATCHER_PERMISSIONS field as "Allow" on his contact in my list. Similarly, if I want to get Adrian's presence, I mark the fWatch field on Adrian's contact. If Adrian does not want me to see his presence, he would mark the PEER_WATCHER_PERMISSIONS field as "Deny" on my contact. Now, Adrian can watch my presence, but I cannot watch Adrian's presence. This helps in building up a rich presence system.
The last aspect is...how do we exchange contacts. Contacts are fully integrated with the Windows Address Book (WAB). Just navigate into the WAB, and you will find your own contact that contains the nickname you had entered about yourself. Put this in email, and send it to your friend. Your friend can now save this in the WAB, and he has your contact info. Your friend would do exactly the same as well.
The same can be done programmatically as well.
To summarize, signing into PNM will publish your nickname to people on the same subnet. Signing into the Internet will get presence of your contacts (who have authorized you to get their presence), and will publish your presence to your contacts as well (who you have authorized to see your presence).