Changeset - 829c94f3d6c9
[Not reviewed]
0 3 0
HanzZ - 13 years ago 2012-07-31 16:48:31
hanzz.k@gmail.com
Added way to disable xhtmlim from backend and don't handle messages with empty body
3 files changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/config.cpp
Show inline comments
 
@@ -88,12 +88,13 @@ bool Config::load(std::istream &ifs, boost::program_options::options_description
 
		("service.admin_password", value<std::string>()->default_value(""), "Administrator password.")
 
		("service.reuse_old_backends", value<bool>()->default_value(true), "True if Spectrum should use old backends which were full in the past.")
 
		("service.idle_reconnect_time", value<int>()->default_value(0), "Time in seconds after which idle users are reconnected to let their backend die.")
 
		("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.")
 
		("identity.type", value<std::string>()->default_value(""), "Type of transport ('icq','msn','gg','irc', ...)")
 
		("registration.enable_public_registration", value<bool>()->default_value(true), "True if users should be able to register.")
 
		("registration.language", value<std::string>()->default_value("en"), "Default language for registration form")
src/networkpluginserver.cpp
Show inline comments
 
@@ -574,13 +574,13 @@ void NetworkPluginServer::handleConvMessagePayload(const std::string &data, bool
 
	}
 
	else {
 
		msg->setBody(payload.message());
 
	}
 

	
 
	// 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()));
 
	}
 

	
 
	// Create new Conversation if it does not exist
 
	NetworkConversation *conv = (NetworkConversation *) user->getConversationManager()->getConversation(payload.buddyname());
 
	if (!conv) {
src/usermanager.cpp
Show inline comments
 
@@ -309,12 +309,16 @@ void UserManager::handleRemoveTimeout(const std::string jid, User *u, bool recon
 

	
 
void UserManager::handleMessageReceived(Swift::Message::ref message) {
 
	if (message->getType() == Swift::Message::Error) {
 
		return;
 
	}
 

	
 
	if (message->getBody().empty()) {
 
		return;
 
	}
 

	
 
	User *user = getUser(message->getFrom().toBare().toString());
 
	if (!user){
 
		return;
 
	}
 

	
 
	user->getConversationManager()->handleMessageReceived(message);
0 comments (0 inline, 0 general)