UserChatAction::~UserChatAction() {
}
+ClearBoardAction::ClearBoardAction() {
+}
+ClearBoardAction::~ClearBoardAction() {
+}
+
QTextStream& operator<<(QTextStream& out, const Action& action) {
out << "0 " << action.userID << " " << action.timestamp.toString("yyyy-MM-ddThh:mm:ss.zzz") << " " << static_cast<quint16>(action.type) ; // mesgID, userID, timestamp, mesgType
switch(action.type) {
const UserChatAction* a = static_cast<const UserChatAction*>(&action);
out << " " << a->text;
} break;
+ case Action::ClearBoard:
+ break; // No special data for ClearBoard
}
out << "\n";
return out;
DrawLine=4,
AddImage=5,
UserChat=6,
- UserSynced=7
+ UserSynced=7,
+ ClearBoard=8
};
Action();
QString text;
};
+class ClearBoardAction : public Action {
+public:
+ ClearBoardAction();
+ ~ClearBoardAction();
+};
+
QTextStream& operator<<(QTextStream& out, const Action& action);
#endif //__ACTION_H__
continue;
}
break;
+ case Action::ClearBoard:
+ {
+ act = new ClearBoardAction();
+ ClearBoardAction* action = static_cast<ClearBoardAction*>(act);
+ action->mesgID = mesgID;
+ action->userID = userID;
+ action->timestamp = timestamp;
+ }
+ break;
default:
qWarning() << "Received invalid type from server :(";
continue;