summaryrefslogtreecommitdiff
path: root/louloulibs/xmpp/adhoc_commands_handler.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-09-01 04:42:12 +0200
committerFlorent Le Coz <louiz@louiz.org>2015-09-01 04:42:12 +0200
commite8f22efe34415db0e1e5cb94635b089b18efe055 (patch)
tree64088065cd97cb941b9d35016c0dcf3aaf355c5e /louloulibs/xmpp/adhoc_commands_handler.cpp
parentdf006a191603c4a9f0bb364affa3731c2944fef5 (diff)
downloadbiboumi-e8f22efe34415db0e1e5cb94635b089b18efe055.tar.gz
biboumi-e8f22efe34415db0e1e5cb94635b089b18efe055.tar.bz2
biboumi-e8f22efe34415db0e1e5cb94635b089b18efe055.tar.xz
biboumi-e8f22efe34415db0e1e5cb94635b089b18efe055.zip
XmlNodes are now always closed
Remove the close() method and closed attribute. Remove all the calls to close(). (Save one bool per XmlNode, yay, and save a few ifs and some useless function calls. At best it should be unnoticeably faster and lighter and save a few keystrokes in the future)
Diffstat (limited to 'louloulibs/xmpp/adhoc_commands_handler.cpp')
-rw-r--r--louloulibs/xmpp/adhoc_commands_handler.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/louloulibs/xmpp/adhoc_commands_handler.cpp b/louloulibs/xmpp/adhoc_commands_handler.cpp
index 46c8a32..458a22c 100644
--- a/louloulibs/xmpp/adhoc_commands_handler.cpp
+++ b/louloulibs/xmpp/adhoc_commands_handler.cpp
@@ -36,9 +36,7 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, Xm
XmlNode error(ADHOC_NS":error");
error["type"] = "cancel";
XmlNode condition(STANZA_NS":item-not-found");
- condition.close();
error.add_child(std::move(condition));
- error.close();
command_node.add_child(std::move(error));
}
else if (command_it->second.is_admin_only() &&
@@ -47,9 +45,7 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, Xm
XmlNode error(ADHOC_NS":error");
error["type"] = "cancel";
XmlNode condition(STANZA_NS":forbidden");
- condition.close();
error.add_child(std::move(condition));
- error.close();
command_node.add_child(std::move(error));
}
else
@@ -72,9 +68,7 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, Xm
XmlNode error(ADHOC_NS":error");
error["type"] = "modify";
XmlNode condition(STANZA_NS":bad-request");
- condition.close();
error.add_child(std::move(condition));
- error.close();
command_node.add_child(std::move(error));
}
else if (action == "execute" || action == "next" || action == "complete")
@@ -95,9 +89,7 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, Xm
command_node["status"] = "executing";
XmlNode actions("actions");
XmlNode next("next");
- next.close();
actions.add_child(std::move(next));
- actions.close();
command_node.add_child(std::move(actions));
}
}
@@ -112,9 +104,7 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, Xm
XmlNode error(ADHOC_NS":error");
error["type"] = "modify";
XmlNode condition(STANZA_NS":bad-request");
- condition.close();
error.add_child(std::move(condition));
- error.close();
command_node.add_child(std::move(error));
}
}