diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 4b02093b3e..fc6c418b2e 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -303,6 +303,64 @@ function apply_onkeypress_event() { jQuery(document).ready(apply_onkeypress_event); +/** +* Run MSN action +*/ +function msn_action(action, address) +{ + // Does the browser support the MSNM object? + var app = document.getElementById('objMessengerApp'); + + if (!app || !app.MyStatus) { + var lang = $('form[data-lang-im-msnm-browser]'); + if (lang.length) { + alert(lang.attr('data-lang-im-msnm-browser')); + } + return false; + } + + // Is MSNM connected? + if (app.MyStatus == 1) { + var lang = $('form[data-lang-im-msnm-connect]'); + if (lang.length) { + alert(lang.attr('data-lang-im-msnm-connect')); + } + return false; + } + + // Do stuff + try { + switch (action) { + case 'add': + app.AddContact(0, address); + break; + + case 'im': + app.InstantMessage(address); + break; + } + } + catch (e) { + return; + } +} + +/** +* Add to your contact list +*/ +function add_contact(address) +{ + msn_action('add', address); +} + +/** +* Write IM to contact +*/ +function im_contact(address) +{ + msn_action('im', address); +} + /** * Run onload functions */ diff --git a/phpBB/styles/prosilver/template/memberlist_im.html b/phpBB/styles/prosilver/template/memberlist_im.html index 68aed0b3dd..8e7842e631 100644 --- a/phpBB/styles/prosilver/template/memberlist_im.html +++ b/phpBB/styles/prosilver/template/memberlist_im.html @@ -3,7 +3,7 @@