First implementation #1
@@ -36,7 +36,7 @@ class MatrixConnection
|
|||||||
curl_setopt($handle, CURLOPT_POSTFIELDS, json_encode($send_message));
|
curl_setopt($handle, CURLOPT_POSTFIELDS, json_encode($send_message));
|
||||||
curl_setopt($handle, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
|
curl_setopt($handle, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
|
||||||
|
|
||||||
$response = exec_curl_request($handle);
|
$response = $this->exec_curl_request($handle);
|
||||||
return isset($response["event_id"]);
|
return isset($response["event_id"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ class MatrixConnection
|
|||||||
curl_setopt($handle, CURLOPT_TIMEOUT, 60);
|
curl_setopt($handle, CURLOPT_TIMEOUT, 60);
|
||||||
curl_setopt($handle, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
|
curl_setopt($handle, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
|
||||||
|
|
||||||
$res = exec_curl_request($handle);
|
$res = $this->exec_curl_request($handle);
|
||||||
return !(isset($res["errcode"]) && $res["errcode"] == "M_UNKNOWN");
|
return !(isset($res["errcode"]) && $res["errcode"] == "M_UNKNOWN");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ class MatrixConnection
|
|||||||
curl_setopt($handle, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
|
curl_setopt($handle, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
|
||||||
curl_setopt($handle, CURLOPT_POSTFIELDS, json_encode($data));
|
curl_setopt($handle, CURLOPT_POSTFIELDS, json_encode($data));
|
||||||
|
|
||||||
return exec_curl_request($handle);
|
return $this->exec_curl_request($handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
function exec_curl_request($handle)
|
function exec_curl_request($handle)
|
||||||
|
|||||||
Reference in New Issue
Block a user