gnu-social/plugins/SensitiveContent
Diogo Cordeiro 1049080df5 [CORE] Move public resources to a /public directory
Advantages:
* Increases security by preventing direct access to file/
* We are careful and have a defined('GNUSOCIAL') || die() to prevent
  direct access to GS files, but we may miss one or a vendor/extlib may
  not be as careful
* Improves directory structure - It's more natural to physically
  separate what is public from what are GNU social resources
2019-08-03 17:47:25 +01:00
..
actions Adding SensitiveContent Plugin for nsfw filtering 2016-09-02 11:34:29 +02:00
locale [TRANSLATION] Update POTs and normalize files 2019-06-08 18:41:10 +01:00
LICENSE Adding SensitiveContent Plugin for nsfw filtering 2016-09-02 11:34:29 +02:00
README.md Adding SensitiveContent Plugin for nsfw filtering 2016-09-02 11:34:29 +02:00
SensitiveContentPlugin.php [ROUTES] Allow accept-header specification during router creation 2019-08-03 17:47:16 +01:00

"Sensitive" Content Plugin for GNU Social

About

WARNING: THIS IS ALPHA CODE, IT IS PRERELEASE AND SHOULD ONLY BE INSTALLED TO HELP TEST OR YOU ARE WILLING TO TAKE RISKS.

Create user option to allow a user to hide #NSFW-hashtagged notices behind a blocker image until clicked.

Works for both vanilla GNUSocial and with the Qvitter plugin.

Install

  • Move the project directory to ${GNU_SOCIAL}/plugins
  • Add addPlugin('SensitiveContent'); to your config.php

if you want to customize the blocker image, add a line to your config.php:

$config['site']['sensitivecontent']['blockerimage'] = "/path/to/image.jpg";

Usage

Individual users must go to their Settings page. A new sidebar menu item "Sensitive Content" will be available. User checks or unchecks the checkbox on this page, and presses save.

If you have GNU Social open in other browser tabs, refresh them. If you are using Qvitter, also refresh, but because Qvitter caches notices on the client side, only new sensitive images will be hidden, it will not apply to notices retroactively unless you clear your browser cache.

License

GNU Affero License

Thanks

Thanks in particular to Hannes and Qvitter because looking at his code helped me a lot.

A tiny bit of content was taken from Qvitter to enhance Qvitter with this functionality.