Version 2.1.4

This commit is contained in:
dmzx
2020-09-11 15:46:11 +02:00
parent 4d7253f0f0
commit 4e2fcec44a
22 changed files with 572 additions and 249 deletions

View File

@@ -212,7 +212,7 @@ class functions
{
if (!$row['session_viewonline'])
{
if (!$can_view_hidden && $row['user_id'] !== $this->user->data['user_id'])
if (!$can_view_hidden && $row['user_id'] != $this->user->data['user_id'])
{
continue;
}
@@ -324,7 +324,7 @@ class functions
$sql_array['WHERE'] = $this->db->sql_in_set('m.user_id', $user_ids);
$offset = 0;
}
else if ($this->mchat_settings->prune_modes[$prune_mode] === 'messages')
else if ($this->mchat_settings->prune_modes[$prune_mode] == 'messages')
{
// Skip fixed number of messages, delete all others
$sql_array['ORDER_BY'] = 'm.message_id DESC';
@@ -499,6 +499,7 @@ class functions
* @var int offset SQL offset
* @var array sql_array Array containing the SQL query data
* @since 2.0.0-RC6
* @deprecated 2.1.4-RC1, to be removed in 2.1.0.
*/
$vars = [
'message_ids',
@@ -523,6 +524,26 @@ class functions
}
}
/**
* Event to modify message rows before being processed and displayed
*
* @event dmzx.mchat.get_messages_modify_rowset
* @var array message_ids IDs of specific messages to fetch, e.g. for fetching edited messages
* @var int last_id The ID of the latest message that the user has, for fetching new messages
* @var int total SQL limit
* @var int offset SQL offset
* @var array rows Array containing message data
* @since 2.1.4-RC1
*/
$vars = [
'message_ids',
'last_id',
'total',
'offset',
'rows',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.get_messages_modify_rowset', compact($vars)));
return $rows;
}