Combu  3.2.2
Unity API Documentation
Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Member Functions | Properties | List of all members
Combu.Mail Class Reference

Public Member Functions

virtual void FromJson (string jsonString)
 Initialize the object from a JSON formatted string. More...
 
virtual void FromHashtable (Hashtable hash)
 Initialize the object from a hashtable. More...
 
void Read (Action< bool, string > callback)
 Sends this message and auto-loads the stored data from server on callback (including id after creation). More...
 
void Unread (Action< bool, string > callback)
 Mark this mail as read. More...
 
virtual void Delete (Action< bool, string > callback)
 Delete this instance. More...
 

Static Public Member Functions

static void Load (eMailList listType, int pageNumber, int limit, System.Action< Mail[], int, int, string > callback)
 
static void Load (eMailList listType, long idRecipient, long idSender, long idGroup, int pageNumber, int limit, System.Action< Mail[], int, int, string > callback)
 
static void Load< T > (eMailList listType, long idRecipient, long idSender, long idGroup, int pageNumber, int limit, System.Action< T[], int, int, string > callback)
 Load mails list from specified page and number of records. More...
 
static void Send (long recipientId, string subject, string message, bool isPublic, System.Action< bool, string > callback)
 Sends a mail to a user. More...
 
static void Send (long[] recipientsId, string subject, string message, bool isPublic, System.Action< bool, string > callback)
 Sends the mail to multiple users. More...
 
static void Send (string recipientUsername, string subject, string message, bool isPublic, System.Action< bool, string > callback)
 Sends a mail to a user. More...
 
static void Send (string[] recipientsUsername, string subject, string message, bool isPublic, System.Action< bool, string > callback)
 Sends the mail to multiple users. More...
 
static void SendMailToGroup (long groupId, string subject, string message, bool isPublic, System.Action< bool, string > callback)
 Sends the mail to group. More...
 
static void Send (long recipientId, string subject, string message, bool isPublic, Action< Mail, string > callback)
 Sends a mail to a user. More...
 
static void Send (long[] recipientsId, string subject, string message, bool isPublic, Action< Mail, string > callback)
 Sends the mail to multiple users. More...
 
static void Send (string recipientUsername, string subject, string message, bool isPublic, Action< Mail, string > callback)
 Sends a mail to a user. More...
 
static void Send (string[] recipientsUsername, string subject, string message, bool isPublic, Action< Mail, string > callback)
 Sends the mail to multiple users. More...
 
static void SendMailToGroup (long groupId, string subject, string message, bool isPublic, Action< Mail, string > callback)
 Sends the mail to group. More...
 
static void Read (long idMail, Action< bool, string > callback)
 Mark a single mail as read. More...
 
static void Read (long[] idSenders, long[] idGroups, Action< bool, string > callback)
 Mark a set of mails as read. More...
 
static void Unread (long idMail, Action< bool, string > callback)
 Mark a single mail as read. More...
 
static void Delete (long idMail, Action< bool, string > callback)
 Delete the specified Mail. More...
 
static void LoadConversations (Action< ArrayList, int, string > callback)
 Loads the conversations (list of senders as both users and groups). More...
 
static void Count (long[] idUsers, long[] idGroups, Action< MailCount[], string > callback)
 Loads the read/unread messages from list of senders and groups. More...
 

Public Attributes

long id = 0
 
DateTime sendDate = DateTime.MinValue
 
DateTime readDate = DateTime.MinValue
 
string subject = ""
 
string message = ""
 
bool isPublic = false
 
User fromUser
 
User toUser
 
long idGroup = 0
 
UserGroup toGroup
 

Static Protected Member Functions

static void Send (long[] recipientsId, string[] recipientsUsername, long recipientGroupId, string subject, string message, bool isPublic, System.Action< bool, string > callback)
 Sends the mail. More...
 
static CombuForm GetMessageForm (long[] recipientsId, string[] recipientsUsername, long recipientGroupId, string subject, string message, bool isPublic)
 Gets the message form. More...
 
static void SendMessage (long[] recipientsId, string[] recipientsUsername, long recipientGroupId, string subject, string message, bool isPublic, Action< bool, string, string > callback)
 Sends the message. More...
 
static void Send (long[] recipientsId, string[] recipientsUsername, long recipientGroupId, string subject, string message, bool isPublic, Action< Mail, string > callback)
 Sends the mail. More...
 
static void Read (long idMail, long[] idSenders, long[] idGroups, Action< bool, string > callback)
 Mark a single mail or a set of mails as read. More...
 

Properties

bool isRead [get]
 

Member Function Documentation

◆ Count()

static void Combu.Mail.Count ( long[]  idUsers,
long[]  idGroups,
Action< MailCount[], string >  callback 
)
static

Loads the read/unread messages from list of senders and groups.

◆ Delete() [1/2]

virtual void Combu.Mail.Delete ( Action< bool, string >  callback)
virtual

Delete this instance.

◆ Delete() [2/2]

static void Combu.Mail.Delete ( long  idMail,
Action< bool, string >  callback 
)
static

Delete the specified Mail.

Parameters
idMailIdentifier mail.
callbackCallback.

◆ FromHashtable()

virtual void Combu.Mail.FromHashtable ( Hashtable  hash)
virtual

Initialize the object from a hashtable.

Parameters
hashHash.

◆ FromJson()

virtual void Combu.Mail.FromJson ( string  jsonString)
virtual

Initialize the object from a JSON formatted string.

Parameters
jsonStringJson string.

◆ GetMessageForm()

static CombuForm Combu.Mail.GetMessageForm ( long[]  recipientsId,
string[]  recipientsUsername,
long  recipientGroupId,
string  subject,
string  message,
bool  isPublic 
)
staticprotected

Gets the message form.

Returns
The message form.
Parameters
recipientsIdRecipients identifier.
recipientsUsernameRecipients username.
recipientGroupIdRecipient group identifier.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ Load< T >()

static void Combu.Mail.Load< T > ( eMailList  listType,
long  idRecipient,
long  idSender,
long  idGroup,
int  pageNumber,
int  limit,
System.Action< T[], int, int, string >  callback 
)
static

Load mails list from specified page and number of records.

Parameters
pageNumberPage number.
limitLimit.
Template Parameters
TType of returned objects.
Type Constraints
T :Mail 
T :new() 

◆ LoadConversations()

static void Combu.Mail.LoadConversations ( Action< ArrayList, int, string >  callback)
static

Loads the conversations (list of senders as both users and groups).

◆ Read() [1/4]

void Combu.Mail.Read ( Action< bool, string >  callback)

Sends this message and auto-loads the stored data from server on callback (including id after creation).

Parameters
callbackCallback.

Mark this mail as read.

Parameters
callbackCallback.

◆ Read() [2/4]

static void Combu.Mail.Read ( long  idMail,
Action< bool, string >  callback 
)
static

Mark a single mail as read.

Parameters
idMailIdentifier mail.
callbackCallback.

◆ Read() [3/4]

static void Combu.Mail.Read ( long  idMail,
long[]  idSenders,
long[]  idGroups,
Action< bool, string >  callback 
)
staticprotected

Mark a single mail or a set of mails as read.

Parameters
idMailIdentifier mail.
idSendersIdentifier senders.
idGroupsIdentifier groups.
callbackCallback.

◆ Read() [4/4]

static void Combu.Mail.Read ( long[]  idSenders,
long[]  idGroups,
Action< bool, string >  callback 
)
static

Mark a set of mails as read.

Parameters
idSendersIdentifier senders.
idGroupsIdentifier groups.

◆ Send() [1/10]

static void Combu.Mail.Send ( long  recipientId,
string  subject,
string  message,
bool  isPublic,
Action< Mail, string >  callback 
)
static

Sends a mail to a user.

Parameters
recipientIdIdentifier Id of the destination user.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ Send() [2/10]

static void Combu.Mail.Send ( long  recipientId,
string  subject,
string  message,
bool  isPublic,
System.Action< bool, string >  callback 
)
static

Sends a mail to a user.

Parameters
recipientIdIdentifier Id of the destination user.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ Send() [3/10]

static void Combu.Mail.Send ( long[]  recipientsId,
string  subject,
string  message,
bool  isPublic,
Action< Mail, string >  callback 
)
static

Sends the mail to multiple users.

Parameters
recipientsIdRecipients identifier.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ Send() [4/10]

static void Combu.Mail.Send ( long[]  recipientsId,
string  subject,
string  message,
bool  isPublic,
System.Action< bool, string >  callback 
)
static

Sends the mail to multiple users.

Parameters
recipientsIdRecipients identifier.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ Send() [5/10]

static void Combu.Mail.Send ( long[]  recipientsId,
string[]  recipientsUsername,
long  recipientGroupId,
string  subject,
string  message,
bool  isPublic,
Action< Mail, string >  callback 
)
staticprotected

Sends the mail.

Parameters
recipientsIdRecipients identifier.
recipientsUsernameRecipients username.
recipientGroupIdRecipient group identifier.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ Send() [6/10]

static void Combu.Mail.Send ( long[]  recipientsId,
string[]  recipientsUsername,
long  recipientGroupId,
string  subject,
string  message,
bool  isPublic,
System.Action< bool, string >  callback 
)
staticprotected

Sends the mail.

Parameters
recipientsIdRecipients identifier.
recipientsUsernameRecipients username.
recipientGroupIdRecipient group identifier.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ Send() [7/10]

static void Combu.Mail.Send ( string  recipientUsername,
string  subject,
string  message,
bool  isPublic,
Action< Mail, string >  callback 
)
static

Sends a mail to a user.

Parameters
recipientUsernameUsername of the destination user.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ Send() [8/10]

static void Combu.Mail.Send ( string  recipientUsername,
string  subject,
string  message,
bool  isPublic,
System.Action< bool, string >  callback 
)
static

Sends a mail to a user.

Parameters
recipientUsernameUsername of the destination user.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ Send() [9/10]

static void Combu.Mail.Send ( string[]  recipientsUsername,
string  subject,
string  message,
bool  isPublic,
Action< Mail, string >  callback 
)
static

Sends the mail to multiple users.

Parameters
recipientsUsernameRecipients username.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ Send() [10/10]

static void Combu.Mail.Send ( string[]  recipientsUsername,
string  subject,
string  message,
bool  isPublic,
System.Action< bool, string >  callback 
)
static

Sends the mail to multiple users.

Parameters
recipientsUsernameRecipients username.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ SendMailToGroup() [1/2]

static void Combu.Mail.SendMailToGroup ( long  groupId,
string  subject,
string  message,
bool  isPublic,
Action< Mail, string >  callback 
)
static

Sends the mail to group.

Parameters
groupIdGroup identifier.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ SendMailToGroup() [2/2]

static void Combu.Mail.SendMailToGroup ( long  groupId,
string  subject,
string  message,
bool  isPublic,
System.Action< bool, string >  callback 
)
static

Sends the mail to group.

Parameters
groupIdGroup identifier.
subjectSubject.
messageMessage.
isPublicIf set to true is public.

◆ SendMessage()

static void Combu.Mail.SendMessage ( long[]  recipientsId,
string[]  recipientsUsername,
long  recipientGroupId,
string  subject,
string  message,
bool  isPublic,
Action< bool, string, string >  callback 
)
staticprotected

Sends the message.

Parameters
recipientsIdRecipients identifier.
recipientsUsernameRecipients username.
recipientGroupIdRecipient group identifier.
subjectSubject.
messageMessage.
isPublicIf set to true is public.
callbackCallback.

◆ Unread() [1/2]

void Combu.Mail.Unread ( Action< bool, string >  callback)

Mark this mail as read.

Parameters
callbackCallback.

◆ Unread() [2/2]

static void Combu.Mail.Unread ( long  idMail,
Action< bool, string >  callback 
)
static

Mark a single mail as read.

Parameters
idMailIdentifier mail.
callbackCallback.