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 );
421 void setSubject(
const std::string& subject );
441 void setNick(
const std::string& nick );
459 void invite(
const JID& invitee,
const std::string& reason,
const std::string& thread =
EmptyString );
484 void setPublish(
bool publish,
bool publishNick );
520 void addHistory(
const std::string& message,
const JID& from,
const std::string& stamp );
532 void setRequestHistory(
int value, HistoryRequestType type );
542 void setRequestHistory(
const std::string& since );
553 static Message* declineInvitation(
const JID& room,
const JID& invitor,
570 void kick(
const std::string& nick,
const std::string& reason =
EmptyString )
571 { setRole( nick,
RoleNone, reason ); }
582 void ban(
const std::string& nick,
const std::string& reason )
594 void grantVoice(
const std::string& nick,
const std::string& reason )
617 void revokeVoice(
const std::string& nick,
const std::string& reason )
637 const std::string& reason );
649 void requestRoomConfig();
658 void setRoomConfig(
DataForm* form );
665 void acknowledgeInstantRoom()
672 void cancelRoomCreation()
684 void destroy(
const std::string& reason =
EmptyString,
732 int flags()
const {
return m_flags; }
735 virtual void handleDiscoInfo(
const JID& from,
const Disco::Info& info,
int context );
739 virtual void handleDiscoItems(
const JID& from,
const Disco::Items& items,
int context );
742 virtual void handleDiscoError(
const JID& from,
const Error* error,
int context );
745 virtual void handlePresence(
const Presence& presence );
751 virtual bool handleIq(
const IQ& iq ) { (void)iq;
return false; }
754 virtual void handleIqID(
const IQ& iq,
int context );
757 virtual StringList handleDiscoNodeFeatures(
const JID& from,
const std::string& node );
761 const std::string& node );
764 virtual Disco::ItemList handleDiscoNodeItems(
const JID& from,
const JID& to,
772 void setName(
const std::string& name ) { m_nick.setUsername( name ); }
819 MUCOwner( QueryType type, DataForm* form = 0 );
827 MUCOwner(
const JID& alternate = JID(),
const std::string& reason =
EmptyString,
834 MUCOwner(
const Tag* tag );
845 const DataForm* form()
const {
return m_form; }
848 const std::string& filterString()
const;
851 StanzaExtension* newInstance(
const Tag* tag )
const
853 return new MUCOwner( tag );
860 virtual StanzaExtension* clone()
const
862 MUCOwner* m =
new MUCOwner();
865 m->m_reason = m_reason;
867 m->m_form = m_form ?
new DataForm( *m_form ) : 0;
874 std::string m_reason;
885 class MUCAdmin :
public StanzaExtension
894 MUCAdmin(
MUCRoomRole role,
const std::string& nick,
921 MUCAdmin(
const Tag* tag = 0 );
935 const std::string& filterString()
const;
938 StanzaExtension* newInstance(
const Tag* tag )
const
940 return new MUCAdmin( tag );
947 virtual StanzaExtension* clone()
const
949 return new MUCAdmin( *
this );
958 void handleIqResult(
const IQ& iq,
int context );
959 void handleIqError(
const IQ& iq,
int context );
960 void setNonAnonymous();
961 void setSemiAnonymous();
962 void setFullyAnonymous();
963 void acknowledgeRoomCreation();
964 void instantRoom(
int context );
966 MUCRoomHandler* m_roomHandler;
967 MUCRoomConfigHandler* m_roomConfigHandler;
968 MUCMessageSession* m_session;
970 typedef std::list<MUCRoomParticipant> ParticipantList;
971 ParticipantList m_participants;
973 std::string m_password;
974 std::string m_newNick;
979 HistoryRequestType m_historyType;
981 std::string m_historySince;
984 bool m_creationInProgress;
985 bool m_configChanged;
994 #endif // MUCROOM_H__