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:
parent
1575da8bd5
commit
879b31e315
2 changed files with 19 additions and 0 deletions
|
@ -33,9 +33,15 @@
|
||||||
MrChat::MrChat(MrMailbox* mailbox)
|
MrChat::MrChat(MrMailbox* mailbox)
|
||||||
{
|
{
|
||||||
m_mailbox = mailbox;
|
m_mailbox = mailbox;
|
||||||
|
m_type = MR_CHAT_UNDEFINED;
|
||||||
|
m_name = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MrChat::~MrChat()
|
MrChat::~MrChat()
|
||||||
{
|
{
|
||||||
|
if( m_name ) {
|
||||||
|
free(m_name);
|
||||||
|
m_name = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
13
src/mrchat.h
13
src/mrchat.h
|
@ -34,6 +34,15 @@
|
||||||
class MrMailbox;
|
class MrMailbox;
|
||||||
|
|
||||||
|
|
||||||
|
enum MrChatType
|
||||||
|
{
|
||||||
|
MR_CHAT_UNDEFINED=0
|
||||||
|
,MR_CHAT_CONTACT=1
|
||||||
|
,MR_CHAT_PRIVATE=2
|
||||||
|
,MR_CHAT_GROUP=3
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class MrChat
|
class MrChat
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -42,6 +51,10 @@ public:
|
||||||
void Release () { delete this; }
|
void Release () { delete this; }
|
||||||
void Destroy ();
|
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:
|
private:
|
||||||
// as chat objects are only constructed by MrMailbox, we declare the constructor as private and MrMailbox as a friend
|
// as chat objects are only constructed by MrMailbox, we declare the constructor as private and MrMailbox as a friend
|
||||||
MrChat (MrMailbox*);
|
MrChat (MrMailbox*);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue