telnetchat now supports bell master
telnetchat now supports bell

file:a/.vstmDB -> file:b/.vstmDB
--- a/.vstmDB
+++ b/.vstmDB
@@ -4,4 +4,5 @@
 @H variables MAX_NICK_LEN and NICK_SPACE_NEEDED
 @L implement locking for users file
 @H Do the PKG and co.
+@H Handle Utf-8
 

file:a/src/chat.c -> file:b/src/chat.c
--- a/src/chat.c
+++ b/src/chat.c
@@ -185,6 +185,9 @@
 	len = strlen(to_send);
 
 	write(client_get_fd(srv, to_whom), to_send, len);
+	if(srv->client_list[to_whom].send_bell) {
+		write(client_get_fd(srv, to_whom), "\a", 1);
+	}
 /*	if (to_send[len] != '\n')
 		write(client_get_fd(srv, to_whom), "\n", 1); */
 } /* }}} */

--- a/src/connections.c
+++ b/src/connections.c
@@ -74,6 +74,8 @@
 	srv->client_list[new_client].allow_colors = srv->allow_colors_dft;
 
 	srv->client_list[new_client].id = (time(NULL) % MAX_CLIENTS);
+
+	srv->client_list[new_client].send_bell = DFT_SEND_BELL;
 
 	asprintf(&buffer, "User %d", new_client);
 	srv->client_list[new_client].nick = buffer;

--- a/src/extra_options.c
+++ b/src/extra_options.c
@@ -97,6 +97,31 @@
 	}
 	else {
 		send_msg_to_client(srv, TNCMSG_OPT_COLOR_MSG_HELP"\n", asker);
+	}
+
+} /* }}} */
+
+void
+client_opt_bell(struct srv_conf *srv, int asker, char *args)
+{ /* {{{ */
+
+	if(args) {
+		if((args[0] == 'n') || (args[0] == 'N') || (args[0] == '0') ||
+		   (args[0] == 'd')) {
+			srv->client_list[asker].send_bell = 0;
+			send_msg_to_client(srv, TNCMSG_OPT_BELL_OFF"\n", asker);
+		}
+		else {
+			srv->client_list[asker].send_bell = 1;
+			send_msg_to_client(srv, TNCMSG_OPT_BELL_ON"\n", asker);
+		}
+	}
+	else {
+		if(srv->client_list[asker].send_bell)
+			send_msg_to_client(srv, TNCMSG_OPT_BELL_ON"\n", asker);
+		else
+			send_msg_to_client(srv, TNCMSG_OPT_BELL_OFF"\n", asker);
+		send_msg_to_client(srv, TNCMSG_OPT_BELL_HELP"\n", asker);
 	}
 
 } /* }}} */

--- a/src/extra_options.h
+++ b/src/extra_options.h
@@ -8,6 +8,9 @@
 
 void
 client_opt_color(struct srv_conf *srv, int asker, char *args);
+
+void
+client_opt_bell(struct srv_conf *srv, int asker, char *args);
 
 void
 client_opt_nick(struct srv_conf *srv, int asker, char *args);

--- a/src/messages.h
+++ b/src/messages.h
@@ -10,6 +10,10 @@
 #define TNCMSG_OPT_COLOR_MSG_DISABLED "Colors disabled !"
 #define TNCMSG_OPT_COLOR_MSG_ENABLED "Colors enabled !"
 #define TNCMSG_OPT_COLOR_MSG_HELP "Enable (Y/1) or Disable (N/0) colors"
+/* BELL */
+#define TNCMSG_OPT_BELL_ON "Bell is on"
+#define TNCMSG_OPT_BELL_OFF "Bell is off"
+#define TNCMSG_OPT_BELL_HELP "To activate bell: /bell Y/1; deactivate: /bell N/0"
 /* LIST */
 #define TNCMSG_OPT_LIST_IT_IS_YOU "<- that's you"
 /* SLAP */

--- a/src/options.c
+++ b/src/options.c
@@ -64,6 +64,9 @@
 	}
 	else if(cmp_arg_is(sent+1, "color")) {
 		client_opt_color(srv, client, get_args(sent));
+	}
+	else if(cmp_arg_is(sent+1, "bell")) {
+		client_opt_bell(srv, client, get_args(sent));
 	}
 	else if(cmp_arg_is(sent+1, "slap")) {
 		client_opt_slap(srv, client, get_args(sent));

--- a/src/server.h
+++ b/src/server.h
@@ -68,6 +68,8 @@
 	short admin;
 	short allow_colors;
 	short client_color;
+#define DFT_SEND_BELL 0
+	short send_bell;
 };
 
 struct srv_conf