From 958980e2d6fd3af427121f899c752336306962bb Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Wed, 4 Nov 2009 19:10:32 +0100 Subject: [PATCH] a bit cleaner --- world/net/jabber/user.c | 15 ++++++++------- world/net/person.c | 25 ------------------------- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/world/net/jabber/user.c b/world/net/jabber/user.c index a0e7ef2..32e02f0 100644 --- a/world/net/jabber/user.c +++ b/world/net/jabber/user.c @@ -572,15 +572,16 @@ iq(XMLNode node) { P3(("+++ %O IQ node %O\n", ME, node)) iqchild = getiqchild(node); - unless(iqchild) switch(node["@type"]) { - case "get": - case "set": - case "result": - case "error": - break; + unless (iqchild && mappingp(iqchild)) switch(node["@type"]) { + case "get": + case "set": + case "result": + case "error": + P1(("%O got empty iq %O\n", ME, node)) + return; default: P1(("%O got invalid iq %O\n", ME, node)) - return; + return; } helper = iqchild; diff --git a/world/net/person.c b/world/net/person.c index 2b80bc0..8068d2d 100644 --- a/world/net/person.c +++ b/world/net/person.c @@ -1011,34 +1011,10 @@ case "_set_password": // TODO? add support for integer _service means multiple // catch-all clients possible. do we want this? if (vars["_service"]) { - // oh. we let it suggest a *different* location? - // interesting. why don't we also do this for clients? - // and who is using this code anyway? linkDel(vars["_service"]); linkSet(vars["_service"], vars["_location"], source); return 0; } -#if 0 - if (vars["_password"]) { -#ifndef VOLATILE - // obviously similar code in usercmd:set() - if (!v("password") && - (t = legal_password(vars["_password"], - MYNICK))) { - ME->pr(t[0], t[1]); // TODO - return; - } - // why do we check password here again - // if we are just after a checkPassword? - // what are we doing here? -#endif - } else if (ONLINE && - v("locations")[0] != source) { - sendmsg(source, - "_error_status_person_connected"); - return 0; - } -#else // this code should also run for _service, but it // needs a reorg t = v("locations")[0]; @@ -1058,7 +1034,6 @@ case "_set_password": // now we leave the old client circuit // to die off.. let's hope that's safe } -#endif #ifdef _flag_disable_module_trust unless(stringp(source)) { m_delete(v("locations"), 0);