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

Spam features #102

Closed
3 tasks done
Athozus opened this issue Jun 18, 2023 · 12 comments · Fixed by #128
Closed
3 tasks done

Spam features #102

Athozus opened this issue Jun 18, 2023 · 12 comments · Fixed by #128
Labels
Enhancement New feature or request
Milestone

Comments

@Athozus
Copy link
Member

Athozus commented Jun 18, 2023

Add the following abilities :

@Athozus Athozus added the Enhancement New feature or request label Jun 18, 2023
@Athozus Athozus added this to the 1.3.0 milestone Jun 18, 2023
@OgelGames
Copy link
Contributor

An option to block/mute a player from sending mail would also be good.

@S-S-X
Copy link
Member

S-S-X commented Jun 25, 2023

An option to block/mute a player from sending mail would also be good.

I would recommend integrating beerchat mute for this when beerchat is installed and only add custom implementation if beerchat isn't available (if adding at all in that case).

@Athozus
Copy link
Member Author

Athozus commented Dec 16, 2023

I would recommend integrating beerchat mute for this when beerchat is installed and only add custom implementation if beerchat isn't available (if adding at all in that case).

The mail setting should be synced to the beerchat one (for example is beerchat from a server). In the settings page, fields should modify also beerchat. That's pretty simple but I wanted to explain how I'm going to proceed.

Clicking on mute field (don't know yet what it's going to be) should invoke a mail own function, and inside this function, it should check for beerchat then edit the setting. Same for getting the muting state, it should first check if beerchat is installed then sync muting settings.

EDIT: settings mega-table should receive a new parameter kind of sync, I don't really know how that could be implemented, but starting exceptions would result in a bad modularity (the reason why I reworked settings). Let me know if you have ideas.

@S-S-X
Copy link
Member

S-S-X commented Dec 17, 2023

With beerchat pretty much only actual interface is beerchat.has_player_muted_player(name, other_name) or beerchat.allow_private_message(name, target). Both of these returns truth and that's it.

I think significant thing here is that beerchat mute is not implemented at single definite location and already has multiple producers (mute implementations / data sources) and consumers (mute lookups).

For example, jailed players are automatically muted unless recipient has deliberately joined jail discussion. Thing is, there's no single definite setting you could ever sync for muting in beerchat.

To create producer (control beerchat muting through mail mod) you'd have to go with beerchat.register_callback( ... ) probably either with "before_send_pm" or "before_check_muted" events.

@Athozus
Copy link
Member Author

Athozus commented Dec 17, 2023

Yes I've already looked a bit at the code of mute plugin, so if I had understood it I just have to use beerchat.has_player_muted_player(), as you said. I think I will, when saving or getting a setting, check if this setting has a sync function (maybe "transmit" for giving the new setting to beerchat) then proceed. I will probably use those functions for "transmit" function.

@S-S-X
Copy link
Member

S-S-X commented Dec 17, 2023

I think I will, when saving or getting a setting, check if this setting has a sync function (maybe "transmit" for giving the new setting to beerchat) then proceed. I will probably use those functions for "transmit" function.

Not sure what you exactly mean by sync or transmit. If you could elaborate a bit how'd you like it work from player/user perspective I might be able to suggest some possible ways to implement it.

Or could maybe just talk about this a bit at mt-mods modding chat, might help understanding a bit better how you'd like it and what functionality you'd exactly want for this on mail mod side (and possibly on beerchat's side).

@Athozus
Copy link
Member Author

Athozus commented Dec 17, 2023

What do I mean by those terms (only proposal names) :

  • sync : other mod (in this case beerchat) -> mail
  • transmit : mail -> other mod

Because both should have different way to exchanges settings. But this is simple as that. May be in a util/shared_settings.lua file, or something like that.

@S-S-X
Copy link
Member

S-S-X commented Dec 17, 2023

What would be the exact things you'd like to sync and transmit?

@Athozus
Copy link
Member Author

Athozus commented Dec 17, 2023

What would be the exact things you'd like to sync and transmit?

  • sync : get data from beerchat (using functions)
  • transfer (yes your previous name was better imo) : transfer data to beerchat, eventually select the right action to do (depending on multiple types of mutes in beerchat)
  • Both : check if beerchat is present before executing anything.

This is kind of simple for beerchat, however for some optional other mods it might be more complicated.

@S-S-X
Copy link
Member

S-S-X commented Dec 17, 2023

  • sync : get data from beerchat (using functions)

If restricting scope to this mail mod issue, what data you think would be needed from beerchat?

  • transfer (yes your previous name was better imo) : transfer data to beerchat, eventually select the right action to do (depending on multiple types of mutes in beerchat)

Again restricting scope to this issue, what data you think would have to be transferred to beerchat and what should it do with this data?

Is this basically about sending sender and recipent name toward beerchat and getting back boolean which tells if sending is allowed? In other words doing local is_allowed = beerchat.allow_private_message(sender, recipient).

Or is this about sending something else that beerchat should store somewhere for later use or somehow use this data for some configuration or something like that?

@Athozus
Copy link
Member Author

Athozus commented Dec 17, 2023

Yes the setting will be synchronized as you suggested so it will only implement functions to share the setting to beerchat. When any modification is done from the mail side, it is given to beerchat (transfer). When the setting is used/checked, it first checks if beerchat has a new version of the setting (sync).

@S-S-X
Copy link
Member

S-S-X commented Dec 17, 2023

Yes the setting will be synchronized as you suggested so it will only implement functions to share the setting to beerchat. When any modification is done from the mail side, it is given to beerchat (transfer). When the setting is used/checked, it first checks if beerchat has a new version of the setting (sync).

Now I think I get it, basically it would be a configuration synchronization between the mods.

However I still don't understand what exactly would have to be synchronized, can you elaborate: what would be the things that needs to be synchronized between the mods? Or is this still something you also have no idea about and needs some planning?

@Athozus Athozus linked a pull request Dec 31, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants