fix mode tests
This commit is contained in:
committed by
mathieui
parent
7bc27b21e6
commit
6993577cbe
+10
-2
@@ -258,11 +258,11 @@ void Bridge::send_channel_message(const Iid& iid, const std::string& body, std::
|
|||||||
{
|
{
|
||||||
if (first)
|
if (first)
|
||||||
{
|
{
|
||||||
messages.push_back(IrcMessage({}, std::move(std::string()), "PRIVMSG", {iid.get_local(), privmsg}));
|
messages.push_back(IrcMessage({}, std::string(), "PRIVMSG", {iid.get_local(), privmsg}));
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
messages.push_back(IrcMessage({{"draft/multiline-concat", {}}}, std::move(std::string()), "PRIVMSG", {iid.get_local(), privmsg}));
|
messages.push_back(IrcMessage({{"draft/multiline-concat", {}}}, std::string(), "PRIVMSG", {iid.get_local(), privmsg}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,6 +278,14 @@ void Bridge::send_channel_message(const Iid& iid, const std::string& body, std::
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// MODE can't be multiline. Only check the first line, and discard the rest silently
|
||||||
|
if (lines[0].substr(0, 5) == "/mode")
|
||||||
|
{
|
||||||
|
std::vector<std::string> args = utils::split(body.substr(5), ' ', false);
|
||||||
|
irc->send_mode_command(iid.get_local(), args);
|
||||||
|
return; // We do not want to send that back to the
|
||||||
|
// XMPP user, that’s not a textual message.
|
||||||
|
}
|
||||||
irc->send_batch(uuid, "draft/multiline", {iid.get_local()}, messages, std::move(mirror_to_all_resources));
|
irc->send_batch(uuid, "draft/multiline", {iid.get_local()}, messages, std::move(mirror_to_all_resources));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user