summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-08-27 14:32:29 +0200
committerlouiz’ <louiz@louiz.org>2017-08-27 14:32:29 +0200
commit25243f53c2479e2fda0f1a05d1589c8214b70b4b (patch)
tree32f90dc7293661f2bb33d5e709f856ed707cb19b /src/xmpp/xmpp_component.cpp
parent2c717d347d796a2b007331c42d78146e156eaea0 (diff)
downloadbiboumi-25243f53c2479e2fda0f1a05d1589c8214b70b4b.tar.gz
biboumi-25243f53c2479e2fda0f1a05d1589c8214b70b4b.tar.bz2
biboumi-25243f53c2479e2fda0f1a05d1589c8214b70b4b.tar.xz
biboumi-25243f53c2479e2fda0f1a05d1589c8214b70b4b.zip
In fixed mode, server messages come from biboumi’s hostname directly
Instead of irc.example.com@biboumi, because that’s actually user named “irc.example.com”, in that case. And that fixes the raw messages in fixed mode. fix #3286
Diffstat (limited to 'src/xmpp/xmpp_component.cpp')
-rw-r--r--src/xmpp/xmpp_component.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index 42a5392..24a85d7 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -277,7 +277,12 @@ void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, con
if (fulljid)
message["from"] = from;
else
- message["from"] = from + "@" + this->served_hostname;
+ {
+ if (!from.empty())
+ message["from"] = from + "@" + this->served_hostname;
+ else
+ message["from"] = this->served_hostname;
+ }
if (!type.empty())
message["type"] = type;
XmlSubNode body_node(message, "body");