本文整理汇总了C++中Email::GetInReplyTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Email::GetInReplyTo方法的具体用法?C++ Email::GetInReplyTo怎么用?C++ Email::GetInReplyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Email
的用法示例。
在下文中一共展示了Email::GetInReplyTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SerializeToDatabaseObject
// NOTE: This should currently only be used for new emails
void EmailAdapter::SerializeToDatabaseObject(const Email& email, MojObject& obj)
{
MojErr err;
// Set the object kind
err = obj.putString(KIND, Kind::EMAIL);
ErrorToException(err);
// FIXME object ID
// Set the folder ID
err = obj.put(FOLDER_ID, email.GetFolderId());
ErrorToException(err);
// Set flags
MojObject flags;
SerializeFlags(email, flags);
err = obj.put(FLAGS, flags);
ErrorToException(err);
// The following fields only exist for a new e-mail to be added to the DB
// If the e-mail object already exists in the DB, we shouldn't overwrite these fields
// FIXME: Except for drafts. Maybe this logic should be moved elsewhere?
if (true /*!obj.Exists()*/) {
// Subject
err = obj.putString(SUBJECT, email.GetSubject().c_str());
ErrorToException(err);
// Preview text
err = obj.putString(SUMMARY, email.GetPreviewText().c_str());
ErrorToException(err);
// Timestamp in UTC milliseconds
err = obj.put(TIMESTAMP, email.GetDateReceived());
ErrorToException(err);
// From address
MojObject from;
if(email.GetFrom().get()) // may not have a from address
SerializeAddress(Address::Type::FROM, email.GetFrom(), from);
err = obj.put(FROM, from);
ErrorToException(err);
// Reply-To address
MojObject replyTo;
if(email.GetReplyTo().get()) { // may not have a reply-to address
SerializeAddress(Address::Type::REPLY_TO, email.GetReplyTo(), replyTo);
err = obj.put(REPLY_TO, replyTo);
ErrorToException(err);
}
// Recipients
MojObject recipients;
SerializeRecipients(Address::Type::TO, email.GetTo(), recipients);
SerializeRecipients(Address::Type::CC, email.GetCc(), recipients);
SerializeRecipients(Address::Type::BCC, email.GetBcc(), recipients);
err = obj.put(RECIPIENTS, recipients);
ErrorToException(err);
// Parts
MojObject parts;
SerializeParts(email.GetPartList(), parts);
err = obj.put(PARTS, parts);
ErrorToException(err);
// MessageId and InReplyTo
DatabaseAdapter::PutOptionalString(obj, MESSAGE_ID, email.GetMessageId());
DatabaseAdapter::PutOptionalString(obj, IN_REPLY_TO, email.GetInReplyTo());
// Priority
Email::Priority priority = email.GetPriority();
if(priority == Email::Priority_High) {
err = obj.putString(PRIORITY, PRIORITY_HIGH);
ErrorToException(err);
} else if(priority == Email::Priority_Low) {
err = obj.putString(PRIORITY, PRIORITY_LOW);
ErrorToException(err);
}
}
}