]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/proto-p10.c
Fixing small bug in x3.conf.example
[irc/evilnet/x3.git] / src / proto-p10.c
index 7acf0c0affcec2ca556e5cc8d7f4f1a6892cb988..a9731da75b8d1b302f2236b525c8a2afcaee514d 100644 (file)
@@ -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);