gloox  1.0.20
mucmessagesession.cpp
1 /*
2  Copyright (c) 2006-2017 by Jakob Schröter <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 }
An abstraction of a message session between any two entities.
void send(Tag *tag)
virtual void handleMessage(Message &msg)
MUCMessageSession(ClientBase *parent, const JID &jid)
A stanza error abstraction implemented as a StanzaExtension.
Definition: error.h:34
An abstraction of a message stanza.
Definition: message.h:33
virtual void setSubject(const std::string &subject)
The namespace for the gloox library.
Definition: adhoc.cpp:27
virtual void send(const std::string &message)
An abstraction of a JID.
Definition: jid.h:30
JID bareJID() const
Definition: jid.h:74
virtual void handleMessage(const Message &msg, MessageSession *session=0)=0
const std::string EmptyString
Definition: gloox.cpp:124
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
Definition: clientbase.h:76