diff options
author | louiz’ <louiz@louiz.org> | 2019-08-25 21:54:06 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2019-08-25 21:58:07 +0200 |
commit | 224eb9223f0eb5945631377e19a24ab97b7af399 (patch) | |
tree | 48fdae9746e68f583aa69c37524f8c8f391e4739 /src/bridge | |
parent | d6460e2828d435bf643122e1245cd3ffd5fae692 (diff) | |
download | biboumi-224eb9223f0eb5945631377e19a24ab97b7af399.tar.gz biboumi-224eb9223f0eb5945631377e19a24ab97b7af399.tar.bz2 biboumi-224eb9223f0eb5945631377e19a24ab97b7af399.tar.xz biboumi-224eb9223f0eb5945631377e19a24ab97b7af399.zip |
Properly re-convert \01ACTION into a /me when reflected to the sender
fix #3382
It still needs to be fixed properly by cleaning the way we send the messages
in all direction etc. And this is ugly because, with just one message, we do
a conversion in one direction, and then re-convert in the other
direction. But at least it works and users will be happy, even if I’m not
entirely satisfied with the code.
Diffstat (limited to 'src/bridge')
-rw-r--r-- | src/bridge/bridge.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index 4d4e9de..272b695 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -235,7 +235,11 @@ void Bridge::send_channel_message(const Iid& iid, const std::string& body, std:: id = utils::gen_uuid(); MessageCallback mirror_to_all_resources = [this, iid, uuid, id](const IrcClient* irc, const IrcMessage& message) { - const std::string& line = message.arguments[1]; + std::string line = message.arguments[1]; + // “temporary” workaround for \01ACTION…\01 -> /me messages + if ((line.size() > strlen("\01ACTION\01")) && + (line.substr(0, 7) == "\01ACTION") && line[line.size() - 1] == '\01') + line = "/me " + line.substr(8, line.size() - 9); for (const auto& resource: this->resources_in_chan[iid.to_tuple()]) this->xmpp.send_muc_message(std::to_string(iid), irc->get_own_nick(), this->make_xmpp_body(line), this->user_jid + "/" + resource, uuid, id); |