When you can't think of
anything else to code, here's something you might concider: Messaging.
Background:Quite many times I've had something to say to some user browsing my server.. like recommending something to download for example. Only way to say it has been to ban that person temporarily, type the message as the
"reason" and hope they would get it when they request the next page..
Also, sometimes while browsing someone elses server I'd like to be able to send a message to the server owner. In that case the only way has been to type my message to the URL after "?" sign and
hope they'd spot that request from the log..
Here's a simple messaging protocol to help in this kind of situations and also to allow messaging between the users.
Look & feel:A new private message has arrived when user was browsing the server. Instead of serving the requested page to the user, HFS serves this private messages page with a link to continue where he was really going. This page lists
all the private messages user has received from any sender. To reply to specific user, its name can be clicked to change that value into he
To: box. Also, multiple receivers could be added by separating them with comma. When a message has arrived and user is redirected to this page, the senders name obviously is the default value of the To: box.
The Chat history list would actually be just a borderless white table (with three columns) inside an iFrame (with 5 sec autoupdate).
At the bottom of the page there's a link to clear all private messages of that username and IP-address. Otherwise anyone logging in from same IP-address or with same username later could see these messages.
This is the servers public chat page. It's accessible using the link at the page footer. Here anyone can post messages that everyone can see. Clicking any username or IP-address would open up the private chat window with that username or ip-address in the To: box.
Otherwise this would be similar to the private chat window ...with the exeption that public messages cannot be cleared.
Users own messages are, like in private chat too, grayed to hide them a bit.
Additionally, when user is chatting from 127.0.0.1 aka
localhost he would be considered as
Server.
Private messages pointed to the server owner would open up a simple popup window in HFS...
In this case it might be better if every user has it's own popup window and all Servers private messages are not in the same list...or I don't know..
User would have to have an option to select whether these popup windows are displayed also when HFS is minimized to tray icon or only after HFS is opened from the tray by the user.
Similar window for the public chat... Server admin can clear the whole public chat history with that Clear button.
Under the hood:HFS would have a (hidden) "message log" with format:
[time][from][to][message] This would include
all messaging happened inside HFS...every message sent.
Example:12:15:42 123.34.56.678 Server "Hello!"
12:15:49 Server 123.34.56.678 "Hello to u too"
14:52:11 mike@234.423.23.33 All "....."
14:52:59 amanda@42.244.53.11 mike "......."
14:53:50 mike@234.423.23.33 42.244.53.11 "......"
16:21:45 Server 123.34.56.678,mike,amanda "......."
*
Server is obviously the server admin
* Message with
All as [to] value is a public message
* Messages [From] anonymous users get an entry according to their IP-address
* Messages [From] logged in users get an entry including their name
and IP-address
* Receiver [To] can only be a name OR an IP-address (or many of then separated by comma)
(not name@12.34.56.7 because then "name" would not see his messages when he logs in at 76.54.32.1)Parsing the message logWhen for example user
john logs in at 123.34.56.678 and his
private messages are requested, the log is searched for
* line that has user john OR IP 123.34.56.678 in its [To] field
* line that has user john OR IP 123.34.56.678 in its [From] field AND where [To] is NOT "All"
The resulting lines would then be output into the table inside the iframe as described earlier.
The same way when someone opens up
public chat, the message log is searched for any line that has "All" as its To value.
Clear messages function would work just the same way as these searches but it would just delete the matching lines found.
I don't know if this is the most effective or logical way of things to work...but this is the way I see it would be reasonably "doable" with rather low effort. If someone can think of better ways to do this, just let us know...
Here are the mockup images also as attachments: