Video Messenge -- Button issue

Edit: Video Messenger -- Button issue

How can I stop the 'video chat' button appearing for members that don't have permissions to use 'video messenger' ?!

I have noticed that if a user with permission to use video messenger visits a members profile without permission >> the 'video chat' button is there even though that member does not have access to it / no permission to use!

DedicatedServer4You.com -- BIGGEST Range of Dedicated Servers at the Lowest Price!
Quote · 8 May 2013

Hello

By default Dolphin checks the following:

1. Current member is logged in.
2. Current member has permissions to use messenger.
3. Current member wasn't blocked by recipient.
4. Current member views a profile of a different member.
5. Recipient is online. 

Looks like you need to check whether Recipient has permissions to use messenger. You may do it via a simple custom modification in modules/boonex/messenger/classes/BxMsgModule.php file -> serviceGetActionLink function. The first 2 lines of code should be replaced with something like this

$aResult = checkAction($iMemberId, ACTION_ID_USE_MESSENGER);
$aResultRecipient = checkAction($iProfileId, ACTION_ID_USE_MESSENGER);
if($iMemberId > 0 && get_user_online_status($iProfileId) && $aResult[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED && $aResultRecipient [CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED && $iMemberId != $iProfileId && !isBlocked($iProfileId, $iMemberId))

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 8 May 2013

 OK ... so will this code stop the button showing for users with no permission  even if a user with permission is is viewing their profile etc ?

Hello

By default Dolphin checks the following:

1. Current member is logged in.
2. Current member has permissions to use messenger.
3. Current member wasn't blocked by recipient.
4. Current member views a profile of a different member.
5. Recipient is online. 

Looks like you need to check whether Recipient has permissions to use messenger. You may do it via a simple custom modification in modules/boonex/messenger/classes/BxMsgModule.php file -> serviceGetActionLink function. The first 2 lines of code should be replaced with something like this

$aResult = checkAction($iMemberId, ACTION_ID_USE_MESSENGER);
$aResultRecipient = checkAction($iProfileId, ACTION_ID_USE_MESSENGER);
if($iMemberId > 0 && get_user_online_status($iProfileId) && $aResult[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED && $aResultRecipient [CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED && $iMemberId != $iProfileId && !isBlocked($iProfileId, $iMemberId))

 

DedicatedServer4You.com -- BIGGEST Range of Dedicated Servers at the Lowest Price!
Quote · 8 May 2013

Yes. The button won't be displayed to a user if recipient don't have permissions to use Messenger.

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 8 May 2013

I did not even know there was a video messenger.

Geeks, making the world a better place
Quote · 8 May 2013

 I will try this now ... thank you very much !

Yes. The button won't be displayed to a user if recipient don't have permissions to use Messenger.

 

DedicatedServer4You.com -- BIGGEST Range of Dedicated Servers at the Lowest Price!
Quote · 8 May 2013

 I will try this now ... thank you very much !

Yes. The button won't be displayed to a user if recipient don't have permissions to use Messenger.

 You are welcome! :)

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 8 May 2013

ok this is the original code for that function ... I just replace the bold part ? :-

function serviceGetActionLink($iMemberId, $iProfileId)
    {
        $aResult = checkAction($iMemberId, ACTION_ID_USE_MESSENGER);
        if($iMemberId > 0 && get_user_online_status($iProfileId) && $aResult[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED && $iMemberId != $iProfileId && !isBlocked($iProfileId, $iMemberId))
            $sResult = _t('_messenger_actions_item');
        else
            $sResult = '';

        return $sResult;

DedicatedServer4You.com -- BIGGEST Range of Dedicated Servers at the Lowest Price!
Quote · 8 May 2013

I changed the bold part above with the code provided and it was causing my site to load blank pages ...

Please advise ... regards, Josh D.

DedicatedServer4You.com -- BIGGEST Range of Dedicated Servers at the Lowest Price!
Quote · 8 May 2013

Hello

As I wrote you need to replace the first 2 lines of code. So, you need to replace the following 2 lines

$aResult = checkAction($iMemberId, ACTION_ID_USE_MESSENGER);
if($iMemberId > 0 && get_user_online_status($iProfileId) && $aResult[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED && $iMemberId != $iProfileId && !isBlocked($iProfileId, $iMemberId))

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 8 May 2013

 Ahh yeah ... sorry!  I see now  ... Thanks again AntonLV

As I wrote you need to replace the first 2 lines of code. So, you need to replace the following 2 lines

$aResult = checkAction($iMemberId, ACTION_ID_USE_MESSENGER);
if($iMemberId > 0 && get_user_online_status($iProfileId) && $aResult[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED && $iMemberId != $iProfileId && !isBlocked($iProfileId, $iMemberId))

 

DedicatedServer4You.com -- BIGGEST Range of Dedicated Servers at the Lowest Price!
Quote · 8 May 2013

OMG AntonLV I love yo right now man! seriously ... I have been trying to solve that issue for ages! It didn't make sense to me why that button was still visible for members without permission ...

Your code works PERFECT :)

DedicatedServer4You.com -- BIGGEST Range of Dedicated Servers at the Lowest Price!
Quote · 8 May 2013

Hello.
You are very welcome! It's great that the problem was resolved and you don't need to waste your time. :)

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 8 May 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.