From 95fbeacb35ea60d487e446b7fa5ae6d61f63ade7 Mon Sep 17 00:00:00 2001 From: "psyc://loupsycedyglgamf.onion/~lynX" Date: Wed, 23 May 2018 15:20:50 +0200 Subject: [PATCH] two minor runtime errors --- world/net/jabber/user.c | 7 ++++--- world/net/user.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/world/net/jabber/user.c b/world/net/jabber/user.c index e72c742..c325b81 100644 --- a/world/net/jabber/user.c +++ b/world/net/jabber/user.c @@ -672,12 +672,13 @@ iq(XMLNode node) { case "jabber:iq:roster": switch(node["@type"]) { case "get": - // TODO: this assumes that to is unset and the query is - // to itself + // TODO: this assumes that 'to' is unset and the query is + // to itself. we sometimes get here without a valid tag - + // what should we do then? hasroster = 1; packet = sprintf("" "", - myjid, tag); + myjid, stringp(tag)? tag: ""); // TODO: listAcq does the same basically foreach (friend : ppl) { mixed *u; diff --git a/world/net/user.c b/world/net/user.c index 84f2e51..276df4a 100644 --- a/world/net/user.c +++ b/world/net/user.c @@ -1777,7 +1777,7 @@ quit(immediate, variant) { int stayinalive = 0; // so, SUBSCRIBE_PERMANENT won't work for now. - if (sizeof(v("subscriptions")) && widthof(v("subscriptions"))) { + if (mappingp(v("subscriptions")) && sizeof(v("subscriptions")) && widthof(v("subscriptions"))) { foreach (o, s : places) { P3(("Stay in %O, %O?\n", o, s)) if (v("subscriptions")[lower_case(s)] != SUBSCRIBE_PERMANENT)