mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 00:25:18 +00:00
Can update the content of a conversation message
This commit is contained in:
@ -552,6 +552,24 @@ class Conversations {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a message
|
||||
*
|
||||
* @param ConversationMessage $message Information about the message to update
|
||||
* @return bool TRUE for a success / FALSE else
|
||||
*/
|
||||
public function updateMessage(ConversationMessage $message) : bool {
|
||||
|
||||
$modifs = array();
|
||||
|
||||
//Check if the content of message has to be updated
|
||||
if($message->has_message())
|
||||
$modifs["message"] = $message->get_message();
|
||||
|
||||
//Peform update
|
||||
return db()->updateDB(self::MESSAGES_TABLE, "id = ?", $modifs, array($message->get_id()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last messages of a conversation
|
||||
*
|
||||
|
Reference in New Issue
Block a user