Update api.socialhub.php
This commit is contained in:
parent
e6e76ac940
commit
96581dfda1
|
@ -137,9 +137,24 @@ switch($action) {
|
||||||
case "inbound":
|
case "inbound":
|
||||||
break;
|
break;
|
||||||
case "outbound":
|
case "outbound":
|
||||||
$hauth_adapter->setUserStatus($message);
|
$response = socialhub_send_message($provider, $hauth_adapter, $message);
|
||||||
|
$object_id = socialhub_parse_object_id($provider, $response);
|
||||||
|
$context = array(
|
||||||
|
"success" => !(!$object_id),
|
||||||
|
"message" => "Have a nice day",
|
||||||
|
"user_id" => $user_id,
|
||||||
|
"provider" => $provider,
|
||||||
|
"object_id" => $object_id
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case "new":
|
case "new":
|
||||||
|
$context = array(
|
||||||
|
"success" => true,
|
||||||
|
"message" => "Authenticated",
|
||||||
|
"user_id" => $user_id,
|
||||||
|
"provider" => $provider,
|
||||||
|
"profile" => $hauth_profile,
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case "login":
|
case "login":
|
||||||
$context = array(
|
$context = array(
|
||||||
|
@ -150,6 +165,18 @@ switch($action) {
|
||||||
"profile" => $hauth_profile,
|
"profile" => $hauth_profile,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case "bgworker":
|
||||||
|
$response = socialhub_send_message($provider, $hauth_adapter, $message);
|
||||||
|
$object_id = socialhub_parse_object_id($provider, $response);
|
||||||
|
$context = array(
|
||||||
|
"success" => !(!$object_id),
|
||||||
|
"message" => "Have a nice day",
|
||||||
|
"id" => $user_id,
|
||||||
|
"connection" => $connection_id,
|
||||||
|
"provider" => $provider,
|
||||||
|
"object_id" => $object_id
|
||||||
|
);
|
||||||
|
break;
|
||||||
case "cancel": // listen cancel authenticated callback
|
case "cancel": // listen cancel authenticated callback
|
||||||
break;
|
break;
|
||||||
case "delete": // listen delete ping
|
case "delete": // listen delete ping
|
||||||
|
@ -159,5 +186,5 @@ switch($action) {
|
||||||
show_errors();
|
show_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
echo json_encode($context);
|
echo json_encode($context);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user