I am using the messenger plugin and blocking a user is no problem if you use the plugin button to send messages.
However, if you respond to an item from a seller on the item page (contact seller) it will still leave a message in messenger even though the user is blocked in blocked users (DB). Would there be a possibility to insert the check(blocked users) that is used in create_thread.php into item.php check_form?
// CHECK FOR BLOCK
if(im_check_block($to_user_id, $from_user_id) == 0) {
//osc_add_flash_error_message( __('User has blocked you. You cannot message this user anymore.', 'instant_messenger'));
header('Location: ' . osc_route_url( 'im-threads'));
return;
}
$thread_id = ModelIM::newInstance()->createThread( $item_id, $from_user_id, $from_user_name, $from_id, $to_user_id, $to_user_name, $to_user_email, $title, 0);
$thread = ModelIM::newInstance()->getThreadById( $thread_id );
im_insert_message($thread['i_thread_id'], nl2br(htmlspecialchars(Params::getParam('im-message', false, false))), 0, Params::getFiles('im-file') );
}
}