Add trash (#100)

* Add trash

* Add break at end of deleting loop

* Show trash tab only when trashing enabled

* Update translations
This commit is contained in:
Athozus 2023-06-15 19:28:04 +02:00 committed by GitHub
parent de07f6b24b
commit 2e106e3df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 454 additions and 201 deletions

View File

@ -16,6 +16,7 @@ mail = {
inbox = {}, inbox = {},
outbox = {}, outbox = {},
drafts = {}, drafts = {},
trash = {},
contacts = {}, contacts = {},
maillists = {}, maillists = {},
to = {}, to = {},
@ -32,7 +33,8 @@ mail = {
hud_notifications = {}, hud_notifications = {},
sound_notifications = {}, sound_notifications = {},
unreadcolorenable = {}, unreadcolorenable = {},
cccolorenable = {} cccolorenable = {},
trash_move_enable = {}
}, },
message_drafts = {} message_drafts = {}
@ -58,6 +60,7 @@ dofile(MP .. "/ui/mail.lua")
dofile(MP .. "/ui/inbox.lua") dofile(MP .. "/ui/inbox.lua")
dofile(MP .. "/ui/outbox.lua") dofile(MP .. "/ui/outbox.lua")
dofile(MP .. "/ui/drafts.lua") dofile(MP .. "/ui/drafts.lua")
dofile(MP .. "/ui/trash.lua")
dofile(MP .. "/ui/message.lua") dofile(MP .. "/ui/message.lua")
dofile(MP .. "/ui/events.lua") dofile(MP .. "/ui/events.lua")
dofile(MP .. "/ui/contacts.lua") dofile(MP .. "/ui/contacts.lua")

View File

@ -13,37 +13,19 @@ BCC=BCC
Cancel=Abbrechen Cancel=Abbrechen
Save draft=Entwurf Speichern Save draft=Entwurf Speichern
Send=Senden Send=Senden
CC=CC
New=Neu
Delete=Löschen
Edit=Bearbeiten
Name=Name
No drafts=Keine Entwürfe No drafts=Keine Entwürfe
To=An
Subject=Betreff
Player name=Spielername Player name=Spielername
That name is already in your contacts= That name is already in your contacts=
The contact name cannot be empty.= The contact name cannot be empty.=
Note=Notiz
Back=Zurück
Save=Speichern
Maillist name=Verteilerlistenname Maillist name=Verteilerlistenname
Desc=Beschreibung Desc=Beschreibung
Players=Spieler Players=Spieler
That name is already in your mailing lists.= That name is already in your mailing lists.=
The mailing list name cannot be empty.= The mailing list name cannot be empty.=
Back=Zurück
Mark Read=Als gelesen makieren Mark Read=Als gelesen makieren
Mark Unread=Als ungelesen makieren Mark Unread=Als ungelesen makieren
(No description)=(Keine Beschreibung) Trash=
No maillist=Keine Verteilerliste
From=Von
You have mail! Type /mail to read=
Read=Lesen
Filter=
Allow multiple selection=
@1 of @2 selected=
(Un)select all=
No mail=Keine Nachrichten
Inbox=Posteingang Inbox=Posteingang
Outbox=Senden Outbox=Senden
Drafts=Entwürfe Drafts=Entwürfe
@ -52,11 +34,29 @@ Mail lists=Verteilerlisten
Options= Options=
Close=Schließen Close=Schließen
(No subject)=(Kein Betreff) (No subject)=(Kein Betreff)
From=Von
Reply=Antworten Reply=Antworten
Reply all=Allen antworten Reply all=Allen antworten
Forward=Weiter Forward=Weiter
Filter=
Allow multiple selection=
@1 of @2 selected=
(Un)select all=
No mail=Keine Nachrichten
Read=Lesen
(No description)=(Keine Beschreibung)
No maillist=Keine Verteilerliste
Note=Notiz
Edit=Bearbeiten
New=Neu
Delete=Löschen
You have mail! Type /mail to read=
Subject=Betreff
To=An
Add=Hinzufügen Add=Hinzufügen
Remove=Entfernen Remove=Entfernen
Name=Name
CC=CC
Notifications= Notifications=
Chat notifications= Chat notifications=
On join notifications= On join notifications=
@ -66,10 +66,15 @@ Message list=
Show unread in different color= Show unread in different color=
Show CC/BCC in different color= Show CC/BCC in different color=
Default sorting fields= Default sorting fields=
From/To=Von/An Other=
Move deleted messages to trash=
Reset= Reset=
Settings= Settings=
About=Über About=Über
Save=Speichern
Ascending= Ascending=
Descending= Descending=
Date=Datum Date=Datum
From/To=Von/An
Restore=
Trash is empty=

View File

@ -13,37 +13,19 @@ BCC=CCO
Cancel=Cancelar Cancel=Cancelar
Save draft=Guardar borrador Save draft=Guardar borrador
Send=Enviar Send=Enviar
CC=CC
New=Nuevo
Delete=Borrar
Edit=Editar
Name=Nombre
No drafts=No hay borradores No drafts=No hay borradores
To=Para
Subject=Asunto
Player name=Nombre del jugador Player name=Nombre del jugador
That name is already in your contacts=Ese nombre ya está en tus contactos That name is already in your contacts=Ese nombre ya está en tus contactos
The contact name cannot be empty.=Ese nombre de contacto no puede estar vacío. The contact name cannot be empty.=Ese nombre de contacto no puede estar vacío.
Note=Nota
Back=Volver
Save=Guardar
Maillist name=Nombre de la lista de correo Maillist name=Nombre de la lista de correo
Desc=Desc Desc=Desc
Players=Jugadores Players=Jugadores
That name is already in your mailing lists.=Ese nombre ya está entus listas de correo. That name is already in your mailing lists.=Ese nombre ya está entus listas de correo.
The mailing list name cannot be empty.=Ese nombre de lista de correo no puede estar vacío. The mailing list name cannot be empty.=Ese nombre de lista de correo no puede estar vacío.
Back=Volver
Mark Read=Marcar como leído Mark Read=Marcar como leído
Mark Unread=Marcar como no leído Mark Unread=Marcar como no leído
(No description)=(Sin descripción) Trash=
No maillist=Sin lista de correo
From=De
You have mail! Type /mail to read=
Read=Leído
Filter=Filtrar
Allow multiple selection=Permitir selección múltiple
@1 of @2 selected=
(Un)select all=(Des)seleccionar todos
No mail=Sin correo
Inbox=Entrada Inbox=Entrada
Outbox=Enviados Outbox=Enviados
Drafts=Borradores Drafts=Borradores
@ -52,11 +34,29 @@ Mail lists=Listas de correo
Options= Options=
Close=Cerrar Close=Cerrar
(No subject)=(Sin asunto) (No subject)=(Sin asunto)
From=De
Reply=Responder Reply=Responder
Reply all=Responder a todos Reply all=Responder a todos
Forward=Reenviar Forward=Reenviar
Filter=Filtrar
Allow multiple selection=Permitir selección múltiple
@1 of @2 selected=
(Un)select all=(Des)seleccionar todos
No mail=Sin correo
Read=Leído
(No description)=(Sin descripción)
No maillist=Sin lista de correo
Note=Nota
Edit=Editar
New=Nuevo
Delete=Borrar
You have mail! Type /mail to read=
Subject=Asunto
To=Para
Add=Añadir Add=Añadir
Remove=Quitar Remove=Quitar
Name=Nombre
CC=CC
Notifications= Notifications=
Chat notifications= Chat notifications=
On join notifications= On join notifications=
@ -66,13 +66,18 @@ Message list=
Show unread in different color= Show unread in different color=
Show CC/BCC in different color= Show CC/BCC in different color=
Default sorting fields= Default sorting fields=
From/To=De/Para Other=
Move deleted messages to trash=
Reset= Reset=
Settings= Settings=
About=Acerca de About=Acerca de
Save=Guardar
Ascending=Ascendente Ascending=Ascendente
Descending=Descendiente Descending=Descendiente
Date=Fecha Date=Fecha
From/To=De/Para
Restore=
Trash is empty=
##### not used anymore ##### ##### not used anymore #####

View File

@ -13,37 +13,19 @@ BCC=Cci
Cancel=Annuler Cancel=Annuler
Save draft=Enregistrer le brouillon Save draft=Enregistrer le brouillon
Send=Envoyer Send=Envoyer
CC=Cc
New=Nouveau
Delete=Supprimer
Edit=Modifier
Name=Nom
No drafts=Pas de brouillons No drafts=Pas de brouillons
To=À
Subject=Objet
Player name=Nom du joueur Player name=Nom du joueur
That name is already in your contacts=Ce nom est déjà dans vos contacts That name is already in your contacts=Ce nom est déjà dans vos contacts
The contact name cannot be empty.=Le nom du contact ne peut pas être vide. The contact name cannot be empty.=Le nom du contact ne peut pas être vide.
Note=Note
Back=Retour
Save=Sauvegarder
Maillist name=Nom de la liste de diffusion Maillist name=Nom de la liste de diffusion
Desc=Desc Desc=Desc
Players=Joueurs Players=Joueurs
That name is already in your mailing lists.=Ce nom est déjà dans vos listes de diffusion. That name is already in your mailing lists.=Ce nom est déjà dans vos listes de diffusion.
The mailing list name cannot be empty.=Le nom de la liste de diffusion ne peut pas être vide. The mailing list name cannot be empty.=Le nom de la liste de diffusion ne peut pas être vide.
Back=Retour
Mark Read=Marquer comme lu Mark Read=Marquer comme lu
Mark Unread=Marquer non lu Mark Unread=Marquer non lu
(No description)=Sans description Trash=Corbeille
No maillist=Aucune liste de diffusion
From=De
You have mail! Type /mail to read=Vous avez reçu un mail ! Entrez /mail pour le consulter
Read=Lire
Filter=Filtre
Allow multiple selection=Autoriser la sélection multiple
@1 of @2 selected=@1 sur @2 sélectionnés
(Un)select all=Tout (dé)selectionner
No mail=Aucun mail
Inbox=Boîte de réception Inbox=Boîte de réception
Outbox=Envoyés Outbox=Envoyés
Drafts=Brouillons Drafts=Brouillons
@ -52,11 +34,29 @@ Mail lists=Listes de diffusion
Options=Options Options=Options
Close=Fermer Close=Fermer
(No subject)=(Sans objet) (No subject)=(Sans objet)
From=De
Reply=Répondre Reply=Répondre
Reply all=Répondre à tous Reply all=Répondre à tous
Forward=Transférer Forward=Transférer
Filter=Filtre
Allow multiple selection=Autoriser la sélection multiple
@1 of @2 selected=@1 sur @2 sélectionnés
(Un)select all=Tout (dé)selectionner
No mail=Aucun mail
Read=Lire
(No description)=Sans description
No maillist=Aucune liste de diffusion
Note=Note
Edit=Modifier
New=Nouveau
Delete=Supprimer
You have mail! Type /mail to read=Vous avez reçu un mail ! Entrez /mail pour le consulter
Subject=Objet
To=À
Add=Ajouter Add=Ajouter
Remove=Enlever Remove=Enlever
Name=Nom
CC=Cc
Notifications=Notifications Notifications=Notifications
Chat notifications=Notifications dans le tchat Chat notifications=Notifications dans le tchat
On join notifications=Notifications à la connexion On join notifications=Notifications à la connexion
@ -66,10 +66,15 @@ Message list=Liste de messages
Show unread in different color=Coloriser les non lus Show unread in different color=Coloriser les non lus
Show CC/BCC in different color=Coloriser les Cc/Cci Show CC/BCC in different color=Coloriser les Cc/Cci
Default sorting fields=Champs de tri par défaut Default sorting fields=Champs de tri par défaut
From/To=De/À Other=Autre
Move deleted messages to trash=Supprimer les messages dans la corbeille
Reset=Réinitialiser Reset=Réinitialiser
Settings=Paramètres Settings=Paramètres
About=À propos About=À propos
Save=Sauvegarder
Ascending=Croissant Ascending=Croissant
Descending=Décroissant Descending=Décroissant
Date=Date Date=Date
From/To=De/À
Restore=Restaurer
Trash is empty=La corbeille est vide

View File

@ -1,5 +1,4 @@
# textdomain: mail # textdomain: mail
# author: nyomi
Provided my mt-mods=Feltéve, hogy az én mt-mod-om Provided my mt-mods=Feltéve, hogy az én mt-mod-om
Version=Verzió Version=Verzió
Licenses=License Licenses=License
@ -7,9 +6,6 @@ Expat (code), WTFPL (textures)=Expat (kód), WTFPL (textúrák)
Communication using this system is NOT guaranteed to be private!=A systemben lévő komunikáció nem garantáltan privát! Communication using this system is NOT guaranteed to be private!=A systemben lévő komunikáció nem garantáltan privát!
Admins are able to view the messages of any player.=Az adminok megtudják nézni minden játékos üzenetjét. Admins are able to view the messages of any player.=Az adminok megtudják nézni minden játékos üzenetjét.
Contributors=Közreműködöttek Contributors=Közreműködöttek
Note=Jegyzet
Settings=Beállítások
About=Róla
You have a new message from @1! Subject: @2=Van egy új üzeneted @1-től Cím: @2 You have a new message from @1! Subject: @2=Van egy új üzeneted @1-től Cím: @2
To view it, type /mail=Ahhoz hogy megnézd, írd /mail To view it, type /mail=Ahhoz hogy megnézd, írd /mail
You could also use the button in your inventory.=A gombot is tudod használni az inventoridban. You could also use the button in your inventory.=A gombot is tudod használni az inventoridban.
@ -17,14 +13,19 @@ BCC=BCC
Cancel=Mégse Cancel=Mégse
Save draft=mentés piszkozatként Save draft=mentés piszkozatként
Send=Küldés Send=Küldés
Subject=Cím
To=Neki
CC=CC
Name=Név
No drafts=Nincsenek piszkozatok No drafts=Nincsenek piszkozatok
Edit=Szerkesztés Player name=Játékos neve
New=Új That name is already in your contacts=A név már a kontaktok között van
Delete=Törlés The contact name cannot be empty.=A contakt neve nem lehet üres.
Maillist name=Levelező lista neve
Desc=Desc
Players=Játékosok
That name is already in your mailing lists.=A név már benne van a levelező listában
The mailing list name cannot be empty.=A levelező lista neve nem lehet üres
Back=Visza
Mark Read=Jelöld olvasottként
Mark Unread=Jelöld olvasatlanul
Trash=
Inbox=PostaLáda Inbox=PostaLáda
Outbox=Elküldött Outbox=Elküldött
Drafts=Piszkozatok Drafts=Piszkozatok
@ -33,36 +34,29 @@ Mail lists=Levelező lista
Options=Lehetőségek Options=Lehetőségek
Close=Bezár Close=Bezár
(No subject)=(nincs cím) (No subject)=(nincs cím)
Player name=Játékos neve
That name is already in your contacts=A név már a kontaktok között van
The contact name cannot be empty.=A contakt neve nem lehet üres.
Save=Mentés
Maillist name=Levelező lista neve
Desc=Desc
Players=Játékosok
That name is already in your mailing lists.=A név már benne van a levelező listában
The mailing list name cannot be empty.=A levelező lista neve nem lehet üres
Mark Read=Jelöld olvasottként
Mark Unread=Jelöld olvasatlanul
From=Tőle From=Tőle
Read=Olvasott Reply=Válasz
Reply all=Válaszmindenkinek
Forward=Továbbítás
Filter=Filterek Filter=Filterek
Allow multiple selection= Allow multiple selection=
@1 of @2 selected= @1 of @2 selected=
(Un)select all=(ne válaszd ki) mindegyik választása (Un)select all=(ne válaszd ki) mindegyik választása
No mail=Nincs levél No mail=Nincs levél
Reply=Válasz Read=Olvasott
Reply all=Válaszmindenkinek
Forward=Továbbítás
Date=Dátum
Ascending=Emelkedő
Descending=Sűlyedő
(No description)=(Nincs leírás) (No description)=(Nincs leírás)
No maillist=Nincs levelező lista No maillist=Nincs levelező lista
Note=Jegyzet
Edit=Szerkesztés
New=Új
Delete=Törlés
You have mail! Type /mail to read=Van egy leveled! Írd /mail az olvasáshoz You have mail! Type /mail to read=Van egy leveled! Írd /mail az olvasáshoz
Subject=Cím
To=Neki
Add=Hozzáadás Add=Hozzáadás
Remove=Elvétel Remove=Elvétel
Back=Visza Name=Név
CC=CC
Notifications=Értesítések Notifications=Értesítések
Chat notifications=Chates értesítések Chat notifications=Chates értesítések
On join notifications=Belépési értesírés On join notifications=Belépési értesírés
@ -72,5 +66,15 @@ Message list=Üzenetek listája
Show unread in different color=Mutasd a nem olvasottakat más színnel Show unread in different color=Mutasd a nem olvasottakat más színnel
Show CC/BCC in different color=Mutasd a CC-t/BCC-t más színnel Show CC/BCC in different color=Mutasd a CC-t/BCC-t más színnel
Default sorting fields=Alap válogató terület Default sorting fields=Alap válogató terület
From/To=Tól(től)/neki Other=
Move deleted messages to trash=
Reset=Viszaállítás Reset=Viszaállítás
Settings=Beállítások
About=Róla
Save=Mentés
Ascending=Emelkedő
Descending=Sűlyedő
Date=Dátum
From/To=Tól(től)/neki
Restore=
Trash is empty=

View File

@ -13,37 +13,19 @@ BCC=BCC
Cancel=Cancelar Cancel=Cancelar
Save draft=Salvar rascunho Save draft=Salvar rascunho
Send=Enviar Send=Enviar
CC=CC
New=Novo
Delete=Apagar
Edit=Editar
Name=Nome
No drafts=Sem rascunhos No drafts=Sem rascunhos
To=Para
Subject=Assunto
Player name=Nome do jogador Player name=Nome do jogador
That name is already in your contacts=Esse nome já consta em sua lista de contatos That name is already in your contacts=Esse nome já consta em sua lista de contatos
The contact name cannot be empty.=Informe o nome do destinatário The contact name cannot be empty.=Informe o nome do destinatário
Note=Nota
Back=Voltar
Save=Salvar
Maillist name=Nome da lista de discussão Maillist name=Nome da lista de discussão
Desc=Descrição Desc=Descrição
Players=Jogador Players=Jogador
That name is already in your mailing lists.=Esse nome ja está sendo usado em sua lista de discussões That name is already in your mailing lists.=Esse nome ja está sendo usado em sua lista de discussões
The mailing list name cannot be empty.=O nome da lista de discussões deve ser informado The mailing list name cannot be empty.=O nome da lista de discussões deve ser informado
Back=Voltar
Mark Read=Marcar como lido Mark Read=Marcar como lido
Mark Unread=Marcar como não lido Mark Unread=Marcar como não lido
(No description)=(sem descrição) Trash=
No maillist=Sem lista de discussão
From=De
You have mail! Type /mail to read=Você recebeu e-mail! Tecle /mail para ler
Read=Ler
Filter=Filtrar
Allow multiple selection=Permitir selecionar vários
@1 of @2 selected=
(Un)select all=Desmarcar todos
No mail=Sem e-mails no momento
Inbox=Entrada Inbox=Entrada
Outbox=Enviadas Outbox=Enviadas
Drafts=Rascunhos Drafts=Rascunhos
@ -52,11 +34,29 @@ Mail lists=Lista de correios
Options=Opções Options=Opções
Close=Fechar Close=Fechar
(No subject)=(Sem assunto) (No subject)=(Sem assunto)
From=De
Reply=Responder Reply=Responder
Reply all=Responder Todos Reply all=Responder Todos
Forward=Encaminhar Forward=Encaminhar
Filter=Filtrar
Allow multiple selection=Permitir selecionar vários
@1 of @2 selected=
(Un)select all=Desmarcar todos
No mail=Sem e-mails no momento
Read=Ler
(No description)=(sem descrição)
No maillist=Sem lista de discussão
Note=Nota
Edit=Editar
New=Novo
Delete=Apagar
You have mail! Type /mail to read=Você recebeu e-mail! Tecle /mail para ler
Subject=Assunto
To=Para
Add=Adicionar Add=Adicionar
Remove=Remover Remove=Remover
Name=Nome
CC=CC
Notifications=Notificações Notifications=Notificações
Chat notifications=Notificação de conversa Chat notifications=Notificação de conversa
On join notifications=Notificação ao entrar On join notifications=Notificação ao entrar
@ -66,13 +66,18 @@ Message list=Lista de mensagens
Show unread in different color=Exibir mensagens não lidas em uma cor diferente Show unread in different color=Exibir mensagens não lidas em uma cor diferente
Show CC/BCC in different color=Exibir mensagens com copia em uma cor diferente Show CC/BCC in different color=Exibir mensagens com copia em uma cor diferente
Default sorting fields=Ordenamento de campos padrão Default sorting fields=Ordenamento de campos padrão
From/To=De/Para Other=
Move deleted messages to trash=
Reset= Reset=
Settings=Ajustes Settings=Ajustes
About=Sobre About=Sobre
Save=Salvar
Ascending=Ascendente Ascending=Ascendente
Descending=Descendente Descending=Descendente
Date=Data Date=Data
From/To=De/Para
Restore=
Trash is empty=
##### not used anymore ##### ##### not used anymore #####

View File

@ -13,38 +13,20 @@ BCC=密送
Cancel=取消 Cancel=取消
Save draft=保存草稿 Save draft=保存草稿
Send=发送 Send=发送
CC=抄送
New=新
Delete=删除
Edit=编辑
Name=名字
#if new means new mail, it would be New=新邮件 #if new means new mail, it would be New=新邮件
No drafts=没有草稿 No drafts=没有草稿
To=收件人
Subject=主题
Player name=玩家名字 Player name=玩家名字
That name is already in your contacts= That name is already in your contacts=
The contact name cannot be empty.= The contact name cannot be empty.=
Note=备注
Back=返回
Save=保存
Maillist name=建组名 Maillist name=建组名
Desc=描述 Desc=描述
Players=玩家 Players=玩家
That name is already in your mailing lists.= That name is already in your mailing lists.=
The mailing list name cannot be empty.= The mailing list name cannot be empty.=
Back=返回
Mark Read=标记为已读 Mark Read=标记为已读
Mark Unread=标记为未读 Mark Unread=标记为未读
(No description)=(无描述) Trash=
No maillist=无建组
From=发件人
You have mail! Type /mail to read=
Read=浏览
Filter=筛选
Allow multiple selection=允许多选
@1 of @2 selected=
(Un)select all=(取消)选中所有
No mail=无邮件
Inbox=收件箱 Inbox=收件箱
Outbox=已发送 Outbox=已发送
Drafts=草稿 Drafts=草稿
@ -53,11 +35,29 @@ Mail lists=建组
Options= Options=
Close=关闭 Close=关闭
(No subject)=(无主题) (No subject)=(无主题)
From=发件人
Reply=回复 Reply=回复
Reply all=回复所有 Reply all=回复所有
Forward=转发 Forward=转发
Filter=筛选
Allow multiple selection=允许多选
@1 of @2 selected=
(Un)select all=(取消)选中所有
No mail=无邮件
Read=浏览
(No description)=(无描述)
No maillist=无建组
Note=备注
Edit=编辑
New=新
Delete=删除
You have mail! Type /mail to read=
Subject=主题
To=收件人
Add=添加 Add=添加
Remove=移除 Remove=移除
Name=名字
CC=抄送
Notifications= Notifications=
Chat notifications= Chat notifications=
On join notifications= On join notifications=
@ -67,13 +67,18 @@ Message list=
Show unread in different color= Show unread in different color=
Show CC/BCC in different color= Show CC/BCC in different color=
Default sorting fields= Default sorting fields=
From/To= Other=
Move deleted messages to trash=
Reset= Reset=
Settings= Settings=
About=关于 About=关于
Save=保存
Ascending=升序 Ascending=升序
Descending=降序 Descending=降序
Date=时间 Date=时间
From/To=
Restore=
Trash is empty=
##### not used anymore ##### ##### not used anymore #####

View File

@ -13,37 +13,19 @@ BCC=密件副本
Cancel=取消 Cancel=取消
Save draft=儲存草稿 Save draft=儲存草稿
Send=發送 Send=發送
CC=副本
New=新建
Delete=刪除
Edit=編輯
Name=名稱
No drafts=沒有草稿 No drafts=沒有草稿
To=收件人
Subject=主旨
Player name=玩家名稱 Player name=玩家名稱
That name is already in your contacts= That name is already in your contacts=
The contact name cannot be empty.= The contact name cannot be empty.=
Note=備註
Back=返回
Save=儲存
Maillist name=郵件列表名稱 Maillist name=郵件列表名稱
Desc=描述 Desc=描述
Players=玩家 Players=玩家
That name is already in your mailing lists.= That name is already in your mailing lists.=
The mailing list name cannot be empty.= The mailing list name cannot be empty.=
Back=返回
Mark Read=標記已讀 Mark Read=標記已讀
Mark Unread=標記未讀 Mark Unread=標記未讀
(No description)=(沒有描述) Trash=
No maillist=沒有郵件列表
From=寄件者
You have mail! Type /mail to read=
Read=閱讀
Filter=
Allow multiple selection=
@1 of @2 selected=
(Un)select all=
No mail=沒有郵件
Inbox=收件箱 Inbox=收件箱
Outbox=寄件備份 Outbox=寄件備份
Drafts=草稿 Drafts=草稿
@ -52,11 +34,29 @@ Mail lists=郵件列表
Options= Options=
Close=關閉 Close=關閉
(No subject)=(沒有主旨) (No subject)=(沒有主旨)
From=寄件者
Reply=回覆 Reply=回覆
Reply all=回覆所有人 Reply all=回覆所有人
Forward=轉寄 Forward=轉寄
Filter=
Allow multiple selection=
@1 of @2 selected=
(Un)select all=
No mail=沒有郵件
Read=閱讀
(No description)=(沒有描述)
No maillist=沒有郵件列表
Note=備註
Edit=編輯
New=新建
Delete=刪除
You have mail! Type /mail to read=
Subject=主旨
To=收件人
Add=加入 Add=加入
Remove=移除 Remove=移除
Name=名稱
CC=副本
Notifications= Notifications=
Chat notifications= Chat notifications=
On join notifications= On join notifications=
@ -66,10 +66,15 @@ Message list=
Show unread in different color= Show unread in different color=
Show CC/BCC in different color= Show CC/BCC in different color=
Default sorting fields= Default sorting fields=
From/To= Other=
Move deleted messages to trash=
Reset= Reset=
Settings= Settings=
About=關於 About=關於
Save=儲存
Ascending= Ascending=
Descending= Descending=
Date=日期 Date=日期
From/To=
Restore=
Trash is empty=

View File

@ -13,37 +13,19 @@ BCC=
Cancel= Cancel=
Save draft= Save draft=
Send= Send=
CC=
New=
Delete=
Edit=
Name=
No drafts= No drafts=
To=
Subject=
Player name= Player name=
That name is already in your contacts= That name is already in your contacts=
The contact name cannot be empty.= The contact name cannot be empty.=
Note=
Back=
Save=
Maillist name= Maillist name=
Desc= Desc=
Players= Players=
That name is already in your mailing lists.= That name is already in your mailing lists.=
The mailing list name cannot be empty.= The mailing list name cannot be empty.=
Back=
Mark Read= Mark Read=
Mark Unread= Mark Unread=
(No description)= Trash=
No maillist=
From=
You have mail! Type /mail to read=
Read=
Filter=
Allow multiple selection=
@1 of @2 selected=
(Un)select all=
No mail=
Inbox= Inbox=
Outbox= Outbox=
Drafts= Drafts=
@ -52,11 +34,29 @@ Mail lists=
Options= Options=
Close= Close=
(No subject)= (No subject)=
From=
Reply= Reply=
Reply all= Reply all=
Forward= Forward=
Filter=
Allow multiple selection=
@1 of @2 selected=
(Un)select all=
No mail=
Read=
(No description)=
No maillist=
Note=
Edit=
New=
Delete=
You have mail! Type /mail to read=
Subject=
To=
Add= Add=
Remove= Remove=
Name=
CC=
Notifications= Notifications=
Chat notifications= Chat notifications=
On join notifications= On join notifications=
@ -66,10 +66,15 @@ Message list=
Show unread in different color= Show unread in different color=
Show CC/BCC in different color= Show CC/BCC in different color=
Default sorting fields= Default sorting fields=
From/To= Other=
Move deleted messages to trash=
Reset= Reset=
Settings= Settings=
About= About=
Save=
Ascending= Ascending=
Descending= Descending=
Date= Date=
From/To=
Restore=
Trash is empty=

View File

@ -8,6 +8,7 @@ local function populate_entry(e)
e.inbox = e.inbox or {} e.inbox = e.inbox or {}
e.outbox = e.outbox or {} e.outbox = e.outbox or {}
e.drafts = e.drafts or {} e.drafts = e.drafts or {}
e.trash = e.trash or {}
e.lists = e.lists or {} e.lists = e.lists or {}
e.settings = e.settings or {} e.settings = e.settings or {}
return e return e
@ -42,6 +43,43 @@ function mail.get_message(playername, msg_id)
return msg return msg
end end
end end
for _, msg in ipairs(entry.drafts) do
if msg.id == msg_id then
return msg
end
end
for _, msg in ipairs(entry.trash) do
if msg.id == msg_id then
return msg
end
end
end
-- get player boxes where a message appears
function mail.get_message_boxes(playername, msg_id)
local entry = mail.get_storage_entry(playername)
local boxes = {}
for _, msg in ipairs(entry.inbox) do
if msg.id == msg_id then
table.insert(boxes, "inbox")
end
end
for _, msg in ipairs(entry.outbox) do
if msg.id == msg_id then
table.insert(boxes, "outbox")
end
end
for _, msg in ipairs(entry.drafts) do
if msg.id == msg_id then
table.insert(boxes, "drafts")
end
end
for _, msg in ipairs(entry.trash) do
if msg.id == msg_id then
table.insert(boxes, "trash")
end
end
return boxes
end end
local function safe_find(str, sub) local function safe_find(str, sub)
@ -109,7 +147,7 @@ function mail.mark_unread(playername, msg_ids)
end end
-- deletes a mail by its id -- deletes a mail by its id
function mail.delete_mail(playername, msg_ids) function mail.delete_mail(playername, msg_ids, delete_in_trash)
local entry = mail.get_storage_entry(playername) local entry = mail.get_storage_entry(playername)
if type(msg_ids) ~= "table" then -- if this is not a table if type(msg_ids) ~= "table" then -- if this is not a table
msg_ids = { msg_ids } msg_ids = { msg_ids }
@ -138,8 +176,54 @@ function mail.delete_mail(playername, msg_ids)
end end
end end
end end
if delete_in_trash then
for i = #entry.trash, 1, -1 do
for _, deleted_msg in ipairs(msg_ids) do
if entry.trash[i].id == deleted_msg then
table.remove(entry.trash, i)
break
end
end
end
end
mail.set_storage_entry(playername, entry)
mail.hud_update(playername, entry.inbox)
return
end
-- move to trash mails by id
function mail.trash_mail(playername, msg_ids)
local entry = mail.get_storage_entry(playername)
if type(msg_ids) ~= "table" then -- if this is not a table
msg_ids = { msg_ids }
end
for _, id in ipairs(msg_ids) do
local msg = mail.get_message(playername, id)
msg.previous_boxes = mail.get_message_boxes(playername, id)
table.insert(entry.trash, 1, msg)
end
mail.set_storage_entry(playername, entry)
mail.delete_mail(playername, msg_ids)
return
end
-- restore a mail from trash
function mail.restore_mail(playername, msg_id)
local entry = mail.get_storage_entry(playername)
for i, msg in ipairs(entry.trash) do
if msg.id == msg_id then
-- not anymore store previous boxes in json
local previous_boxes = msg.previous_boxes
msg.previous_boxes = nil
-- restore it in all previous boxes
for _, box in ipairs(previous_boxes) do
table.insert(entry[box], msg)
end
-- then delete it from trash
table.remove(entry.trash, i)
end
end
mail.set_storage_entry(playername, entry) mail.set_storage_entry(playername, entry)
mail.hud_update(playername, entry.inbox)
return return
end end
@ -271,6 +355,7 @@ function mail.get_setting_default_value(setting_name)
cccolorenable = true, cccolorenable = true,
defaultsortfield = 3, defaultsortfield = 3,
defaultsortdirection = 1, defaultsortdirection = 1,
trash_move_enable = true,
} }
return default_values[setting_name] return default_values[setting_name]
end end

View File

@ -1,22 +1,28 @@
-- translation -- translation
local S = minetest.get_translator("mail") local S = minetest.get_translator("mail")
local drafts_formspec = "size[8.5,10;]" .. mail.theme .. [[
tabheader[0.3,1;boxtab;]] .. S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. [[;3;false;false]
button[6,0.10;2.5,0.5;new;]] .. S("New") .. [[]
button[6,0.95;2.5,0.5;edit;]] .. S("Edit") .. [[]
button[6,1.70;2.5,0.5;delete;]] .. S("Delete") .. [[]
button[6,6.8;2.5,0.5;contacts;]] .. S("Contacts") .. [[]
button[6,7.6;2.5,0.5;maillists;]] .. S("Mail lists") .. [[]
button[6,8.7;2.5,0.5;options;]] .. S("Options") .. [[]
button_exit[6,9.5;2.5,0.5;quit;]] .. S("Close") .. [[]
tablecolumns[color;text;text]
table[0,0.7;5.75,9.35;drafts;#999,]] .. S("To") .. "," .. S("Subject")
function mail.show_drafts(name) function mail.show_drafts(name)
local trash_tab = ""
if mail.get_setting(name, "trash_move_enable") then
trash_tab = "," .. S("Trash")
end
local drafts_formspec = "size[8.5,10;]" .. mail.theme .. [[
tabheader[0.3,1;boxtab;]] ..
S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. trash_tab .. [[;3;false;false]
button[6,0.10;2.5,0.5;new;]] .. S("New") .. [[]
button[6,0.95;2.5,0.5;edit;]] .. S("Edit") .. [[]
button[6,1.70;2.5,0.5;delete;]] .. S("Delete") .. [[]
button[6,6.8;2.5,0.5;contacts;]] .. S("Contacts") .. [[]
button[6,7.6;2.5,0.5;maillists;]] .. S("Mail lists") .. [[]
button[6,8.7;2.5,0.5;options;]] .. S("Options") .. [[]
button_exit[6,9.5;2.5,0.5;quit;]] .. S("Close") .. [[]
tablecolumns[color;text;text]
table[0,0.7;5.75,9.35;drafts;#999,]] .. S("To") .. "," .. S("Subject")
local formspec = { drafts_formspec } local formspec = { drafts_formspec }
local entry = mail.get_storage_entry(name) local entry = mail.get_storage_entry(name)
local messages = entry.drafts local messages = entry.drafts

View File

@ -15,7 +15,8 @@ local function nonempty(x)
end end
minetest.register_on_player_receive_fields(function(player, formname, fields) minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "mail:inbox" and formname ~= "mail:outbox" and formname ~= "mail:drafts" then if formname ~= "mail:inbox" and formname ~= "mail:outbox"
and formname ~= "mail:drafts" and formname ~= "mail:trash" then
return return
elseif fields.quit then elseif fields.quit then
return return
@ -50,6 +51,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
-- split inbox and outbox msgs for different tests -- split inbox and outbox msgs for different tests
local entry = mail.get_storage_entry(name) local entry = mail.get_storage_entry(name)
local messagesDrafts = entry.drafts local messagesDrafts = entry.drafts
local messagesTrash = entry.trash
local getInbox = messageGetter(entry.inbox, inboxsortfield, sortdirection == "2", filter) local getInbox = messageGetter(entry.inbox, inboxsortfield, sortdirection == "2", filter)
local getOutbox = messageGetter(entry.outbox, outboxsortfield, sortdirection == "2", filter) local getOutbox = messageGetter(entry.outbox, outboxsortfield, sortdirection == "2", filter)
@ -154,6 +156,23 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
return true return true
end end
if fields.trash then -- trash table
local evt = minetest.explode_table_event(fields.trash)
if evt.row == 1 then -- header
if mail.selected_idxs.sortfield[name] == evt.column-1 then -- if already this field, then change direction
mail.selected_idxs.sortdirection[name] = mail.selected_idxs.sortdirection[name] == "2" and "1" or "2"
end
mail.selected_idxs.sortfield[name] = evt.column-1 -- update column
mail.show_mail_menu(name)
return
end
mail.selected_idxs.trash[name] = evt.row - 1
if evt.type == "DCL" and messagesTrash[mail.selected_idxs.trash[name]] then
mail.show_message(name, messagesTrash[mail.selected_idxs.trash[name]].id)
end
return true
end
if fields.boxtab == "1" then if fields.boxtab == "1" then
mail.selected_idxs.boxtab[name] = 1 mail.selected_idxs.boxtab[name] = 1
mail.show_inbox(name, sortfieldindex, sortdirection, filter) mail.show_inbox(name, sortfieldindex, sortdirection, filter)
@ -166,11 +185,17 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
mail.selected_idxs.boxtab[name] = 3 mail.selected_idxs.boxtab[name] = 3
mail.show_drafts(name) mail.show_drafts(name)
elseif fields.boxtab == "4" then
mail.selected_idxs.boxtab[name] = 4
mail.show_trash(name)
elseif fields.read then elseif fields.read then
if formname == "mail:inbox" and nonempty(mail.selected_idxs.inbox[name]) then -- inbox table if formname == "mail:inbox" and nonempty(mail.selected_idxs.inbox[name]) then -- inbox table
mail.show_message(name, mail.selected_idxs.inbox[name][#mail.selected_idxs.inbox[name]]) mail.show_message(name, mail.selected_idxs.inbox[name][#mail.selected_idxs.inbox[name]])
elseif formname == "mail:outbox" and nonempty(mail.selected_idxs.outbox[name]) then -- outbox table elseif formname == "mail:outbox" and nonempty(mail.selected_idxs.outbox[name]) then -- outbox table
mail.show_message(name, mail.selected_idxs.outbox[name][#mail.selected_idxs.outbox[name]]) mail.show_message(name, mail.selected_idxs.outbox[name][#mail.selected_idxs.outbox[name]])
elseif formname == "mail:trash" and messagesTrash[mail.selected_idxs.trash[name]] then
mail.show_message(name, messagesTrash[mail.selected_idxs.trash[name]].id)
end end
elseif fields.edit then elseif fields.edit then
@ -186,19 +211,39 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end end
elseif fields.delete then elseif fields.delete then
local trash_enabled = mail.get_setting(name, "trash_move_enable")
if formname == "mail:inbox" and mail.selected_idxs.inbox[name] then -- inbox table if formname == "mail:inbox" and mail.selected_idxs.inbox[name] then -- inbox table
mail.delete_mail(name, mail.selected_idxs.inbox[name]) if trash_enabled then
mail.trash_mail(name, mail.selected_idxs.inbox[name])
else
mail.delete_mail(name, mail.selected_idxs.inbox[name])
end
mail.selected_idxs.inbox[name] = {} mail.selected_idxs.inbox[name] = {}
elseif formname == "mail:outbox" and mail.selected_idxs.outbox[name] then -- outbox table elseif formname == "mail:outbox" and mail.selected_idxs.outbox[name] then -- outbox table
mail.delete_mail(name, mail.selected_idxs.outbox[name]) if trash_enabled then
mail.trash_mail(name, mail.selected_idxs.outbox[name])
else
mail.delete_mail(name, mail.selected_idxs.outbox[name])
end
mail.selected_idxs.outbox[name] = {} mail.selected_idxs.outbox[name] = {}
elseif formname == "mail:drafts" and messagesDrafts[mail.selected_idxs.drafts[name]] then -- drafts table elseif formname == "mail:drafts" and messagesDrafts[mail.selected_idxs.drafts[name]] then -- drafts table
mail.delete_mail(name, messagesDrafts[mail.selected_idxs.drafts[name]].id) if trash_enabled then
mail.trash_mail(name, messagesDrafts[mail.selected_idxs.drafts[name]].id)
else
mail.delete_mail(name, messagesDrafts[mail.selected_idxs.drafts[name]].id)
end
mail.selected_idxs.drafts[name] = nil mail.selected_idxs.drafts[name] = nil
elseif formname == "mail:trash" and messagesTrash[mail.selected_idxs.trash[name]] then -- trash table
mail.delete_mail(name, messagesTrash[mail.selected_idxs.trash[name]].id, true)
end end
mail.show_mail_menu(name, sortfieldindex, sortdirection, filter) mail.show_mail_menu(name, sortfieldindex, sortdirection, filter)
elseif fields.restore then
mail.restore_mail(name, messagesTrash[mail.selected_idxs.trash[name]].id)
mail.show_mail_menu(name, sortfieldindex, sortdirection, filter)
elseif fields.reply then elseif fields.reply then
if formname == "mail:inbox" and mail.selected_idxs.inbox[name] and #mail.selected_idxs.inbox[name] > 0 then if formname == "mail:inbox" and mail.selected_idxs.inbox[name] and #mail.selected_idxs.inbox[name] > 0 then
local message = mail.get_message(name, mail.selected_idxs.inbox[name][#mail.selected_idxs.inbox[name]]) local message = mail.get_message(name, mail.selected_idxs.inbox[name][#mail.selected_idxs.inbox[name]])

View File

@ -13,8 +13,14 @@ function mail.show_inbox(name, sortfieldindex, sortdirection, filter)
local sortfield = ({"from","subject","time"})[sortfieldindex] local sortfield = ({"from","subject","time"})[sortfieldindex]
local messages = mail.sort_messages(entry.inbox, sortfield, sortdirection == "2", filter) local messages = mail.sort_messages(entry.inbox, sortfield, sortdirection == "2", filter)
local trash_tab = ""
if mail.get_setting(name, "trash_move_enable") then
trash_tab = "," .. S("Trash")
end
local inbox_formspec = "size[8.5,10;]" .. mail.theme .. [[ local inbox_formspec = "size[8.5,10;]" .. mail.theme .. [[
tabheader[0.3,1;boxtab;]] .. S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. [[;1;false;false] tabheader[0.3,1;boxtab;]] ..
S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. trash_tab .. [[;1;false;false]
button[6,0.10;2.5,0.5;new;]] .. S("New") .. [[] button[6,0.10;2.5,0.5;new;]] .. S("New") .. [[]
button[6,0.95;2.5,0.5;read;]] .. S("Read") .. [[] button[6,0.95;2.5,0.5;read;]] .. S("Read") .. [[]

View File

@ -11,5 +11,7 @@ function mail.show_mail_menu(playername, sortfield, sortdirection, filter)
mail.show_outbox(playername, sortfield, sortdirection, filter) mail.show_outbox(playername, sortfield, sortdirection, filter)
elseif index == 3 then elseif index == 3 then
mail.show_drafts(playername) mail.show_drafts(playername)
elseif index == 4 then
mail.show_trash(playername)
end end
end end

View File

@ -13,8 +13,14 @@ function mail.show_outbox(name, sortfieldindex, sortdirection, filter)
local sortfield = ({"to","subject","time"})[sortfieldindex] local sortfield = ({"to","subject","time"})[sortfieldindex]
local messages = mail.sort_messages(entry.outbox, sortfield, sortdirection == "2", filter) local messages = mail.sort_messages(entry.outbox, sortfield, sortdirection == "2", filter)
local trash_tab = ""
if mail.get_setting(name, "trash_move_enable") then
trash_tab = "," .. S("Trash")
end
local outbox_formspec = "size[8.5,10;]" .. mail.theme .. [[ local outbox_formspec = "size[8.5,10;]" .. mail.theme .. [[
tabheader[0.3,1;boxtab;]] .. S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. [[;2;false;false] tabheader[0.3,1;boxtab;]] ..
S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. trash_tab .. [[;2;false;false]
button[6,0.10;2.5,0.5;new;]] .. S("New") .. [[] button[6,0.10;2.5,0.5;new;]] .. S("New") .. [[]
button[6,0.95;2.5,0.5;read;]] .. S("Read") .. [[] button[6,0.95;2.5,0.5;read;]] .. S("Read") .. [[]

View File

@ -35,6 +35,11 @@ function mail.show_settings(name)
S("Ascending") .. "," .. S("Descending") .. [[;]] .. S("Ascending") .. "," .. S("Descending") .. [[;]] ..
tostring(mail.get_setting(name, "defaultsortdirection")) .. [[;true] tostring(mail.get_setting(name, "defaultsortdirection")) .. [[;true]
box[0,3.2;3,0.45;#466432]
label[0.2,3.2;]] .. S("Other") .. [[]
checkbox[0,3.6;trash_move_enable;]] .. S("Move deleted messages to trash") .. [[;]] ..
tostring(mail.get_setting(name, "trash_move_enable")) .. [[]
button[0,5.5;2.5,0.5;save;]] .. S("Save") .. [[] button[0,5.5;2.5,0.5;save;]] .. S("Save") .. [[]
button[2.7,5.5;2.5,0.5;reset;]] .. S("Reset") .. [[] button[2.7,5.5;2.5,0.5;reset;]] .. S("Reset") .. [[]
]] .. mail.theme ]] .. mail.theme
@ -79,6 +84,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
elseif fields.cccolorenable then elseif fields.cccolorenable then
mail.selected_idxs.cccolorenable[playername] = fields.cccolorenable == "true" mail.selected_idxs.cccolorenable[playername] = fields.cccolorenable == "true"
elseif fields.trash_move_enable then
mail.selected_idxs.trash_move_enable[playername] = fields.trash_move_enable == "true"
elseif fields.save then elseif fields.save then
-- checkboxes -- checkboxes
mail.set_setting(playername, "chat_notifications", mail.selected_idxs.chat_notifications[playername]) mail.set_setting(playername, "chat_notifications", mail.selected_idxs.chat_notifications[playername])
@ -87,6 +95,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
mail.set_setting(playername, "sound_notifications", mail.selected_idxs.sound_notifications[playername]) mail.set_setting(playername, "sound_notifications", mail.selected_idxs.sound_notifications[playername])
mail.set_setting(playername, "unreadcolorenable", mail.selected_idxs.unreadcolorenable[playername]) mail.set_setting(playername, "unreadcolorenable", mail.selected_idxs.unreadcolorenable[playername])
mail.set_setting(playername, "cccolorenable", mail.selected_idxs.cccolorenable[playername]) mail.set_setting(playername, "cccolorenable", mail.selected_idxs.cccolorenable[playername])
mail.set_setting(playername, "trash_move_enable", mail.selected_idxs.trash_move_enable[playername])
-- dropdowns -- dropdowns
local defaultsortfield = fields.defaultsortfield or mail.get_setting("defaultsortfield") local defaultsortfield = fields.defaultsortfield or mail.get_setting("defaultsortfield")
local defaultsortdirection = fields.defaultsortdirection or mail.get_setting("defaultsortdirection") local defaultsortdirection = fields.defaultsortdirection or mail.get_setting("defaultsortdirection")

52
ui/trash.lua Normal file
View File

@ -0,0 +1,52 @@
-- translation
local S = minetest.get_translator("mail")
local trash_formspec = "size[8.5,10;]" .. mail.theme .. [[
tabheader[0.3,1;boxtab;]] ..
S("Inbox") .. "," .. S("Outbox").. "," .. S("Drafts") .. "," .. S("Trash") .. [[;4;false;false]
button[6,0.10;2.5,0.5;new;]] .. S("New") .. [[]
button[6,0.95;2.5,0.5;read;]] .. S("Read") .. [[]
button[6,1.70;2.5,0.5;restore;]] .. S("Restore") .. [[]
button[6,2.45;2.5,0.5;delete;]] .. S("Delete") .. [[]
button[6,6.8;2.5,0.5;contacts;]] .. S("Contacts") .. [[]
button[6,7.6;2.5,0.5;maillists;]] .. S("Mail lists") .. [[]
button[6,8.7;2.5,0.5;options;]] .. S("Options") .. [[]
button_exit[6,9.5;2.5,0.5;quit;]] .. S("Close") .. [[]
tablecolumns[color;text;text]
table[0,0.7;5.75,9.35;trash;#999,]] .. S("From/To") .. "," .. S("Subject")
function mail.show_trash(name)
local formspec = { trash_formspec }
local entry = mail.get_storage_entry(name)
local messages = entry.trash
if messages[1] then
for _, message in ipairs(messages) do
formspec[#formspec + 1] = ","
formspec[#formspec + 1] = ","
formspec[#formspec + 1] = minetest.formspec_escape(message.to)
formspec[#formspec + 1] = ","
if message.subject ~= "" then
if string.len(message.subject) > 30 then
formspec[#formspec + 1] = minetest.formspec_escape(string.sub(message.subject, 1, 27))
formspec[#formspec + 1] = "..."
else
formspec[#formspec + 1] = minetest.formspec_escape(message.subject)
end
else
formspec[#formspec + 1] = S("(No subject)")
end
end
if mail.selected_idxs.trash[name] then
formspec[#formspec + 1] = ";"
formspec[#formspec + 1] = tostring(mail.selected_idxs.trash[name] + 1)
end
formspec[#formspec + 1] = "]"
else
formspec[#formspec + 1] = "]label[2.25,4.5;" .. S("Trash is empty") .. "]"
end
minetest.show_formspec(name, "mail:trash", table.concat(formspec, ""))
end