Update and rename api.socialhub.php to api.social.php

This commit is contained in:
Namhyeon Go 2019-04-15 13:41:19 +09:00 committed by GitHub
parent 13d7d49279
commit 79784245d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,14 +1,14 @@
<?php <?php
/** /**
* @file api.socialhub.php * @file api.social.php
* @date 2018-09-26 * @date 2018-09-26
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <gnh1201@gmail.com>
* @brief SocialHub API (refactoring from SocioRouter API) * @brief SocialTools API (refactoring from SocioRouter API)
*/ */
loadHelper("hybridauth.lnk"); loadHelper("hybridauth.lnk");
loadHelper("hybridauth.dbt"); loadHelper("hybridauth.dbt");
loadHelper("socialhub.utl"); loadHelper("socialtools");
set_session_token(); set_session_token();
$_token = get_session_token(); $_token = get_session_token();
@ -130,7 +130,7 @@ try {
if(!$session_flag) { if(!$session_flag) {
// if failed authenticate // if failed authenticate
redirect_uri(get_route_link("api.socialhub", array( redirect_uri(get_route_link("api.social", array(
"provider" => $provider, "provider" => $provider,
"action" => $action, "action" => $action,
"redirect_uri" => $redirect_uri, "redirect_uri" => $redirect_uri,
@ -148,8 +148,8 @@ switch($action) {
case "inbound": case "inbound":
break; break;
case "outbound": case "outbound":
$response = socialhub_send_message($provider, $hauth_adapter, $message); $response = social_send_message($provider, $hauth_adapter, $message);
$object_id = socialhub_parse_object_id($provider, $response); $object_id = social_parse_object_id($provider, $response);
$context = array( $context = array(
"success" => !(!$object_id), "success" => !(!$object_id),
"message" => "Have a nice day", "message" => "Have a nice day",
@ -177,8 +177,8 @@ switch($action) {
); );
break; break;
case "bgworker": case "bgworker":
$response = socialhub_send_message($provider, $hauth_adapter, $message); $response = social_send_message($provider, $hauth_adapter, $message);
$object_id = socialhub_parse_object_id($provider, $response); $object_id = social_parse_object_id($provider, $response);
$context = array( $context = array(
"success" => !(!$object_id), "success" => !(!$object_id),
"message" => "Have a nice day", "message" => "Have a nice day",
@ -199,7 +199,7 @@ switch($action) {
$context = array( $context = array(
"success" => true, "success" => true,
"message" => "Found", "message" => "Found",
"response" => socialhub_get_object($provider, $hauth_adapter, $object_id) "response" => social_get_object($provider, $hauth_adapter, $object_id)
); );
break; break;
default: default: