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

Add trash #100

Merged
merged 4 commits into from
Jun 15, 2023
Merged

Add trash #100

merged 4 commits into from
Jun 15, 2023

Conversation

Athozus
Copy link
Member

@Athozus Athozus commented Jun 13, 2023

This is a PR for adding trash system to mail, as requested by some players across servers (and myself too). This would complete #38 if merged.

  • Add trash tab on main UI
  • Permit trash a mail
  • Enable or disable trashing via settings (can be still permanent delete)
  • Permit restore mails in there old boxes

Some interesting infos :

  • It adds a previous_boxes value to mail while they're in trash (removed after restoring)
  • To obtain the previous one, a new function called mail.get_message_boxes(playername, msg_id) returns a list of boxes like {"inbox", "outbox"}
  • A parameter delete_in_trash has been added to mail.delete_mail() to avoid trash delete when you just moved the mails.

I'm waiting for your answers to know if you might fix things. Actually tried, it works without crash.

Some screenshots below :

  1. Some mails in my trash
  2. A mail has been restored
  3. Setting is enabled

screenshot_20230613_201426

screenshot_20230613_201416

screenshot_20230613_202151

@Athozus Athozus added the Enhancement New feature or request label Jun 13, 2023
@Athozus Athozus added this to the 1.2.0 milestone Jun 13, 2023
@Athozus Athozus requested review from BuckarooBanzay and S-S-X June 13, 2023 18:22
Copy link
Member

@BuckarooBanzay BuckarooBanzay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't test, only had one issue, otherwise looks good i think 👍

storage.lua Show resolved Hide resolved
@S-S-X
Copy link
Member

S-S-X commented Jun 15, 2023

Didn't test but also didn't spot any obvious issues.

Minor thing but for UI I think it would be better to hide trash tab completely if trash is disabled. Doing so would allow having cleaner main user interface for those who do not want that functionality.

@Athozus
Copy link
Member Author

Athozus commented Jun 15, 2023

Minor thing but for UI I think it would be better to hide trash tab completely if trash is disabled. Doing so would allow having cleaner main user interface for those who do not want that functionality.

Hi, I'm not sure with that one because the trash is still there when you disable auto-trashing. Maybe a Trash button, separated from the Delete one, would be better ? And if the autotrash is enabled, then Trash and Delete button do the same thing.

@Athozus
Copy link
Member Author

Athozus commented Jun 15, 2023

You know what, maybe we should merge know and change minor things based on user experience ?

@S-S-X
Copy link
Member

S-S-X commented Jun 15, 2023

Could be another button, but that suggestion is just based on my personal preference: to not see those buttons/tabs at all because there's a lot of stuff anyway and I would not need those for anything. From this view point adding another button would be even worse.

It is debatable if hiding existing message is bad or good thing, some could actually like that feature. But anyway this isn't really useful reasoning for doing so (but also not against doing so), just a note that in the end hiding existing(mails in trash storage) things might actually be usable feature.

@Athozus
Copy link
Member Author

Athozus commented Jun 15, 2023

Following your suggestions, I merge

@Athozus Athozus linked an issue Jun 15, 2023 that may be closed by this pull request
@Athozus Athozus merged commit 2e106e3 into master Jun 15, 2023
@Athozus Athozus deleted the trash-tab branch June 17, 2023 13:53
Athozus added a commit that referenced this pull request Jun 20, 2023
* Add trash

* Add break at end of deleting loop

* Show trash tab only when trashing enabled

* Update translations
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 this pull request may close these issues.

Trash directory
3 participants