Changeset - 2159ab0a2780
[Not reviewed]
0 1 0
HanzZ - 13 years ago 2012-12-21 09:34:51
hanzz.k@gmail.com
Limit cache to 100 messages
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/conversation.cpp
Show inline comments
 
@@ -145,12 +145,15 @@ void Conversation::handleMessage(boost::shared_ptr<Swift::Message> &message, con
 
		if (m_conversationManager->getUser()->shouldCacheMessages()) {
 
			boost::posix_time::ptime timestamp = boost::posix_time::second_clock::universal_time();
 
			boost::shared_ptr<Swift::Delay> delay(boost::make_shared<Swift::Delay>());
 
			delay->setStamp(timestamp);
 
			message->addPayload(delay);
 
			m_cachedMessages.push_back(message);
 
			if (m_cachedMessages.size() > 100) {
 
				m_cachedMessages.pop_front();
 
			}
 
		}
 
		else {
 
			BOOST_FOREACH(const Swift::JID &jid, m_jids) {
 
				message->setTo(jid);
 
				// Subject has to be sent after our own presence (the one with code 110)
 
				if (!message->getSubject().empty() && m_sentInitialPresence == false) {
0 comments (0 inline, 0 general)