plugin autostart xchat
authorChristian Thaeter <ct@pipapo.org>
Tue, 6 Nov 2007 06:43:44 +0000 (07:43 +0100)
committerChristian Thaeter <ct@pipapo.org>
Tue, 6 Nov 2007 06:43:44 +0000 (07:43 +0100)
contrib/irc/xchat/rx.c

index 3317ebb..14dbff2 100644 (file)
@@ -441,6 +441,22 @@ xchat_plugin_init (xchat_plugin *plugin_handle,
     xchat_hook_command (ph, itr->command, XCHAT_PRI_NORM, itr->callback,
                         itr->help, &rx_private);
 
+  char buffer[4096];
+  *buffer = '\0';
+  snprintf (buffer, 4095, "%s/rxpd.conf", xchat_get_info(ph, "xchatdirfs"));
+  FILE* conf = fopen (buffer, "r");
+  if (conf)
+    {
+      if (fgets (buffer, 4095, conf))
+        {
+          char* nl = strchr (buffer, '\n');
+          if (nl)
+            *nl = '\0';
+          xchat_commandf (ph, "RXSTART %s", buffer);
+        }
+      fclose (conf);
+    }
+
   xchat_hook_server (ph, "RAW LINE", XCHAT_PRI_NORM, rxhook_cb, &rx_private);
 
   xchat_print (ph, "Rxpd plugin loaded successfully!\n");