Skip to content

Commit

Permalink
strip down to bare mail mod
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Aug 2, 2022
1 parent 3327be9 commit abe3c29
Show file tree
Hide file tree
Showing 15 changed files with 4 additions and 220 deletions.
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ read_globals = {
"unified_inventory", "default",

-- optional mods
"xban", "QoS", "mtt"
"mtt"
}
3 changes: 0 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

The file textures/mail_button.png was created by bas080 and is licensed under the WTFPL.

Webmail component:
WTFPL

All other files:

Copyright (c) 2016 Carter Kolwey ("Cheapie Systems")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Install it like any other mod: copy the directory `mail_mod` to your "worldmods"

## Webmail

See: https://github.com/minetest-mail/mail
To provide a web-based interface to receive/send mails you can use the [mtui](https://github.com/minetest-go/mtui) project

# Commands/Howto

Expand Down
27 changes: 0 additions & 27 deletions attachment.lua

This file was deleted.

46 changes: 1 addition & 45 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,67 +1,23 @@
mail = {

-- mark webmail fork for other mods
fork = "webmail",

-- api version
apiversion = 1.1,

-- mail directory
maildir = minetest.get_worldpath().."/mails",
contactsdir = minetest.get_worldpath().."/mails/contacts",

-- allow item/node attachments
allow_attachments = minetest.settings:get("mail.allow_attachments") == "true",

webmail = {
-- disallow banned players in the webmail interface
disallow_banned_players = minetest.settings:get("webmail.disallow_banned_players") == "true",

-- url and key to the webmail server
url = minetest.settings:get("webmail.url"),
key = minetest.settings:get("webmail.key")
},

tan = {}
contactsdir = minetest.get_worldpath().."/mails/contacts"
}


local MP = minetest.get_modpath(minetest.get_current_modname())
dofile(MP .. "/util/normalize.lua")
dofile(MP .. "/chatcommands.lua")
dofile(MP .. "/migrate.lua")
dofile(MP .. "/attachment.lua")
dofile(MP .. "/hud.lua")
dofile(MP .. "/storage.lua")
dofile(MP .. "/api.lua")
dofile(MP .. "/gui.lua")
dofile(MP .. "/onjoin.lua")

-- optional webmail stuff below
local http = QoS and QoS(minetest.request_http_api(), 2) or minetest.request_http_api()

if http then
local webmail_url = mail.webmail.url
local webmail_key = mail.webmail.key

if not webmail_url then error("webmail.url is not defined") end
if not webmail_key then error("webmail.key is not defined") end

print("[mail] loading webmail-component with endpoint: " .. webmail_url)

mail.handlers = {}
dofile(MP .. "/webmail/tan.lua")
dofile(MP .. "/webmail/webmail.lua")
dofile(MP .. "/webmail/hook.lua")
dofile(MP .. "/webmail/handler_auth.lua")
dofile(MP .. "/webmail/handler_send.lua")
dofile(MP .. "/webmail/handler_messages.lua")
dofile(MP .. "/webmail/handler_delete.lua")
dofile(MP .. "/webmail/handler_mark_read.lua")
dofile(MP .. "/webmail/handler_mark_unread.lua")
mail.webmail_init(http, webmail_url, webmail_key)
end

-- migrate storage
mail.migrate()

Expand Down
2 changes: 1 addition & 1 deletion mod.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name = mail
description = ingame mail-system
optional_depends = unified_inventory,default,xban2,qos,mtt
optional_depends = unified_inventory,default,mtt
45 changes: 0 additions & 45 deletions webmail/handler_auth.lua

This file was deleted.

8 changes: 0 additions & 8 deletions webmail/handler_delete.lua

This file was deleted.

9 changes: 0 additions & 9 deletions webmail/handler_mark_read.lua

This file was deleted.

9 changes: 0 additions & 9 deletions webmail/handler_mark_unread.lua

This file was deleted.

9 changes: 0 additions & 9 deletions webmail/handler_messages.lua

This file was deleted.

7 changes: 0 additions & 7 deletions webmail/handler_send.lua

This file was deleted.

8 changes: 0 additions & 8 deletions webmail/hook.lua

This file was deleted.

16 changes: 0 additions & 16 deletions webmail/tan.lua

This file was deleted.

31 changes: 0 additions & 31 deletions webmail/webmail.lua

This file was deleted.

0 comments on commit abe3c29

Please sign in to comment.