tried to reorder the program structure and build process
[NeonServV5.git] / src / cmd_neonserv_inviteme.c
diff --git a/src/cmd_neonserv_inviteme.c b/src/cmd_neonserv_inviteme.c
new file mode 100644 (file)
index 0000000..a5c3f16
--- /dev/null
@@ -0,0 +1,20 @@
+
+#include "cmd_neonserv.h"
+
+/*
+* no arguments
+*/
+
+CMD_BIND(neonserv_cmd_inviteme) {
+    if(getChanUser(user, chan)) {
+        reply(getTextBot(), user, "NS_INVITEME_ON_CHAN", chan->name);
+        /* BUG
+         This check does not work if the user is invisible (CHMODE +D/+d)
+         to fix this we'd need to request the full userlist...
+         this is really senseless to invite a simple user so we simply mark this bug as unsolvable.
+        */
+        return;
+    }
+    putsock(client, "INVITE %s %s", user->nick, chan->name);
+    reply(getTextBot(), user, "NS_INVITEME_DONE", chan->name);
+}