Commit Graph

38 Commits

Author SHA1 Message Date
Athozus
1dde4097f9
Fix empty mailing lists 2024-03-24 17:38:54 +01:00
Athozus
ccf07b50e2
Simplify marking mail property with a local function in storage.lua 2024-03-22 23:04:31 +01:00
Athozus
1c5e4b6cd6
Harmonize function names with snake case 2024-03-22 22:43:26 +01:00
y5nw
2694ffa2dc
Cleanly handle player mailling lists (#140)
* Fix server hanging for certain recipient names

* Disallow recursive maillist inclusion

* Disallow sending to empty recipient

* Complement testcases
2024-03-22 21:59:04 +01:00
Athozus
103c4ae441 Add mute list setting
Add sharing between mute_list and beerchat

Add check for mute list
2024-02-01 14:23:03 +01:00
Athozus
48fc8470f5 Add storage function to (un)mark message as spams 2024-02-01 14:23:03 +01:00
Athozus
75510d2551 Add checks utils 2024-02-01 14:23:03 +01:00
Athozus
46012a2b28
Add support for shared settings (#127)
* Add support for shared settings

* Optimize stored setting value getting

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* Avoid false for default transfer value

In set_setting, to eventually transfer to another mod. Suggested by S-S-X in #127

---------

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
2024-02-01 10:18:55 +01:00
BuckarooBanzay
721d882c26 evict cached storage entries periodically
fixes synchronization issues if other applications write directly to the mail-entries in the mod-storage
2024-01-13 18:18:16 +01:00
Athozus
e5996469fb
Reworked settings (#111)
* Store globally settings (type and default value)

* Add settings groups

* Generate settings pages with global storage

Add saving, generate selection idxs from settings list, order settings via index value in each group of settings

* Rewrite setting store

No code change, only format

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* Remove tabs from settings groups

Use spaces instead

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* Use table.copy() minetest api function

* Better formatting for setting tooltip

Using inline instead of multiples lines to add tooltip attached to setting into formspec

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

---------

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
2023-09-14 20:35:30 +02:00
Athozus
be8f0e590f
Add a setting to choose date format 2023-07-17 16:45:57 +02:00
Athozus
0248b051ef
Add a setting for automatic marking read
When a message is opened
2023-07-16 22:59:56 +02:00
Athozus
f5198b9187
Add empty trash button 2023-06-20 16:04:18 +02:00
BuckarooBanzay
8c20aeba5b cache storage entries and batch them for write-back 2023-06-19 17:25:43 +02:00
Athozus
2e106e3df7
Add trash (#100)
* Add trash

* Add break at end of deleting loop

* Show trash tab only when trashing enabled

* Update translations
2023-06-15 19:28:04 +02:00
Buckaroo Banzai
de07f6b24b fix mail.delete_mail (again) 2023-06-06 19:58:41 +02:00
Buckaroo Banzai
42db40b7a7
partial fox for #97 (#98)
* partial fox for #97

* Fix #97

---------

Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
Co-authored-by: Athozus <athozus@gmail.com>
2023-06-05 10:25:34 +02:00
Athozus
5e24b9274f
Fix half deletion of messages 2023-06-02 22:55:11 +02:00
Athozus
955f7d123f
Add sound notification (#86)
* Add sound notification

* Change sound

Update translations
2023-05-06 21:30:18 +02:00
Athozus
95ab299016
Fix strings (translations and checks) 2023-05-05 13:13:09 +02:00
Athozus
720029a73e
Add settings (#85)
* Add settings

* Fix luacheck

* Fix unupdatable sorting fields values (settings)

* Better settings names

* Better sort settings behaviour

* Rework set_setting()

* Rework settings storage

* Better get sorting filters (inbox/outbox)

* Fix reseting/saving settings
2023-05-05 11:38:19 +02:00
Athozus
47b18f2138
Update HUD after deleting (fix #79) 2023-04-28 16:25:24 +02:00
Athozus
7e17ff4805 Fix lag with multiple selection action (#69)
Reduce significantly time of action on several messages (20 sec to less than 0.5) (#69)
2023-04-15 22:10:45 +02:00
SX
67bda9a788
Simplify sorting and make it more readable (#58)
* Simplify sorting and make it more readable

* Make sorter local

* Fix sorters dropdowns go back to default

* Fix luacheck

* Move sorting dropdown values to selected_idxs

* Show previous sorters when going back from message/contacts/...

* Use shallow copy instead of original table

* Open mail interface with previous tab/dropdowns

* Rework mail.sort_messages

* Combine filter and sort, make filtering safe

* Remove checks and logging from sorters

---------

Co-authored-by: Athozus <athozus@gmail.com>
2023-04-10 15:16:23 +03:00
Athozus
da05b5d108
Message filters/sorters (#56)
* Add sorters for inbox/outbox

* Add ascending/descending, fix selection issue

* Add filters

* Update translations

* Fix UI

* Fix luacheck

* Fix fields disappearing after clicking on tabs/buttons

* Fix luacheck (2)

* Fix first message not sorted correctly
2023-04-07 10:19:30 +02:00
Athozus
a11dc89a85
Fix variable name 2023-04-03 16:47:52 +02:00
Athozus
c36ae2fe4e
Update HUD in mark read function 2023-04-03 16:37:47 +02:00
Athozus
418cda1adc
Fix maillists issues (#49)
* Fix maillist deletion

* Fix duplicating of maillist while changing its name

* Permit sub-lists

* Fix messages with no mailing lists
2023-04-02 10:37:58 +02:00
Athozus
6fb46be679
Fix deletion in inbox trivial issue (#35) 2023-04-01 10:38:00 +02:00
Athozus
0ea3777b51
Implement drafts (#31)
* Add drafts

* Update translations

* Fix luacheck

* Fix luacheck (2)
2023-03-31 17:14:52 +02:00
Athozus
b3e0c158f7
View sent messages (new database, add maillists) (#26)
* Add tabheader & sent formspec

* Add show_sent function and show sent messages

* Remove comment on selected_idxs test (show_sent)

* Add variable to keep the previous tab instead of going back to the first one

* Remove index variable verification on mark read/unread buttons since they are necessarily clicked on inbox view

* Resize messages table to be aligned with close button at the bottom

* Show date time (#27)

* Show date in message reading

* Fix wrong registered dates

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* Rework header layout to add better space for date

---------

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* Add insertion of messages into global storage mail.messages.json

* Receive player messages from global storage

* Add automatic generation of status for a new message (unread)

* Mark read/unread/delete a message

* Fix messages loading

* Show every message received/sent via specific functions

* Use global contacts functions and reconfigure add/remove functions

* Create mail lists formspec based on contacts

* Add deleting contact

* Add ability to create mail lists

* Fix inability to edit contact

* Rework on editing/deletion of contacts/maillists

* Add at symbol as prefix on maillists view

* Add ability to choose default status (to/cc/bcc)

Signed-off-by: Athozus <athozus@gmail.com>

* Add ability to add multiples players and choose their default status (to/cc/bcc)

* Add ability to use maillist in messages and receive messages from them

* Fix repetition of code causing a crash

* Avoid multiples occurences of the same messages due to player both in maillist and receivers

* Fix selected indexes for inbox/sent

Now separated, fixed show_message() func selection of id from table dcl/read btn

* Fix many issues related to maillists

Notably : edit, delete, selection, creation, registration of players

* Set up database version v3 and its migration from v2

+ Check versions to choose v1->v2 or v2->v3

* Fix mtt.lua

Due to old function getMessages(), replaced by getPlayerInboxMessages()

* Add 10 seconds security to mtt.lua

* Fix migrate.lua non-declared variable

* Send msg table with string keys in mtt

* Better log messages

* Add message check

* Fix mtt crash

* Better syntax in storage.lua

* Fix bcc forgotten in mail.send()

* Fix mtt issue

* Better compatibility for messages storage

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* Replace mail.split by builtin func

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* Use builtin split func

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* Use builtin split func in storage.lua

* re-add mtt if

* luacheck on PR

* add check for an ancient issue with missing `to` field

* Fix luacheck on storage.lua

* Fix luacheck warnings in migrate.lua

* Fix luacheck warnings in gui.lua

* Fix luacheck (too long lines) in storage.lua

* Unused loop values in migrate.lua

* Whitespace line in gui.lua

* Whitespace line (init.lua)

* Whitespace line (api.lua)

* Significantly improve maillist behaviour

Replace maillist by its players when sending a message
List of players separated by ,
Avoid doublons when editing more than 2 times a maillist

* Fix luacheck

* Fix table insertions at first index when no needed

* Use funcs

* Do not add maillist as a new contact when sending a mail

* Fix removing elements from tables

* Check maillists not added in contacts

* storage rewrite wip

* storage format docs

* refactor ui components

* show_compose cleanup

* remove unused channel.lua

* error -> err

* status refactoring

* contacts refactoring

* maillist refactoring

* docs

* tests

* fix some issues

* re-enable migrations

* contributors

* prefix mail entries in the mod storage

* internalize old mail-paths to migration module

* add v1 and v2 player db examples and migration test

* Ui improvements & fixes

Move events code (if fields.x then) to events.lua (instead of inbox.lua), fix tab selection when going backward

* Show most recent messages at first (outbox)

* unified-inv fix

---------

Signed-off-by: Athozus <athozus@gmail.com>
Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
2023-03-29 17:25:01 +02:00
BuckarooBanzay
d1254a7c5b check messages for missing time field 2022-08-06 20:23:35 +02:00
BuckarooBanzay
3327be9bf4 consistent function syntax 2022-08-02 14:58:42 +02:00
BuckarooBanzay
4b496a1e61 order received mails by date descending
fixes #21
2022-08-02 14:49:22 +02:00
BuckarooBanzay
51e80c6d9d satisfy luacheck 2020-10-13 19:20:18 +02:00
Peter Nerlich
93d1af947c always sort contacts alphabetically
- introduce pairsByKeys() (from http://www.lua.org/pil/19.3.html but adding current index and total length as iterator return values)
- use pairsByKeys() everywhere, where contacts are iterated over (for now only when displaying in gui.lua) so the order stays the same although the structure is a hashmap
- correctly update selected position when adding/removing contacts to TO/CC/BCC fields
- remove print statements in storage.lua
2020-08-15 13:52:26 +02:00
Peter Nerlich
f82c3d2b82 add contacts dir, leave mail files as is
- restructured storage.lua so reading/writing json is not duplicated
- when a player joins and has no contacts file yet, automatically add all players he wrote to
2020-08-10 18:29:11 +02:00
NatureFreshMilk
ca88374fbd separated from webmail mod 2019-09-16 08:06:54 +02:00