From 55d162b1087fb818da507e788b7739c1a8c0b4c6 Mon Sep 17 00:00:00 2001 From: barrett Date: Sat, 23 Apr 2011 23:01:25 +0000 Subject: [PATCH] Missing MSNContainer class --- protocols/msn/MSNContainer.cpp | 34 +++++++++++++++++++++++++++ protocols/msn/MSNContainer.h | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 protocols/msn/MSNContainer.cpp create mode 100644 protocols/msn/MSNContainer.h diff --git a/protocols/msn/MSNContainer.cpp b/protocols/msn/MSNContainer.cpp new file mode 100644 index 0000000..45708c1 --- /dev/null +++ b/protocols/msn/MSNContainer.cpp @@ -0,0 +1,34 @@ +/* + * Copyright 2010 Your Name + * All rights reserved. Distributed under the terms of the MIT license. + */ +#include + +#include "MSNContainer.h" + +MSNContainer::MSNContainer(string buddy) + : + fMessage(""), + fRCPT(buddy), + fMSNObject(""), + fIfMsg(false) +{ + +} + + +MSNContainer::MSNContainer(string msg, string rcpt) + : + fMessage(msg), + fRCPT(rcpt), + fMSNObject(""), + fIfMsg(true) +{ +} + + +MSNContainer::~MSNContainer() +{ + + +} diff --git a/protocols/msn/MSNContainer.h b/protocols/msn/MSNContainer.h new file mode 100644 index 0000000..4fc3d9b --- /dev/null +++ b/protocols/msn/MSNContainer.h @@ -0,0 +1,43 @@ +/* + * Copyright 2011 Barrett + * All rights reserved. Distributed under the terms of the GPL license. + * + * This is a simple class used as container for various informations, like + * avatar msn object, it is used essentially when creating a new switchboard connection. + * + */ + +#ifndef MSNCONTAINER_H +#define MSNCONTAINER_H + +using namespace std; + +#include +#include + +class MSNContainer { +public: + MSNContainer(string buddy); + MSNContainer(string msg, string buddy); + virtual ~MSNContainer(); + // if it is also a message + bool IsMessage() { return fIfMsg; } + // if it is used for advanced features like avatars + bool HasObject() { if (fMSNObject == "") return false; else return true; } + + //void SetMessage(const char* msg) { fMessage = msg; } + string Message() { return fMessage; } + //void SetRCPT(const char* rcpt) { fRCPT = rcpt; } + string Buddy() { return fRCPT; } + void SetObject(string msnobj) { fMSNObject = msnobj; } + string Object() { return fMSNObject; } +private: + string fRCPT; + string fMessage; + string fMSNObject; + + bool fIfMsg; + +}; + +#endif // MSNCONTAINER_H