]> jfr.im git - irc/evilnet/x3.git/commitdiff
mod-python: add emb_fakehost function
authorhstuart <redacted>
Mon, 12 Oct 2009 09:24:18 +0000 (09:24 +0000)
committerhstuart <redacted>
Mon, 12 Oct 2009 09:24:18 +0000 (09:24 +0000)
ChangeLog
src/mod-python.c

index 7c862a89cb20e10e4e25e49b06c75f08f4c88fe5..41613e8964623730d5f0c26d29cf763752db46ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
 /***********************************************************************
 X3 ChangeLog
 
+2009-10-12  Henrik Stuart <evilnet@hstuart.dk>
+
+       * src/mod-python.c: add emb_fakehost function.
+
 2009-10-12  Henrik Stuart <evilnet@hstuart.dk>
 
        * src/mod-python.c: add emb_user_mode function.
index 694c80ea5bd52fd1e59884ad96a493c3a8efe9fe..a9389b2899070c569ca48b9f980cffb0fcfcc8b1 100644 (file)
@@ -913,6 +913,26 @@ static PyObject* emb_user_mode(UNUSED_ARG(PyObject* self), PyObject* args) {
     return Py_None;
 }
 
+static PyObject* emb_fakehost(UNUSED_ARG(PyObject* self), PyObject* args) {
+    struct userNode* target;
+    char const* host;
+
+    char const* target_s;
+
+    if (!PyArg_ParseTuple(args, "ss", &target_s, &host))
+        return NULL;
+
+    if ((target = GetUserH(target_s)) == NULL) {
+        PyErr_SetString(PyExc_Exception, "unknown user");
+        return NULL;
+    }
+
+    irc_fakehost(target, host);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
 static PyMethodDef EmbMethods[] = {
     /* Communication methods */
     {"dump", emb_dump, METH_VARARGS, "Dump raw P10 line to server"},
@@ -922,6 +942,8 @@ static PyMethodDef EmbMethods[] = {
 //TODO:    {"exec_cmd", emb_exec_cmd, METH_VARARGS, "execute x3 command provided"},
 //          This should use environment from "python command" call to pass in, if available
     {"kill", emb_kill, METH_VARARGS, "Kill someone"},
+    {"fakehost", emb_fakehost, METH_VARARGS, "Set a user's fakehost"},
+//TODO: svsnick, svsquit, svsjoin, svsmode, svsident, nick, quit, join, part, ident, vhost
 //TODO:    {"shun"
 //TODO:    {"unshun"
 //TODO:    {"gline", emb_gline, METH_VARARGS, "gline a mask"},