Page 1 of 3
[Mod] Chat plus [2.3] [chatplus] – Now two mods, bug fixes

Posted:
Sat Jun 15, 2013 13:47
by rubenwardy
This mod allows the player to ignore other players on chat. It also provides a mail swear filtering and limiting by distance.Recommended:
emailCommands- /ignore <name> - ignore a player
- /unignore <name> - unignore a player
To limit by distance, set the
chatplus_distance setting in minetest.conf to something higher than 0 (number is meters/nodes)
To disable logging, set chatplus_log to false in minetest.conf.
To block messages with bad words, set chatplus_badwords in minetest.conf to a comma separated list of words.
DownloadLicense: LGPL 2.1 or later.
Dependencies: None
Download latest version... or view it on
GitHubWarning! This mod may not be compatible with any other mods that intercept chat messages!
Unexpected behaviour may occur. You have been warned.Coming soon- Mention highlighter (you are alerted by a beep when someone uses you name)
- Swearing filter
- local chat
- Suggest something!

Posted:
Sun Jun 16, 2013 02:07
by InfinityProject
Nice! If you ignore someone, can they still see what you say?

Posted:
Sun Jun 16, 2013 02:33
by tinoesroho
In the chatstream? From my brief poking at the code, yes. Ignoring will block them from mailing you, though. Changing the default privs to not include shout- possibly in conjunction with a distancechat mod - will "fix" that issue somewhat.

Posted:
Sun Jun 16, 2013 05:14
by BrandonReese
I had to change
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
to
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
from lines 124-142 to keep it from crashing.

Posted:
Sun Jun 16, 2013 14:21
by rubenwardy
Ignoring works like it works in IRC: they can read your messages, but you can not read theirs.
@BrandonReese: That is incorrect, and will cause the mod to stop working properly. I will find out why it does not work.
_players{} contains the player entities (not saved)
players{} contains the player data (saved)
tinoesroho wrote:In the chatstream? From my brief poking at the code, yes. Ignoring will block them from mailing you, though. Changing the default privs to not include shout- possibly in conjunction with a distancechat mod - will "fix" that issue somewhat.
Ignoring will not stop them from mailing you yet, it only works in the chat.
You do not need to revoke "shout". I do not see what the issue is.
(Note: Mail means
/mail name msg, chat means talking on "t")

Posted:
Sun Jun 16, 2013 14:29
by rubenwardy
Fixed this problem.
It was caused when the mod tries to update a player that is not online.
This error was not caught, because it tried:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
not:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Commit: Fix bug if player is offline

Posted:
Mon Jun 17, 2013 02:28
by BrandonReese
rubenwardy wrote:Ignoring works like it works in IRC: they can read your messages, but you can not read theirs.
@BrandonReese: That is incorrect, and will cause the mod to stop working properly. I will find out why it does not work.
_players{} contains the player entities (not saved)
players{} contains the player data (saved)
tinoesroho wrote:In the chatstream? From my brief poking at the code, yes. Ignoring will block them from mailing you, though. Changing the default privs to not include shout- possibly in conjunction with a distancechat mod - will "fix" that issue somewhat.
Ignoring will not stop them from mailing you yet, it only works in the chat.
You do not need to revoke "shout". I do not see what the issue is.
(Note: Mail means
/mail name msg, chat means talking on "t")
Ok thanks, I didn't poke around too much, saw the error and tried my change and it "worked". I'll try the fixed version later tonight.
Edit: Looks like it's working fine!

Posted:
Mon Jun 17, 2013 06:24
by ndjdjksisksk
this is cool! suggeston: can you add a bad word filter to this that would realy work on servers sece so many people swear and curse.

Posted:
Mon Jun 17, 2013 11:30
by rubenwardy
ndjdjksisksk wrote:this is cool! suggeston: can you add a bad word filter to this that would realy work on servers sece so many people swear and curse.
That is actually on my to list

Posted:
Mon Jun 17, 2013 14:52
by Cooper97
rubenwardy wrote:ndjdjksisksk wrote:this is cool! suggeston: can you add a bad word filter to this that would realy work on servers sece so many people swear and curse.
That is actually on my to list
THANKS.
That is awesome.

Posted:
Mon Jun 17, 2013 14:58
by Cooper97
You wrote that the command is /mail <name> <msg>
but if I write /mail Robin this is a text message
it says that no player "this" exists. Is it a bug? (Robin is the account name of my friend)

Posted:
Mon Jun 17, 2013 14:59
by rubenwardy
Cooper97 wrote:You wrote that the command is /mail <name> <msg>
but if I write /mail Robin this is a text message
it says that no player "this" exists. Is it a bug? (Robin is the account name of my friend)
Are you sure that is the text exactly?
I might be because "Robin" has an upper case letter in it. I will check.

Posted:
Mon Jun 17, 2013 15:06
by Cooper97
Yes I am sure. He has the account "Robin" and I "Cooper97" (also upper case letter).

Posted:
Tue Jun 18, 2013 13:01
by rubenwardy
Fixed: The problem is that there is a number in the players name.
Commit: Fix problem with command match pattern

Posted:
Tue Jun 18, 2013 17:15
by ndjdjksisksk
rubenwardy wrote:ndjdjksisksk wrote:this is cool! suggeston: can you add a bad word filter to this that would realy work on servers sece so many people swear and curse.
That is actually on my to list
realy epic i needed a swear word filter

Posted:
Tue Jun 18, 2013 18:03
by kaeza
ndjdjksisksk wrote:rubenwardy wrote:ndjdjksisksk wrote:this is cool! suggeston: can you add a bad word filter to this that would realy work on servers sece so many people swear and curse.
That is actually on my to list
realy epic i needed a swear word filter
Swear word filters (which I think are useless anyway, because you can always find a workaround) would be better client-side, so players that don't care about swearing can leave that open if they want. Anyway, if someone is swearing on a server, you can /ignore them with this mod.

Posted:
Wed Jun 19, 2013 11:36
by rubenwardy
kaeza wrote:ndjdjksisksk wrote:rubenwardy wrote:
That is actually on my to list
realy epic i needed a swear word filter
Swear word filters (which I think are useless anyway, because you can always find a workaround) would be better client-side, so players that don't care about swearing can leave that open if they want. Anyway, if someone is swearing on a server, you can /ignore them with this mod.
i can make it so that players can choose their level of filtering.

Posted:
Mon Jul 01, 2013 15:03
by BrandonReese
I submitted a pull request for some minor improvements to this mod.
This pull request adds a chat message when a user uses /inbox clear so the player receives feedback that the command was successful.
The pull request adds a chat message when the player uses /inbox and they do not have any messages, so they receive feedback that the command was successful.
It delays the onjoin mail notification chat message, it seems sending chat messages or formspecs in the registered onjoin function aren't received by the client, but delaying those actions using minetest.after seems to make things work as expected.
Added chatplus._players[key].lastcount variable, this keeps track of the message count from the last time the hud was redrawn, and only redraws the hud if the message count changes. At times the hud would flicker, only redrawing the hud when the message count changes fixes that, and this will reduce any network traffic (as little as it may be) caused by redrawing the hud every 5 seconds.
I'm also thinking about adding "local chat" to this mod. So when you chat only players within X number of nodes from the chatting player would receive the chat message. You would have to start your chat message with a certain character (e.g. !,*,&) to send a "global" chat message. I wonder how the community would feel about that. Obviously I like it, it helps keep conversations separate. It would take some getting used to.

Posted:
Sun Jul 07, 2013 11:12
by rubenwardy
Thank you very much.
Merged.

Posted:
Wed Aug 14, 2013 16:06
by rubenwardy
[h]0.2 released[/h]
These changes were made in preparation for my new game, capture the flag.
- Added limiting by distance filter
- Added an api
[spoiler=the new API]
-- Registers a handler to determine if the chat msg is sent--FROM: the name of the player it is from--TO: the name of the player it is to--MSG: the text of the msg--return NIL: no action--return TRUE: send msg--return FALSE: cancel msgchatplus.
register_handler(
func(
from,
to,
msg) )[/spoiler]

Posted:
Wed Aug 14, 2013 19:19
by tinoesroho
I'm absolutely chuffed with what you've done. Finally, my LAN survival server is complete. Distance limited-viewing? Check. Limited chat? Check.
Simply fantastic.

Posted:
Thu Aug 15, 2013 16:28
by Cooper97
rubenwardy wrote:[h]Coming soon[/h]
Swearing filter
A swearing filter would be very useful on some servers.

Posted:
Thu Aug 15, 2013 16:44
by Evergreen
I think all I want you to add is what is on your todo list. Amazing job so far.

Posted:
Sat Aug 31, 2013 14:37
by BrunoMine
There is a problem. flooding is possible to inbox.
I suppose you have 15 posts (1 and 2 are important) (3-15 are useless, annoying)
send: /mail
? 1 - Hello, I left the items in bau
? 2 - tidy the house wall
? 3 - bla bla bla
? 4 - bla bla bla
? 5 - bla bla bla
? 6 - bla bla bla
? 7 - bla bla bla
? 8 - bla bla bla
? 9 - bla bla bla
_________________________________________________________
10 - bla bla bla
11 - bla bla bla
13 - bla bla bla
14 - bla bla bla
15 - bla bla bla
1 - 9 were not visualized
It is horrible that, even ignoring the player, simply enter it in server under another name.
solution:
It would be nice if the inbox was displayed in a very large box. It was possible to scroll up and down
I also think it would be good if the email was accessed whenever a computer! So'd have more to put an object at home.

Posted:
Sat Aug 31, 2013 14:54
by BrandonReese
brunob.santos wrote:There is a problem. flooding is possible to inbox.
I suppose you have 15 posts (1 and 2 are important) (3-15 are useless, annoying)
send: /mail
? 1 - Hello, I left the items in bau
? 2 - tidy the house wall
? 3 - bla bla bla
? 4 - bla bla bla
? 5 - bla bla bla
? 6 - bla bla bla
? 7 - bla bla bla
? 8 - bla bla bla
? 9 - bla bla bla
_________________________________________________________
10 - bla bla bla
11 - bla bla bla
13 - bla bla bla
14 - bla bla bla
15 - bla bla bla
1 - 9 were not visualized
It is horrible that, even ignoring the player, simply enter it in server under another name.
solution:
It would be nice if the inbox was displayed in a very large box. It was possible to scroll up and down
I also think it would be good if the email was accessed whenever a computer! So'd have more to put an object at home.
You can press F10 and scroll up in the console window to see the rest of the mail items.

Posted:
Sat Aug 31, 2013 16:50
by BrunoMine
Living and discovering! Thanks for the solution. But I think it would be cool to idea of the computer! I think we should explore the possibilities of using a work area in pcs.
We could use pcs for:
Access banking balance and make payments
Use our inbox
Read news event server
Read a wiki server
Enter and exit rooms private chat.
All this without becoming annoying Recurring commands!
But anyway, I believe it will happen when the minetest become a very famous game.

Posted:
Sat Sep 21, 2013 16:44
by fairiestoy
Hello ruben,
i came up with a suggestion when looking through my fork of this and watching the user traffic on the landruch server. I think its necessary to include some kind of time check when a user last log in. Otherwise, your file will be fed up by dozens of users that show up only once and never come back. But they do take place in your files, therefore it might be a good idea to attach a date to each user when he last logged in and delete him after a specific timespan. About compatibility with your old files: Since you are only storing a serialized table, you could make check on init (when loading the data from file) if each user has already such a date. It will increase the server load time, but will keep the resulting file smaller as well as the used memory.
Greetings

Posted:
Tue Jan 07, 2014 18:20
by rubenwardy
[h]0.5 Released![/h]
Reworked code to be more stable and logical.
When the game is loaded, it cleans stored data to get rid of any unneeded ones, fixing @fairiestoy's problem.
To enable distance limitation, set
chatplus_distance in minetest.conf to something bigger than zero.
To disable logging, set
chatplus_log to false in minetest.conf.
Coming soon:- Freeminer specific features (coloring)
- Mention Highlighting

Posted:
Tue Jan 07, 2014 19:51
by Krock
Can't say much about this, I like this mod!
A GUI would be a cool addition but right now it's working well :)
EDIT: sorry, it's not working well:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
/mail singleplayer haiiii
20:55:21: ERROR[main]: ServerError: LuaError: E:\Programme\minetest\bin\..\mods\
chatplus\init.lua:288: bad argument #1 to 'insert' (table expected, got nil)
20:55:21: ERROR[main]: stack traceback:
20:55:21: ERROR[main]: [C]: in function 'insert'
20:55:21: ERROR[main]: E:\Programme\minetest\bin\..\mods\chatplus\init.lua:288:
in function 'func'
20:55:21: ERROR[main]: E:\Programme\minetest\bin\..\builtin/chatcommands.lua:25
: in function <E:\Programme\minetest\bin\..\builtin/chatcommands.lua:16>

Posted:
Tue Jan 07, 2014 20:02
by rubenwardy