18 #include "discohandler.h"
19 #include "disconodehandler.h"
21 #include "presencehandler.h"
22 #include "iqhandler.h"
23 #include "messagehandler.h"
24 #include "mucroomhandler.h"
25 #include "mucroomconfighandler.h"
27 #include "stanzaextension.h"
35 class MUCMessageSession;
138 const std::string& historySince =
EmptyString,
int historyValue = 0 );
144 MUC(
const Tag* tag = 0 );
155 const std::string*
password()
const {
return m_password; }
164 virtual const std::string& filterString()
const;
169 return new MUC( tag );
173 virtual Tag* tag()
const;
179 m->m_password = m_password ?
new std::string( *m_password ) : 0;
180 m->m_historySince = m_historySince ?
new std::string( *m_historySince ) : 0;
181 m->m_historyType = m_historyType;
182 m->m_historyValue = m_historyValue;
187 std::string* m_password;
188 std::string* m_historySince;
231 int flags()
const {
return m_flags; }
248 const std::string* jid()
const {
return m_jid; }
253 const std::string* actor()
const {
return m_actor; }
258 const std::string* password()
const {
return m_password; }
263 const std::string* thread()
const {
return m_thread; }
268 const std::string* reason()
const {
return m_reason; }
273 const std::string* newNick()
const {
return m_newNick; }
279 const std::string*
alternate()
const {
return m_alternate; }
294 virtual const std::string& filterString()
const;
303 virtual Tag* tag()
const;
309 m->m_affiliation = m_affiliation;
311 m->m_jid = m_jid ?
new std::string( *m_jid ) : 0;
312 m->m_actor = m_actor ?
new std::string( *m_actor ) : 0;
313 m->m_thread = m_thread ?
new std::string( *m_thread ) : 0;
314 m->m_reason = m_reason ?
new std::string( *m_reason ) : 0;
315 m->m_newNick = m_newNick ?
new std::string( *m_newNick ) : 0;
316 m->m_password = m_password ?
new std::string( *m_password ) : 0;
317 m->m_alternate = m_alternate ?
new std::string( *m_alternate ) : 0;
318 m->m_operation = m_operation;
319 m->m_flags = m_flags;
321 m->m_continue = m_continue;
327 static MUCRoomRole getEnumRole(
const std::string& role );
333 std::string* m_actor;
334 std::string* m_thread;
335 std::string* m_reason;
336 std::string* m_newNick;
337 std::string* m_password;
338 std::string* m_alternate;
370 void setPassword(
const std::string& password ) { m_password = password; }
376 const std::string
name()
const {
return m_nick.username(); }
383 const std::string
service()
const {
return m_nick.server(); }
389 const std::string
nick()
const {
return m_nick.resource(); }
407 void leave(
const std::string& msg =
EmptyString );
413 void send(
const std::string& message );
429 void setSubject(
const std::string& subject );
449 void setNick(
const std::string& nick );
467 void invite(
const JID& invitee,
const std::string& reason,
const std::string& thread =
EmptyString );
492 void setPublish(
bool publish,
bool publishNick );
528 void addHistory(
const std::string& message,
const JID& from,
const std::string& stamp );
540 void setRequestHistory(
int value, HistoryRequestType type );
550 void setRequestHistory(
const std::string& since );
561 static Message* declineInvitation(
const JID& room,
const JID& invitor,
579 { setRole( nick,
RoleNone, reason ); }
590 void ban(
const std::string& nick,
const std::string& reason )
602 void grantVoice(
const std::string& nick,
const std::string& reason )
625 void revokeVoice(
const std::string& nick,
const std::string& reason )
645 const std::string& reason );
657 void requestRoomConfig();
666 void setRoomConfig(
DataForm* form );
692 void destroy(
const std::string& reason =
EmptyString,
740 int flags()
const {
return m_flags; }
743 virtual void handleDiscoInfo(
const JID& from,
const Disco::Info& info,
int context );
747 virtual void handleDiscoItems(
const JID& from,
const Disco::Items& items,
int context );
750 virtual void handleDiscoError(
const JID& from,
const Error* error,
int context );
753 virtual void handlePresence(
const Presence& presence );
759 virtual bool handleIq(
const IQ& iq ) { (void)iq;
return false; }
762 virtual void handleIqID(
const IQ& iq,
int context );
765 virtual StringList handleDiscoNodeFeatures(
const JID& from,
const std::string& node );
769 const std::string& node );
780 void setName(
const std::string& name ) { m_nick.setUsername( name ); }
827 MUCOwner( QueryType type, DataForm* form = 0 );
835 MUCOwner(
const JID& alternate = JID(),
const std::string& reason =
EmptyString,
842 MUCOwner(
const Tag* tag );
853 const DataForm* form()
const {
return m_form; }
856 const std::string& filterString()
const;
859 StanzaExtension* newInstance(
const Tag* tag )
const
861 return new MUCOwner( tag );
868 virtual StanzaExtension* clone()
const
870 MUCOwner* m =
new MUCOwner();
873 m->m_reason = m_reason;
875 m->m_form = m_form ?
new DataForm( *m_form ) : 0;
882 std::string m_reason;
893 class MUCAdmin :
public StanzaExtension
902 MUCAdmin(
MUCRoomRole role,
const std::string& nick,
929 MUCAdmin(
const Tag* tag = 0 );
943 const std::string& filterString()
const;
946 StanzaExtension* newInstance(
const Tag* tag )
const
948 return new MUCAdmin( tag );
955 virtual StanzaExtension* clone()
const
957 return new MUCAdmin( *
this );
966 void handleIqResult(
const IQ& iq,
int context );
967 void handleIqError(
const IQ& iq,
int context );
968 void setNonAnonymous();
969 void setSemiAnonymous();
970 void setFullyAnonymous();
971 void acknowledgeRoomCreation();
972 void instantRoom(
int context );
974 MUCRoomHandler* m_roomHandler;
975 MUCRoomConfigHandler* m_roomConfigHandler;
976 MUCMessageSession* m_session;
978 typedef std::list<MUCRoomParticipant> ParticipantList;
979 ParticipantList m_participants;
981 std::string m_password;
982 std::string m_newNick;
987 HistoryRequestType m_historyType;
989 std::string m_historySince;
992 bool m_creationInProgress;
993 bool m_configChanged;
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
A virtual interface that enables objects to receive Service Discovery (XEP-0030) events.
Derived classes can be registered as NodeHandlers for certain nodes with the Disco object.
An abstraction of a Disco Info element (from Service Discovery, XEP-0030) as a StanzaExtension.
An abstraction of a Disco query element (from Service Discovery, XEP-0030) in the disco::items namesp...
std::list< Identity * > IdentityList
std::list< Item * > ItemList
A stanza error abstraction implemented as a StanzaExtension.
An abstraction of an IQ stanza.
A virtual interface which can be reimplemented to receive IQ stanzas.
An abstract interface that can be implemented for MUC room configuration.
This interface enables inheriting classes to be notified about certain events in a MUC room.
An abstraction of a MUC user query.
MUCRoomAffiliation affiliation() const
virtual StanzaExtension * newInstance(const Tag *tag) const
const std::string * alternate() const
MUCUserOperation operation() const
virtual StanzaExtension * clone() const
An abstraction of a MUC query.
const std::string * historySince() const
virtual StanzaExtension * newInstance(const Tag *tag) const
virtual StanzaExtension * clone() const
const std::string * password() const
This is an implementation of XEP-0045 (Multi-User Chat).
void registerMUCRoomConfigHandler(MUCRoomConfigHandler *mrch)
void cancelRoomCreation()
void kick(const std::string &nick, const std::string &reason=EmptyString)
virtual bool handleIq(const IQ &iq)
void revokeVoice(const std::string &nick, const std::string &reason)
MUCRoomAffiliation affiliation() const
virtual bool instantRoomHook() const
void ban(const std::string &nick, const std::string &reason)
void acknowledgeInstantRoom()
void setPassword(const std::string &password)
void grantVoice(const std::string &nick, const std::string &reason)
const std::string service() const
void setName(const std::string &name)
void registerMUCRoomHandler(MUCRoomHandler *mrl)
void removeMUCRoomHandler()
void removeMUCRoomConfigHandler()
const std::string name() const
const std::string nick() const
A virtual interface which can be reimplemented to receive incoming message stanzas.
An abstraction of a message session between any two entities.
An abstraction of a message stanza.
A virtual interface which can be reimplemented to receive presence stanzas.
An abstraction of a presence stanza.
This class abstracts a stanza extension, which is usually an XML child element in a specific namespac...
This is an abstraction of an XML element.
The namespace for the gloox library.
std::list< const StanzaExtension * > StanzaExtensionList
std::list< std::string > StringList
std::list< MUCListItem > MUCListItemList
const std::string EmptyString