Remove a bunch of useless string_literal usage
This commit is contained in:
@@ -59,7 +59,7 @@ void HelloStep2(XmppComponent&, AdhocSession& session, XmlNode& command_node)
|
||||
command_node.delete_all_children();
|
||||
XmlSubNode note(command_node, "note");
|
||||
note["type"] = "info";
|
||||
note.set_inner("Hello "s + value_str + "!"s);
|
||||
note.set_inner("Hello " + value_str + "!"s);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ void AdhocCommandsHandler::add_command(std::string name, AdhocCommand command)
|
||||
{
|
||||
const auto found = this->commands.find(name);
|
||||
if (found != this->commands.end())
|
||||
throw std::runtime_error("Trying to add an ad-hoc command that already exist: "s + name);
|
||||
throw std::runtime_error("Trying to add an ad-hoc command that already exist: " + name);
|
||||
this->commands.emplace(std::make_pair(std::move(name), std::move(command)));
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, co
|
||||
std::forward_as_tuple(command_it->second, executor_jid, to));
|
||||
TimedEventsManager::instance().add_event(TimedEvent(std::chrono::steady_clock::now() + 3600s,
|
||||
std::bind(&AdhocCommandsHandler::remove_session, this, sessionid, executor_jid),
|
||||
"adhocsession"s + sessionid + executor_jid));
|
||||
"adhocsession" + sessionid + executor_jid));
|
||||
}
|
||||
auto session_it = this->sessions.find(std::make_pair(sessionid, executor_jid));
|
||||
if ((session_it != this->sessions.end()) &&
|
||||
@@ -74,7 +74,7 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, co
|
||||
{
|
||||
this->sessions.erase(session_it);
|
||||
command_node["status"] = "completed";
|
||||
TimedEventsManager::instance().cancel("adhocsession"s + sessionid + executor_jid);
|
||||
TimedEventsManager::instance().cancel("adhocsession" + sessionid + executor_jid);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -87,7 +87,7 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, co
|
||||
{
|
||||
this->sessions.erase(session_it);
|
||||
command_node["status"] = "canceled";
|
||||
TimedEventsManager::instance().cancel("adhocsession"s + sessionid + executor_jid);
|
||||
TimedEventsManager::instance().cancel("adhocsession" + sessionid + executor_jid);
|
||||
}
|
||||
else // unsupported action
|
||||
{
|
||||
|
||||
@@ -223,9 +223,9 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
XmlSubNode x(command_node, "jabber:x:data:x");
|
||||
x["type"] = "form";
|
||||
XmlSubNode title(x, "title");
|
||||
title.set_inner("Configure the IRC server "s + server_domain);
|
||||
title.set_inner("Configure the IRC server " + server_domain);
|
||||
XmlSubNode instructions(x, "instructions");
|
||||
instructions.set_inner("Edit the form, to configure the settings of the IRC server "s + server_domain);
|
||||
instructions.set_inner("Edit the form, to configure the settings of the IRC server " + server_domain);
|
||||
|
||||
{
|
||||
XmlSubNode ports(x, "field");
|
||||
@@ -469,9 +469,9 @@ void insert_irc_channel_configuration_form(XmlNode& node, const Jid& requester,
|
||||
XmlSubNode x(node, "jabber:x:data:x");
|
||||
x["type"] = "form";
|
||||
XmlSubNode title(x, "title");
|
||||
title.set_inner("Configure the IRC channel "s + iid.get_local() + " on server "s + iid.get_server());
|
||||
title.set_inner("Configure the IRC channel " + iid.get_local() + " on server " + iid.get_server());
|
||||
XmlSubNode instructions(x, "instructions");
|
||||
instructions.set_inner("Edit the form, to configure the settings of the IRC channel "s + iid.get_local());
|
||||
instructions.set_inner("Edit the form, to configure the settings of the IRC channel " + iid.get_local());
|
||||
|
||||
{
|
||||
XmlSubNode record_history(x, "field");
|
||||
@@ -693,7 +693,7 @@ void DisconnectUserFromServerStep2(XmppComponent& xmpp_component, AdhocSession&
|
||||
{
|
||||
XmlSubNode note(command_node, "note");
|
||||
note["type"] = "info";
|
||||
note.set_inner("User "s + jid_to_disconnect + " is not connected to any IRC server.");
|
||||
note.set_inner("User " + jid_to_disconnect + " is not connected to any IRC server.");
|
||||
session.terminate();
|
||||
return ;
|
||||
}
|
||||
@@ -797,7 +797,7 @@ void GetIrcConnectionInfoStep1(XmppComponent& component, AdhocSession& session,
|
||||
IrcClient* irc = bridge->find_irc_client(hostname);
|
||||
if (!irc || !irc->is_connected())
|
||||
{
|
||||
message = "You are not connected to the IRC server "s + hostname;
|
||||
message = "You are not connected to the IRC server " + hostname;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ void BiboumiComponent::handle_presence(const Stanza& stanza)
|
||||
if (type != "unavailable")
|
||||
this->send_stanza_error("presence", from_str, to_str, id,
|
||||
"cancel", "remote-server-not-found",
|
||||
"Not connected to IRC server "s + ex.hostname,
|
||||
"Not connected to IRC server " + ex.hostname,
|
||||
true);
|
||||
}
|
||||
stanza_error.disable();
|
||||
@@ -277,7 +277,7 @@ void BiboumiComponent::handle_message(const Stanza& stanza)
|
||||
{
|
||||
this->send_stanza_error("message", from_str, to_str, id,
|
||||
"cancel", "remote-server-not-found",
|
||||
"Not connected to IRC server "s + ex.hostname,
|
||||
"Not connected to IRC server " + ex.hostname,
|
||||
true);
|
||||
}
|
||||
stanza_error.disable();
|
||||
@@ -586,7 +586,7 @@ void BiboumiComponent::handle_iq(const Stanza& stanza)
|
||||
{
|
||||
this->send_stanza_error("iq", from, to_str, id,
|
||||
"cancel", "remote-server-not-found",
|
||||
"Not connected to IRC server "s + ex.hostname,
|
||||
"Not connected to IRC server " + ex.hostname,
|
||||
true);
|
||||
stanza_error.disable();
|
||||
return;
|
||||
@@ -806,7 +806,7 @@ void BiboumiComponent::send_irc_server_disco_info(const std::string& id, const s
|
||||
XmlSubNode identity(query, "identity");
|
||||
identity["category"] = "conference";
|
||||
identity["type"] = "irc";
|
||||
identity["name"] = "IRC server "s + from.local + " over Biboumi";
|
||||
identity["name"] = "IRC server " + from.local + " over Biboumi";
|
||||
for (const char *ns: {DISCO_INFO_NS, MUC_NS, ADHOC_NS, PING_NS, MAM_NS, VERSION_NS})
|
||||
{
|
||||
XmlSubNode feature(query, "feature");
|
||||
@@ -849,7 +849,7 @@ void BiboumiComponent::send_irc_channel_disco_info(const std::string& id, const
|
||||
XmlSubNode identity(query, "identity");
|
||||
identity["category"] = "conference";
|
||||
identity["type"] = "irc";
|
||||
identity["name"] = "IRC channel "s + iid.get_local() + " from server " + iid.get_server() + " over biboumi";
|
||||
identity["name"] = "IRC channel " + iid.get_local() + " from server " + iid.get_server() + " over biboumi";
|
||||
for (const char *ns: {DISCO_INFO_NS, MUC_NS, ADHOC_NS, PING_NS, MAM_NS, VERSION_NS})
|
||||
{
|
||||
XmlSubNode feature(query, "feature");
|
||||
|
||||
@@ -92,7 +92,7 @@ void XmppComponent::on_connected()
|
||||
{
|
||||
log_info("connected to XMPP server");
|
||||
this->first_connection_try = true;
|
||||
auto data = "<stream:stream to='"s + this->served_hostname + \
|
||||
auto data = "<stream:stream to='" + this->served_hostname + \
|
||||
"' xmlns:stream='http://etherx.jabber.org/streams' xmlns='" COMPONENT_NS "'>";
|
||||
log_debug("XMPP SENDING: ", data);
|
||||
this->send_data(std::move(data));
|
||||
@@ -142,7 +142,7 @@ void XmppComponent::on_remote_stream_open(const XmlNode& node)
|
||||
}
|
||||
|
||||
// Try to authenticate
|
||||
auto data = "<handshake xmlns='" COMPONENT_NS "'>"s + get_handshake_digest(this->stream_id, this->secret) + "</handshake>";
|
||||
auto data = "<handshake xmlns='" COMPONENT_NS "'>" + get_handshake_digest(this->stream_id, this->secret) + "</handshake>";
|
||||
log_debug("XMPP SENDING: ", data);
|
||||
this->send_data(std::move(data));
|
||||
}
|
||||
@@ -642,7 +642,7 @@ void XmppComponent::send_iq_version_request(const std::string& from,
|
||||
Stanza iq("iq");
|
||||
{
|
||||
iq["type"] = "get";
|
||||
iq["id"] = "version_"s + XmppComponent::next_id();
|
||||
iq["id"] = "version_" + XmppComponent::next_id();
|
||||
iq["from"] = from + "@" + this->served_hostname;
|
||||
iq["to"] = jid_to;
|
||||
XmlSubNode query(iq, "query");
|
||||
|
||||
Reference in New Issue
Block a user