mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-12-27 22:18:58 +00:00
Automatically update last activity time of a call
This commit is contained in:
parent
10b50d4664
commit
b94c859a16
@ -86,6 +86,9 @@ class CallsController {
|
||||
if(!$call->isValid())
|
||||
Rest_fatal_error(500, "Could not get information about the call!");
|
||||
|
||||
//Update last activity of the call
|
||||
components()->calls->updateLastActivity($call_id);
|
||||
|
||||
return self::CallInformationToAPI($call);
|
||||
}
|
||||
|
||||
|
@ -99,6 +99,27 @@ class CallsComponents {
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update last activity time of a conversation
|
||||
*
|
||||
* @param $call_id The ID of the call to update
|
||||
* @return bool TRUE for a success / FALSE else
|
||||
*/
|
||||
public function updateLastActivity(int $call_id) : bool {
|
||||
|
||||
return db()->updateDB(
|
||||
self::CALLS_LIST_TABLE,
|
||||
"id = ?",
|
||||
array(
|
||||
"last_active" => time()
|
||||
),
|
||||
array(
|
||||
$call_id
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next call for a user
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user