1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-05 19:42:04 +02:00

Add chat type.

This commit is contained in:
B. Petersen 2016-07-15 16:41:17 +02:00
parent 1575da8bd5
commit 879b31e315
2 changed files with 19 additions and 0 deletions

View file

@ -33,9 +33,15 @@
MrChat::MrChat(MrMailbox* mailbox)
{
m_mailbox = mailbox;
m_type = MR_CHAT_UNDEFINED;
m_name = NULL;
}
MrChat::~MrChat()
{
if( m_name ) {
free(m_name);
m_name = NULL;
}
}

View file

@ -34,6 +34,15 @@
class MrMailbox;
enum MrChatType
{
MR_CHAT_UNDEFINED=0
,MR_CHAT_CONTACT=1
,MR_CHAT_PRIVATE=2
,MR_CHAT_GROUP=3
};
class MrChat
{
public:
@ -42,6 +51,10 @@ public:
void Release () { delete this; }
void Destroy ();
// the data should be read only and are valid until the chat object is Release()'d
MrChatType m_type;
char* m_name;
private:
// as chat objects are only constructed by MrMailbox, we declare the constructor as private and MrMailbox as a friend
MrChat (MrMailbox*);