public function extra_send_message($message, $network, $account_id, $message_id) { // save this message in the database as a new comment. // set the 'private' flag so we know this comment has been added externally to the API scrape. $shub_message = new shub_message(false, false, $message_id); $existing_comments = $shub_message->get_comments(); shub_update_insert('shub_message_comment_id', false, 'shub_message_comment', array('shub_message_id' => $shub_message->get('shub_message_id'), 'private' => 1, 'message_text' => $message, 'time' => time(), 'shub_user_id' => !empty($_SESSION['shub_oauth_envato']['shub_user_id']) ? $_SESSION['shub_oauth_envato']['shub_user_id'] : $shub_message->get('shub_user_id'))); // mark the main message as unread so it appears at the top. $shub_message->update('shub_status', _shub_MESSAGE_STATUS_UNANSWERED); $shub_message->update('last_active', time()); // todo: update the 'summary' to reflect this latest message? $shub_message->update('summary', $message); // todo: post a "Thanks for providing information, we will reply soon" message on Envato comment page }