Your SlideShare is downloading. ×
Custom Presence in the Windows Live Messenger Library
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Custom Presence in the Windows Live Messenger Library

3,144
views

Published on

Overview deck of the custom presence features in the Windows Live Messenger Library

Overview deck of the custom presence features in the Windows Live Messenger Library

Published in: Business, Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,144
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
62
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Windows Live Messenger Library Custom Presence
  • 2.
    • Custom Presence allows your web application to set custom presence properties on Messenger users
    • Uses:
      • Detect when two users are both signed into your custom Messenger application
      • Enables sharing of rich presence information between users of your web application
    • This allows you to ‘light up’ extra features between multiple users who are signed into your site
  • 3.
    • Create a presence extension object
      • This object must support the get_name() method
      • Other methods/data are up to you
    • Create a PresenceExtensionFactory object with two methods:
      • serialize(property): output a string representation of the presence extension object
      • deserialize(name, content): recreate the presence extension from the string representation
    • Set your PresenceExtensionFactory as the active presence factory
    • Add the presence extension to users’ presence
  • 4.
    • This Presence Extension stores simple name/value pairs – they can be fancier
    • var EXTENSION_NAME = ‘ExtNm’ // 6 chars or less
    • function MyPresenceExtension(name, content) {
    • this .name = name;
    • this .content = content;
    • }
    • MyPresenceExtension.prototype.get_name = function () {
    • return this .name;
    • }
    • MyPresenceExtension.prototype.get_content = function () {
    • return this .content;
    • }
  • 5.
    • This object serializes and deserializes your custom presence extension
    MyPresenceFactory = function () {} MyPresenceFactory.prototype.serialize = function (prop) { return prop.get_content(); } MyPresenceFactory.prototype.deserialize = function (name, content) { return new MyPresenceExtension(name, content); }
  • 6.
    • Add your presence factory to the user object
    • user.set_presenceFactory( new MyPresenceFactory());
    • Add your presence extension to the signed-in user
    • endpointColl = user.get_endpoints();
    • endpointPresence = endpointColl.get_item(0).get_presence();
    • extensionColl = endpointPresence.get_extensions();
    • extensionColl.add( new MyPresenceExtension(EXTENSION_NAME, 'Content' ));
  • 7.
    • For each contact, check their endpoints for the presence extension
    • endpointEnum = address.get_endpoints().getEnumerator();
    • while (endpointEnum.moveNext()) {
    • endpt = endpointEnum.get_current();
    • extEnum = endpt.get_presence().get_extensions().getEnumerator();
    • while (extEnum.moveNext()) {
    • extension = extEnum.get_current();
    • if (extension.get_name() == EXTENSION_NAME)
    • extensionContent = extension.get_content();
    • break ;
    • }
    • }
  • 8.
    • Simple Demo app at http://wlmlcustompresence.mslivelabs.com demonstrates how to use Custom Presence
    • Based on Hello World app ( http://wlmlhelloworld.mslivelabs.com )
  • 9.
    • To see the demo, sign in to the site twice, with two different Live IDs (Works best with two different browsers i.e. IE + Firefox)
  • 10.
    • Users signed into the demo are assigned a custom presence extension
    • If a contact in your list is signed into the same app, their status is shown with an asterisk *
    Contacts signed into the same demo site get a *
  • 11.
    • Demonstration App: http://wlmlcustompresence.mslivelabs.com/
    • SDK docs: http://msdn2.microsoft.com/en-us/library/cc298458.aspx
    • More information at http://dev.live.com/messenger

×