Only save messages coming from real MUC participants in the database

Not messages coming from the room, for example
This commit is contained in:
louiz’
2016-08-22 00:47:55 +02:00
parent 19240d7968
commit 38a4bcb2d2
+3 -2
View File
@@ -616,8 +616,9 @@ void Bridge::send_message(const Iid& iid, const std::string& nick, const std::st
{ {
#ifdef USE_DATABASE #ifdef USE_DATABASE
const auto xmpp_body = this->make_xmpp_body(body, encoding); const auto xmpp_body = this->make_xmpp_body(body, encoding);
Database::store_muc_message(this->get_bare_jid(), iid, std::chrono::system_clock::now(), if (!nick.empty())
std::get<0>(xmpp_body), nick); Database::store_muc_message(this->get_bare_jid(), iid, std::chrono::system_clock::now(),
std::get<0>(xmpp_body), nick);
#endif #endif
for (const auto& resource: this->resources_in_chan[iid.to_tuple()]) for (const auto& resource: this->resources_in_chan[iid.to_tuple()])
{ {