function api_read()
{
$this->app_check("get");
if (!isset($this->appAllow["pm"]["read"])) {
$_arr_return = array("alert" => "x050319");
$_arr_logTarget[] = array("app_id" => $this->appRequest["app_id"]);
$_arr_logType = array("pm", "read");
$this->log_do($_arr_logTarget, "app", $_arr_return, $_arr_logType);
$this->obj_api->halt_re($_arr_return);
}
$_arr_userRow = $this->user_check("get");
$_num_pmId = fn_getSafe(fn_get("pm_id"), "int", 0);
if ($_num_pmId < 1) {
$_arr_return = array("alert" => "x110211");
$this->obj_api->halt_re($_arr_return);
}
$_arr_sign = array("act_get" => $GLOBALS["act_get"], $this->userRequest["user_by"] => $this->userRequest["user_str"], "user_access_token" => $this->userRequest["user_access_token"], "pm_id" => $_num_pmId);
if (!$this->obj_sign->sign_check(array_merge($this->appRequest, $_arr_sign), $this->appRequest["signature"])) {
$_arr_return = array("alert" => "x050403");
$this->obj_api->halt_re($_arr_return);
}
$_arr_pmRow = $this->mdl_pm->mdl_read($_num_pmId);
if ($_arr_pmRow["alert"] != "y110102") {
$this->obj_api->halt_re($_arr_pmRow);
}
if ($_arr_pmRow["pm_from"] != $_arr_userRow["user_id"] && $_arr_pmRow["pm_to"] != $_arr_userRow["user_id"]) {
$_arr_return = array("alert" => "x110403");
$this->obj_api->halt_re($_arr_return);
}
$_arr_pmRow["fromUser"] = $this->mdl_user->mdl_read_api($_arr_pmRow["pm_from"]);
$_arr_pmRow["toUser"] = $this->mdl_user->mdl_read_api($_arr_pmRow["pm_to"]);
if ($_arr_pmRow["pm_type"] == "out") {
$_arr_sendRow = $this->mdl_pm->mdl_read($_arr_pmRow["pm_send_id"]);
if ($_arr_sendRow["alert"] != "y110102") {
$_arr_pmRow["pm_send_status"] = "revoke";
} else {
$_arr_pmRow["pm_send_status"] = $_arr_sendRow["pm_status"];
}
}
//unset($_arr_pmRow["alert"]);
$_str_src = fn_jsonEncode($_arr_pmRow, "encode");
$_str_code = $this->obj_crypt->encrypt($_str_src, $this->appRow["app_key"]);
$_arr_return = array("code" => $_str_code, "alert" => $_arr_pmRow["alert"]);
$this->obj_api->halt_re($_arr_return);
}