diff --git a/include/transport/conversation.h b/include/transport/conversation.h index 121794d68481412e7d1d610520d51aff7b6fc047..78aa52662e7c737a306d5c8336a00ca045e933e4 100644 --- a/include/transport/conversation.h +++ b/include/transport/conversation.h @@ -24,7 +24,6 @@ #include #include "transport/transport.h" -#include "Swiften/Swiften.h" #include "Swiften/Elements/Message.h" namespace Transport { @@ -34,15 +33,22 @@ class ConversationManager; /// Represents one XMPP-Legacy network conversation. class Conversation { public: + typedef enum { + PARTICIPANT_FLAG_NONE = 0, + PARTICIPANT_FLAG_MODERATOR = 1, + PARTICIPANT_FLAG_CONFLICT = 2, + PARTICIPANT_FLAG_BANNED = 4, + PARTICIPANT_FLAG_NOT_AUTHORIZED = 8, + PARTICIPANT_FLAG_ME = 16, + PARTICIPANT_FLAG_KICKED = 32 + } ParticipantFlag; + typedef struct _Participant { - int flag; + ParticipantFlag flag; int status; std::string statusMessage; } Participant; - /// Type of participants in MUC rooms. - enum ParticipantFlag {None, Moderator}; - /// Creates new conversation. /// \param conversationManager ConversationManager associated with this Conversation. @@ -64,6 +70,8 @@ class Conversation { /// \param nickname For MUC conversation this is nickname of room participant who sent this message. void handleMessage(boost::shared_ptr &message, const std::string &nickname = ""); + void handleRawMessage(boost::shared_ptr &message); + /// Handles participant change in MUC. /// \param nickname Nickname of participant which changed. @@ -71,7 +79,7 @@ class Conversation { /// \param status Current status of this participant. /// \param statusMessage Current status message of this participant. /// \param newname If participant was renamed, this variable contains his new name. - void handleParticipantChanged(const std::string &nickname, int flag, int status = Swift::StatusShow::None, const std::string &statusMessage = "", const std::string &newname = ""); + void handleParticipantChanged(const std::string &nickname, ParticipantFlag flag, int status = Swift::StatusShow::None, const std::string &statusMessage = "", const std::string &newname = ""); /// Sets XMPP user nickname in MUC rooms.