Added way to disable xhtmlim from backend and don't handle messages with empty body
This commit is contained in:
parent
0d9c0387a4
commit
829c94f3d6
3 changed files with 6 additions and 1 deletions
|
@ -91,6 +91,7 @@ bool Config::load(std::istream &ifs, boost::program_options::options_description
|
|||
("service.memory_collector_time", value<int>()->default_value(0), "Time in seconds after which backend with most memory is set to die.")
|
||||
("service.more_resources", value<bool>()->default_value(false), "Allow more resources to be connected in server mode at the same time.")
|
||||
("service.enable_privacy_lists", value<bool>()->default_value(true), "")
|
||||
("service.enable_xhtml", value<bool>()->default_value(true), "")
|
||||
("vhosts.vhost", value<std::vector<std::string> >()->multitoken(), "")
|
||||
("identity.name", value<std::string>()->default_value("Spectrum 2 Transport"), "Name showed in service discovery.")
|
||||
("identity.category", value<std::string>()->default_value("gateway"), "Disco#info identity category. 'gateway' by default.")
|
||||
|
|
|
@ -577,7 +577,7 @@ void NetworkPluginServer::handleConvMessagePayload(const std::string &data, bool
|
|||
}
|
||||
|
||||
// Add xhtml-im payload.
|
||||
if (!payload.xhtml().empty()) {
|
||||
if (CONFIG_BOOL(m_config, "service.enabled_xhtml") && !payload.xhtml().empty()) {
|
||||
msg->addPayload(boost::make_shared<Swift::XHTMLIMPayload>(payload.xhtml()));
|
||||
}
|
||||
|
||||
|
|
|
@ -312,6 +312,10 @@ void UserManager::handleMessageReceived(Swift::Message::ref message) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (message->getBody().empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
User *user = getUser(message->getFrom().toBare().toString());
|
||||
if (!user){
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue