When someone login on Messenger, you will have to login to Skype.
Because you have control over the Messenger server only, the first time, you will have to import the Skype contacts into the Messenger database. I imagine keeping an
origin (skype or messenger) field will be enough.
Next times, you will have to synchronize the contacts: grab all Skype contats and remove from the database the one that had been removed and add the ones that are missing.
Then you will have to maintain the connection to Skype as long as the user is connected to Messenger. This way, you will stay connected for your SKype buddies and, when you receive an event from the Skype server, you can transcript it in MSNP <= 21 format and send it to the Messenger client. Same thing when someone starts to talk to a Skype buddy, you will have to identify this is a Skype buddy (using the origin field), and transcript the MSNP <= 21 command to a MSNP 24 to send it to the Skype server.
So for each user, you will have 2 sockets:
- SOCKET 1: one going to the Messenger client application
- SOCKET 2: one going to the Skype server
This exact same procedure can be used to bridge Facebook, Google Talk, …