I've implement chat with pusher and it works fine. But the problem is everyone can see it, there is no restriction to hide or make it private. How to make it private one to one chat room that other users can't able to see their conversations. I've call widget like this:
jQuery(function() {
var pusher = new Pusher("MY_APP_KEY" , { authEndpoint: '/pusher_auth.php' })
var chatWidget = new PusherChatWidget(pusher, {
appendTo: "#pusher_chat_widget"
});
});
and in pusher_auth.php
global $user;
if ($user->uid)
{
$pusher = new Pusher(APP_KEY, APP_SECRET, APP_ID);
echo $pusher->socket_auth($_POST['channel_name'], $_POST['socket_id']);
}
else
{
header('', true, 403);
echo "Forbidden";
}
so please tell me how its possible, Thanks.