Skip to content

Commit

Permalink
Merge pull request #21 from hivepress/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
hivepress committed Aug 9, 2022
2 parents bfc5ac4 + 59907ab commit 4dd4b74
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion includes/components/class-message.php
Expand Up @@ -258,6 +258,18 @@ public function delete_old_messages() {
]
)->delete();
}

// Delete message cache.
if ( get_option( 'hp_message_allow_monitoring' ) ) {
foreach ( get_users(
[
'role' => 'administrator',
'fields' => 'ids',
]
) as $user_id ) {
hivepress()->cache->delete_user_cache( $user_id, null, 'models/message' );
}
}
}

/**
Expand Down Expand Up @@ -341,7 +353,7 @@ public function set_request_context() {
);

// Cache thread IDs.
if ( count( $thread_ids ) <= 1000 && ( ! get_option( 'hp_message_allow_monitoring' ) || ! current_user_can( 'manage_options' ) ) ) {
if ( count( $thread_ids ) <= 1000 ) {
hivepress()->cache->set_user_cache( get_current_user_id(), 'thread_ids', 'models/message', $thread_ids );
}
}
Expand Down

0 comments on commit 4dd4b74

Please sign in to comment.