# HG changeset patch # User Markus Bröker # Date 1266919492 -3600 # Node ID 34094173351c48aab6e39a6b0a0d3b42c13a89ce # Parent a689b6a8e6ed34d19201170d89afff5bd3759a1d message.email renamed to message.domain The struct field "email" is not an email, it's the "domain" of the admin user. committer: Markus Bröker diff --git a/INSTALL b/INSTALL --- a/INSTALL +++ b/INSTALL @@ -17,7 +17,7 @@ STEP 4) dbtool -a -k mcbot.cgi -v http://your.domain.com/cgi-bin/mcbot.cgi dbtool -a -k mcbot.user -v # mbroeker - dbtool -a -k mcbot.email -v # pppool.de + dbtool -a -k mcbot.domain -v # pppool.de STEP 5) Check your locale settings in /etc/init.d/mcbot diff --git a/include/irc.h b/include/irc.h --- a/include/irc.h +++ b/include/irc.h @@ -15,7 +15,7 @@ FILE *stream; char *nick; char *user; - char *email; + char *domain; char *command; char *channel; char *line; diff --git a/src/irc.c b/src/irc.c --- a/src/irc.c +++ b/src/irc.c @@ -169,7 +169,7 @@ else garbage_collector = theLine; - message->user = message->email = NULL; + message->user = message->domain = NULL; message->command = NULL; message->channel = message->line = NULL; @@ -253,8 +253,8 @@ *ptr = '\0'; return command; case PRIVMSG: - if ((message->email = strchr (message->user, '@'))) - ++message->email; + if ((message->domain = strchr (message->user, '@'))) + ++message->domain; if ((ptr = strchr (message->user, '!'))) *ptr = '\0'; diff --git a/src/parse.c b/src/parse.c --- a/src/parse.c +++ b/src/parse.c @@ -85,8 +85,8 @@ */ if (message->user == NULL) message->user = "error"; - if (message->email == NULL) - message->email = "server.err"; + if (message->domain == NULL) + message->domain = "server.err"; /* * default message @@ -123,7 +123,7 @@ case JOIN: if ((token = strtok (NULL, "\r\n"))) if (strstr (message->user, db_lookup (DATABASE_FILE, "mcbot.user"))) { - if (strstr (message->email, db_lookup (DATABASE_FILE, "mcbot.email"))) + if (strstr (message->domain, db_lookup (DATABASE_FILE, "mcbot.domain"))) snprintf (msg, sizeof (msg), "JOIN %s\r\n", token); } return msg; @@ -132,7 +132,7 @@ if (*message->channel != '#') return NULL; if (strstr (message->user, db_lookup (DATABASE_FILE, "mcbot.user"))) { - if (strstr (message->email, db_lookup (DATABASE_FILE, "mcbot.email"))) + if (strstr (message->domain, db_lookup (DATABASE_FILE, "mcbot.domain"))) snprintf (msg, sizeof (msg), "PART %s :Leaving.\r\n", message->channel); } return msg; @@ -209,8 +209,8 @@ return msg; case DEBUG: - snprintf (msg, sizeof (msg), "PRIVMSG %s :USER: %s EMAIL: %s CHANNEL: %s LINE: %s\r\n", - message->channel, message->user, message->email, message->channel, message->line); + snprintf (msg, sizeof (msg), "PRIVMSG %s :USER: %s domain: %s CHANNEL: %s LINE: %s\r\n", + message->channel, message->user, message->domain, message->channel, message->line); return msg; case VACCUUM: @@ -219,7 +219,7 @@ case LOGOUT: if (strstr (message->user, db_lookup (DATABASE_FILE, "mcbot.user"))) { - if (strstr (message->email, db_lookup (DATABASE_FILE, "mcbot.email"))) { + if (strstr (message->domain, db_lookup (DATABASE_FILE, "mcbot.domain"))) { snprintf (msg, sizeof (msg), "PRIVMSG %s :%s!\r\nQUIT\r\n", message->channel, gettext ("Bye, have a nice day!")); } @@ -266,7 +266,7 @@ case OP: if ((token = strtok (NULL, "\r\n")) != NULL) { if (strstr (message->user, db_lookup (DATABASE_FILE, "mcbot.user"))) { - if (strstr (message->email, db_lookup (DATABASE_FILE, "mcbot.email"))) + if (strstr (message->domain, db_lookup (DATABASE_FILE, "mcbot.domain"))) snprintf (msg, sizeof (msg), "MODE %s +o %s\r\n", message->channel, token); } } @@ -275,7 +275,7 @@ case DEOP: if ((token = strtok (NULL, "\r\n")) != NULL) { if (strstr (message->user, db_lookup (DATABASE_FILE, "mcbot.user"))) { - if (strstr (message->email, db_lookup (DATABASE_FILE, "mcbot.email"))) + if (strstr (message->domain, db_lookup (DATABASE_FILE, "mcbot.domain"))) snprintf (msg, sizeof (msg), "MODE %s -o %s\r\n", message->channel, token); } } @@ -284,7 +284,7 @@ case KICK: if ((token = strtok (NULL, "\r\n")) != NULL) { if (strstr (message->user, db_lookup (DATABASE_FILE, "mcbot.user"))) { - if (strstr (message->email, db_lookup (DATABASE_FILE, "mcbot.email"))) + if (strstr (message->domain, db_lookup (DATABASE_FILE, "mcbot.domain"))) snprintf (msg, sizeof (msg), "KICK %s %s\r\n", message->channel, token); } } @@ -293,7 +293,7 @@ case BAN: if ((token = strtok (NULL, "\r\n")) != NULL) { if (strstr (message->user, db_lookup (DATABASE_FILE, "mcbot.user"))) { - if (strstr (message->email, db_lookup (DATABASE_FILE, "mcbot.email"))) + if (strstr (message->domain, db_lookup (DATABASE_FILE, "mcbot.domain"))) snprintf (msg, sizeof (msg), "MODE %s +b %s\r\n", message->channel, token); } } @@ -302,7 +302,7 @@ case UNBAN: if ((token = strtok (NULL, "\r\n")) != NULL) { if (strstr (message->user, db_lookup (DATABASE_FILE, "mcbot.user"))) { - if (strstr (message->email, db_lookup (DATABASE_FILE, "mcbot.email"))) + if (strstr (message->domain, db_lookup (DATABASE_FILE, "mcbot.domain"))) snprintf (msg, sizeof (msg), "MODE %s -b %s\r\n", message->channel, token); } } @@ -311,7 +311,7 @@ case KICKBAN: if ((token = strtok (NULL, "\r\n")) != NULL) { if (strstr (message->user, db_lookup (DATABASE_FILE, "mcbot.user"))) { - if (strstr (message->email, db_lookup (DATABASE_FILE, "mcbot.email"))) + if (strstr (message->domain, db_lookup (DATABASE_FILE, "mcbot.domain"))) snprintf (msg, sizeof (msg), "MODE %s +b %s\r\nKICK %s %s\r\n", message->channel, token, message->channel, token); }