summaryrefslogtreecommitdiff
path: root/src/bridge
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-08-22 00:47:55 +0200
committerlouiz’ <louiz@louiz.org>2016-08-22 00:47:55 +0200
commit38a4bcb2d2fd9bb535801a0209d614206204a460 (patch)
treeea37633e643496681e67219b705dace8241c16f8 /src/bridge
parent19240d79688d58f23e67732521b80c6a94fbd4e6 (diff)
downloadbiboumi-38a4bcb2d2fd9bb535801a0209d614206204a460.tar.gz
biboumi-38a4bcb2d2fd9bb535801a0209d614206204a460.tar.bz2
biboumi-38a4bcb2d2fd9bb535801a0209d614206204a460.tar.xz
biboumi-38a4bcb2d2fd9bb535801a0209d614206204a460.zip
Only save messages coming from real MUC participants in the database
Not messages coming from the room, for example
Diffstat (limited to 'src/bridge')
-rw-r--r--src/bridge/bridge.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index 11393d4..ad1a45e 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -616,8 +616,9 @@ void Bridge::send_message(const Iid& iid, const std::string& nick, const std::st
{
#ifdef USE_DATABASE
const auto xmpp_body = this->make_xmpp_body(body, encoding);
- Database::store_muc_message(this->get_bare_jid(), iid, std::chrono::system_clock::now(),
- std::get<0>(xmpp_body), nick);
+ if (!nick.empty())
+ Database::store_muc_message(this->get_bare_jid(), iid, std::chrono::system_clock::now(),
+ std::get<0>(xmpp_body), nick);
#endif
for (const auto& resource: this->resources_in_chan[iid.to_tuple()])
{