this post was submitted on 21 Aug 2023
1 points (100.0% liked)

Lemmy Code / App Technical

1 readers
1 users here now

The code and application behind Lemmy. Beta testing new releases, API coding, custom changes, adding new features, developers

See also: [email protected] community, it's not always clear which one to put a topic into. "lemmycode" I'm trying to be more into actual code change proposals.

[email protected]

founded 1 year ago
MODERATORS
 

I've been pondering the way language works as an attribute in community.

Right now there are two attributes to highlight: NSFW and "only moderators can post".

There is an active pull request to add "only the home instance can allow posting", sort of a variation on the "only moderators" can post: https://github.com/LemmyNet/lemmy/pull/3889

Which is the 20 source file changes for the new feature.

I envision that new attributes will keep coming up, and I see need for an additonal one to make cleaner the [email protected] feature.

Observation

A general 'attributes' table could be created like the existing language table. And then duplicate the logic in Community Edit for picking the languages associated with a community... except you are picking the attributes associated with a community.

This could possibly cut down on the amount of lemmy_server code changes for each new attribute?

I envision in the future there will be 'members only can post' (subscribed only), and variations of NSFW that people want to implement... and it could be done by not having to add new PostgreSQL columns to tables... and just a general scheme to insert a new registered attribute ID...

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

I could see this attribute picking for various opt-in features.... "allow voting plugin posts", "text-only posts, no url link post", "posting hours only allowed in daytime North America when mods are around", "postings only allowed on weekends and holidays!"

The API structure is already there to inform which of the 184 human languages a community has picked. So that gives a sense of just how many of these attributes can be created.