gloox  1.0
mucmessagesession.cpp
1 /*
2  Copyright (c) 2006-2009 by Jakob Schroeter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
5  This software is distributed under a license. The full license
6  agreement can be found in the file LICENSE in this distribution.
7  This software may not be copied, modified, sold or distributed
8  other than expressed in the named license agreement.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 #include "mucmessagesession.h"
15 #include "clientbase.h"
16 #include "message.h"
17 #include "messagehandler.h"
18 
19 namespace gloox
20 {
21 
23  : MessageSession( parent, jid, false, Message::Groupchat | Message::Chat
24  | Message::Normal | Message::Error,
25  false )
26  {
27  }
28 
30  {
31  }
32 
34  {
35  if( m_messageHandler )
36  m_messageHandler->handleMessage( msg );
37  }
38 
39  void MUCMessageSession::send( const std::string& message )
40  {
41  Message m( Message::Groupchat, m_target, message );
42 
43 // decorate( m );
44 
45  m_parent->send( m );
46  }
47 
48  void MUCMessageSession::setSubject( const std::string& subject )
49  {
50  Message m( Message::Groupchat, m_target.bareJID(), EmptyString, subject );
51  m_parent->send( m );
52  }
53 
54 }