Changeset - 3f3c73988787
[Not reviewed]
0 1 0
Jan Kaluza - 14 years ago 2011-04-04 11:44:12
hanzz.k@gmail.com
Send StreamError on error
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/user.cpp
Show inline comments
 
@@ -16,24 +16,26 @@
 
 * You should have received a copy of the GNU General Public License
 
 * along with this program; if not, write to the Free Software
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
 
 */
 

	
 
#include "transport/user.h"
 
#include "transport/transport.h"
 
#include "transport/storagebackend.h"
 
#include "transport/rostermanager.h"
 
#include "transport/usermanager.h"
 
#include "transport/conversationmanager.h"
 
#include "Swiften/Swiften.h"
 
#include "Swiften/Server/ServerStanzaChannel.h"
 
#include "Swiften/Elements/StreamError.h"
 

	
 
namespace Transport {
 

	
 
User::User(const Swift::JID &jid, UserInfo &userInfo, Component *component, UserManager *userManager) {
 
	m_jid = jid;
 

	
 
	m_component = component;
 
	m_presenceOracle = component->m_presenceOracle;
 
	m_entityCapsManager = component->m_entityCapsManager;
 
	m_userManager = userManager;
 
	m_userInfo = userInfo;
 
	m_connected = false;
 
@@ -101,17 +103,18 @@ void User::onConnectingTimeout() {
 
	m_reconnectTimer->stop();
 
	m_readyForConnect = true;
 
	onReadyToConnect();
 
}
 

	
 
void User::handleDisconnected(const std::string &error) {
 
	onDisconnected();
 

	
 
	boost::shared_ptr<Swift::Message> msg(new Swift::Message());
 
	msg->setBody(error);
 
	msg->setTo(m_jid.toBare());
 
	m_component->getStanzaChannel()->sendMessage(msg);
 
	dynamic_cast<Swift::ServerStanzaChannel *>(m_component->getStanzaChannel())->finishSession(m_jid, boost::shared_ptr<Swift::Element>(new Swift::StreamError()));
 

	
 
	m_userManager->removeUser(this);
 
}
 

	
 
}
0 comments (0 inline, 0 general)