X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/ec311f39148004a0a43ce45371bd02c61f19f886..c02cd944e0261c030db976e64815929681302462:/src/proto-p10.c diff --git a/src/proto-p10.c b/src/proto-p10.c index 7acf0c0..a9731da 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -3,7 +3,7 @@ * * This file is part of x3. * - * srvx is free software; you can redistribute it and/or modify + * x3 is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. @@ -903,13 +903,18 @@ irc_part(struct userNode *who, struct chanNode *what, const char *reason) void irc_topic(struct userNode *service, struct userNode *who, struct chanNode *what, const char *topic) { -/* UNCOMMENT FOR NEFARIOUS 0.5.0 TOPIC SUPPORT - * putsock("%s " P10_TOPIC " %s %s " FMT_TIME_T " " FMT_TIME_T " :%s", service->numeric, what->name, who->nick, what->timestamp, now, topic); - * UNCOMMENT FOR NEFARIOUS 0.5.0 TOPIC SUPPORT */ - who = service; /* REMOVE LINE FOR NEFARIOUS 0.5.0 */ + int type = 4; + const char *str; + str = conf_get_data("server/type", RECDB_QSTRING); + type = atoi(str); - putsock("%s " P10_TOPIC " %s :%s", who->numeric, what->name, topic); + if (type == 5) { + putsock("%s " P10_TOPIC " %s %s " FMT_TIME_T " " FMT_TIME_T " :%s", service->numeric, what->name, who->nick, what->timestamp, now, topic); + } else { + who = service; /* REMOVE LINE FOR NEFARIOUS 0.5.0 */ + putsock("%s " P10_TOPIC " %s :%s", who->numeric, what->name, topic); + } } void @@ -1904,6 +1909,11 @@ init_parse(void) /* We have reliable clock! Always! Wraaa! */ dict_insert(irc_func_dict, CMD_SETTIME, cmd_dummy); dict_insert(irc_func_dict, TOK_SETTIME, cmd_dummy); + + /* ignore /trace and /motd commands targetted at us */ + dict_insert(irc_func_dict, TOK_TRACE, cmd_dummy); + dict_insert(irc_func_dict, TOK_MOTD, cmd_dummy); + /* handle topics */ dict_insert(irc_func_dict, "331", cmd_num_topic); dict_insert(irc_func_dict, "332", cmd_num_topic);