Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

True Anonymous Posting for privacy and Tag specific anonymous options [WIP] #5

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Yippy
Copy link

@Yippy Yippy commented Dec 22, 2023

Hiya, I'm not sure if this would be helpful in the extension, but the situation is to allow users to anonymously provide question without any link to them personally. This can be useful for suggestion boxes for teams/company, I've used your avatar rule table example to help create this imposter settings on your extension.

New settings for Anonymous Posting

This setting will not interfere with your avatar anonymous, but it will compliment it if people truly don't wish to know who posted. The imposter user profile work best with the tag extension enable, where you can use any user profile to make a discussion or reply to the post.

Here is an example of someone making a suggestion:
Truely anonymous

When responding to the discussion, you can have another user profile to respond,
Respond to Post with another user profile

To-do:

  • Allow multiple tags detection for discussion and post making, currently it will only check the first tag that is available.

  • Fix "The requested resource was not found." where 404 Not Found error is provided for 'Non Approved' or 'Non related' post that is created when using this with Approval extension.
    image

  • Customise the post avatar url image when the tag is already pre-defined when using with composer with default tag for usage with 'flarum-ext-composer-page'.
    Note: this works with selecting the tags in the Compose page too.

Switch between imposters by tags

  • Fix Original discussion user when multiple poster make a post
    image

  • Fix issue for detecting admin that can turn off anonymous override switch

  • Check if Tag extension is enabled, otherwise tags property does not exist

I'm fairly new on Flarum platform, but wanted to help improve it. If you have any tips on my to-do list. Just let me know, or any changes to help improve my code.

…_id is added then resume anonymousAvatar to be used.
…sion or post. Be able to assign different ways for discussion and post, you can assign a make a question user, and an answer user to the discussion.
@clarkwinkelmann
Copy link
Owner

Thanks for your contribution. I fear this might be a bit too complex to maintain for me, so this could be better as a completely new extension. I probably won't be merging this, but I can reconsider when it's finished.

Here are some comments from reading the code:

  • You cannot trust Arr::get($event->data, 'type'), users can provide anything or nothing at all and Flarum ignores the value anyway
  • class_exists(Tag::class) will only tell you the Tags extension is installed, not enabled. When you call $discussion->tags the code will error if the extension is not enabled
  • An event listener callback doesn't need to return $event;, just return;.

@Yippy
Copy link
Author

Yippy commented Jan 23, 2024

Example of working private post viewing

Working example of private viewing post when using a imposter User account to post anonymously, though you need to wait for flarum to improve visibility for locked/private discussion and post.

Requires the following changes:
flarum/core
flarum/framework#3596
My fork Yippy/flarum-core@7cf86dc

flarum/approval
My fork
Yippy/flarum-core@7cf86dc
https://github.com/Yippy/approval/tree/60efa0e7f199c410ca46e14c626a0a7d25d8a4a3

It be nice if there was more control on the privacy options where you can hide locked/private from the discussion list but allow users/members to see the discussion and post when they get redirected/or copied the link.

Amend the composer.json to test this PR with this:

    "require": {
        "clarkwinkelmann/flarum-ext-anonymous-posting": "dev-custom",
        "flarum/approval": "dev-fix-view",
        "flarum/core": "dev-fixprivateview as v1.8.5",
    },
    "repositories": [
        {
             "type": "vcs",
             "url": "https://github.com/Yippy/flarum-ext-anonymous-posting"
        },
        {
             "type": "vcs",
             "url": "https://github.com/Yippy/flarum-core"
        },
        {
            "type": "vcs",
            "url": "https://github.com/Yippy/approval"
        }
    ],

@Yippy
Copy link
Author

Yippy commented Jan 24, 2024

image
Three anonymous options for specific tags

  1. '1+' Entering a valid User ID above 0 will choose an imposter account, non found User account will use default semi-anonymous.
  2. '0' Zero will use the default semi-Anonymous option where Moderators can see poster.
  3. '-1' Negative value will disable anonymous option

Here is an example of tag detections with different anonymous options, the tag 'Share' is set as -1 to allow users to post with their own profile without any anonymous options.
Example of interchangeable options

@Yippy Yippy changed the title True Anonymous Posting for privacy [WIP] True Anonymous Posting for privacy and Tag specific anonymous options [WIP] Jan 24, 2024
@Yippy
Copy link
Author

Yippy commented Jan 29, 2024

@clarkwinkelmann How would I check if the extension has been enabled?

Fixed Avatar preview for imposter user for specific tag.
Fixed avatar preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants