Commit Graph

23 Commits

Author SHA1 Message Date
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
y5nw
570cf788ec
Implement non-player recipients (#131)
* Implement non-player recipients

* Add API callback specifically for players receiving mail

* Exclude sender from (mailing list) recipients

* Complement test

* Fixup typos in complemented test

* Expand aliases at toplevel if the current expansion is at toplevel

This should allow players to send mail to their own aliases

* Also test on_(player_)receive callbacks

* Fix oversight in test case
2024-02-01 20:46:26 +01:00
Athozus
bfe0ef2711 Initial implementation of spam check
It checks during the sends if there are spam warnings then give to the message an attribute spam=true (only for receivers)
2024-02-01 14:23:03 +01:00
aBlueShadow
94f37da092 add sfinv_buttons compatibility 2024-01-13 16:28:14 +01:00
Athozus
9990d56004
Add checks for cc/bcc/subject in mail.send() and mail.save_draft() api functions
Fix api new checks failed builds
2023-07-20 00:49:58 +02:00
Athozus
bfd3692280
Remove subject length limitation
Truncated with ... in message list, that don't break the formspec layout anymore
2023-06-18 16:45:52 +02:00
Athozus
955f7d123f
Add sound notification (#86)
* Add sound notification

* Change sound

Update translations
2023-05-06 21:30:18 +02:00
Athozus
5e3cfedc5e
Translate formatted strings 2023-05-05 16:05:07 +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
56e86cd5e1
Fix message notifications (#46)
* Fix mail notification on login

* Fix HUD notification
2023-04-01 19:14:53 +02:00
Athozus
4d4fd90eee
Minor fixes (#34)
* Minor fixes

* Security fix

* Minor button fix
2023-03-31 18:08:51 +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
flux
f7a7ef361a
use canonical_name if it is available; report error when trying to send mail to non-existent players 2023-02-23 13:41:41 -08:00
BuckarooBanzay
18592b0a35 more sanity checks and default values 2020-09-20 20:18:34 +02:00
BuckarooBanzay
64262c95a6 map legacy "dst" field to "to"
fixes https://github.com/pandorabox-io/pandorabox.io/issues/542
2020-09-19 13:22:33 +02:00
Peter Nerlich
8beec340d3 revert renaming "sender" to "from" to maintain backwards compatibility 2020-08-12 12:05:12 +02:00
Peter Nerlich
ea0de708da fix some things, adjust GUI elements
- messages are now actually sent (bug in parse player list)
- no more crashes on sending mail (forgot to make variables local)
- actually handle CC and BCC fields instead of leaving them empty, duh
- make new functions be under the mail namespace
- add util functions to ensure the new format, parse and player list as well as checking whether a player is in that list or not
- rearrange some GUI elements (tighter spacing, grouping, increase window height to be consistent)
- convert mails to new format only as needed (old mails stay intact in case someone reverts to old version)
- mails are shaded differently in inbox, depending on whether the player is in the TO field
- FROM, TO and CC fields are all displayed when reading a mail
- add "Reply All" button (TO includes all original recipients plus the sender, but excluding the player himself, while adopting the CC field. To contrast: "Reply" just sets the original sender as TO and leaves the rest empty)
- move reply, replyall and forward to their own functions in GUI (was duplicated for inbox and show mail)
- don't needlessly set messages table when we do nothing but go back
2020-08-10 12:15:34 +02:00
Peter Nerlich
f5387e2750 fix variable to be local 2020-07-31 19:08:31 +02:00
Peter Nerlich
522eb0a9ee rename api, add cc and bcc, handle multiple players
rename: src -> from, dst -> to
2020-07-31 12:36:28 +02:00
NatureFreshMilk
74b18f38eb updated files 2019-09-16 08:15:43 +02:00
NatureFreshMilk
ca88374fbd separated from webmail mod 2019-09-16 08:06:54 +02:00