don't error when iq set comes without item

This commit is contained in:
psyc://psyced.org/~lynX 2009-03-21 10:52:05 +01:00
parent c5325aedaf
commit 349a7e92e3
3 changed files with 47 additions and 29 deletions

View File

@ -39,24 +39,32 @@ lo=""
if test -d "/etc/portage" if test -d "/etc/portage"
then then
cat <<EOT cat <<X
${hi}!!INFO FOR GENTOO USERS!!${lo}
If you are running gentoo/portage, you should try out our beautiful ebuilds
at http://www.psyced.org/files/gentoo.tar.bz2 --- They are also in the
data.tar. Unpack it, then go into the config/gentoo directory and run make.
EOT !!${hi} HEY YOU, PORTAGE USER ${lo}!!
If you are running gentoo/portage you should try out our beautiful ebuilds
at http://www.psyced.org/files/gentoo.tar.bz2 instead of this installation
script. Stop it now.
${hi}Warning: OLD-SCHOOL install.sh STARTING${lo} ...
X
sleep 2 sleep 2
fi fi
if test -e .config if test -e .config
then then
echo "You have been installing this before. I will use the previous" cat <<X
echo "install settings as defaults for this run." You have been installing this before. I will use the previous install .config
as defaults for this run.
X
else else
echo "Should you want to use the install settings from the last time" cat <<X
echo "you installed psyced, please copy the .config file into here" Should you want to use the install settings from the last time you installed
echo "and restart this script." psyced, please copy the .config file into here and restart this script.
X
fi fi
if touch .config 2> /dev/null if touch .config 2> /dev/null
@ -164,10 +172,12 @@ echo "${hi}PSYCED INSTALLATION WIZARD${lo}"
if ! test -e data.tar if ! test -e data.tar
then then
echo "This installation script is designed to work with an image of the" cat <<X
echo "current development tree in a file called data.tar. Obtain a" This installation script is designed to work with an image of the current
echo "psyced release tar from http://www.psyced.org, which contains" development tree in a file called data.tar. Obtain a psyced release tar from
echo "both this script and its data.tar" http://www.psyced.org, which contains both this script and its data.tar.
X
$exit $exit
fi fi
@ -399,17 +409,18 @@ ask "Set PSYC hostname to" SERVER_HOST
get CHATNAME $HOST_NAME get CHATNAME $HOST_NAME
#ask "Name of your chat service" CHATNAME #ask "Name of your chat service" CHATNAME
echo "" cat <<X
echo "Now comes the best part. You get to decide which of the many"
echo "protocols and services that psyced provides you want to" Now comes the best part. You get to decide which of the many protocols and
echo "activate. Since ${driver} doesn't have the ability to run safely" services that psyced provides you want to activate. Since ${driver} doesn't
echo "as root all protocols use non-privileged port numbers." have the ability to run safely as root, all protocols use non-privileged
echo "We also mention the official privileged port numbers in case" port numbers. We also mention the official privileged port numbers in case
echo "you want to set up a firewall based port mapping." you want to set up a firewall based port mapping.
#cho ""
#cho "If you need to change the port numbers you can do so later on" If you need to change the port numbers later on, you can do so by editing
#cho "by editing the psyced script. You must remain however" the psyconf.ini configuration file.
#cho "within certain numeric ranges for each protocol." X
# FIXME: in fact we should probably not ask about port numbers here
get PSYC_YN "y" get PSYC_YN "y"
ask "Enable PSYC (you better say yes here)" PSYC_YN ask "Enable PSYC (you better say yes here)" PSYC_YN
@ -464,7 +475,7 @@ else
fi fi
get JABBER_YN "y" get JABBER_YN "y"
ask "Enable access for Jabber/XMPP clients (experimental)" JABBER_YN ask "Enable access for Jabber/XMPP clients" JABBER_YN
if test "$JABBER_YN" = "n" if test "$JABBER_YN" = "n"
then then

View File

@ -230,7 +230,7 @@
// fippo's brilliant single-user channel emulation for jabber MUCs // fippo's brilliant single-user channel emulation for jabber MUCs
// unfortunately it provides no advantages over the old method, yet. // unfortunately it provides no advantages over the old method, yet.
// would be cool to cache a member list at least! TODO // would be cool to cache a member list at least! TODO
# define PERSISTENT_SLAVES // efine PERSISTENT_SLAVES // postponed
// efine IRC_FRIENDCHANNEL // hopelessly needs more work // efine IRC_FRIENDCHANNEL // hopelessly needs more work
# ifdef HTTP_PATH # ifdef HTTP_PATH
# define HTFORWARD // let person entity buffer output for http usage # define HTFORWARD // let person entity buffer output for http usage

View File

@ -732,7 +732,14 @@ iq(XMLNode node) {
break; break;
case "set": case "set":
helper = helper["/item"]; helper = helper["/item"];
if (helper && helper["@subscription"] == "remove") { if (!mappingp(helper)) {
P1(("no item in iq set %O from %O in %O\n",
node, previous_object(), ME))
// FIXME: what is the correct behaviour
// in this case?
return;
}
if (helper["@subscription"] == "remove") {
string buddy = jid2ppl(helper["@jid"]); string buddy = jid2ppl(helper["@jid"]);
#ifndef _flag_disable_module_friendship #ifndef _flag_disable_module_friendship
P2(("remove %O from roster\n", helper["@jid"])) P2(("remove %O from roster\n", helper["@jid"]))