本文整理汇总了C++中CalendarEvent::BuildCalendarMailBody方法的典型用法代码示例。如果您正苦于以下问题:C++ CalendarEvent::BuildCalendarMailBody方法的具体用法?C++ CalendarEvent::BuildCalendarMailBody怎么用?C++ CalendarEvent::BuildCalendarMailBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CalendarEvent
的用法示例。
在下文中一共展示了CalendarEvent::BuildCalendarMailBody方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveEvent
CalendarEventStore::iterator CalendarMgr::RemoveEvent(uint64 eventId, uint64 remover)
{
CalendarEventStore::iterator current;
CalendarEvent* calendarEvent = GetEvent(eventId, ¤t);
if (!calendarEvent)
{
SendCalendarCommandResult(remover, CALENDAR_ERROR_EVENT_INVALID);
return _events.end();
}
SendCalendarEventRemovedAlert(*calendarEvent);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
PreparedStatement* stmt;
MailDraft mail(calendarEvent->BuildCalendarMailSubject(remover), calendarEvent->BuildCalendarMailBody());
CalendarInviteStore& eventInvites = _invites[eventId];
for (size_t i = 0; i < eventInvites.size(); ++i)
{
CalendarInvite* invite = eventInvites[i];
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CALENDAR_INVITE);
stmt->setUInt64(0, invite->GetInviteId());
trans->Append(stmt);
// guild events only? check invite status here?
// When an event is deleted, all invited (accepted/declined? - verify) guildies are notified via in-game mail. (wowwiki)
if (remover && invite->GetInviteeGUID() != remover)
mail.SendMailTo(trans, MailReceiver(invite->GetInviteeGUID()), calendarEvent, MAIL_CHECK_MASK_COPIED);
delete invite;
}
_invites.erase(eventId);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CALENDAR_EVENT);
stmt->setUInt64(0, eventId);
trans->Append(stmt);
CharacterDatabase.CommitTransaction(trans);
delete calendarEvent;
current = _events.erase(current);
return current;
}
示例2: RemoveEvent
void CalendarMgr::RemoveEvent(uint64 eventId, uint64 remover)
{
CalendarEvent* calendarEvent = GetEvent(eventId);
if (!calendarEvent)
{
SendCalendarCommandResult(remover, CALENDAR_ERROR_EVENT_INVALID);
return;
}
SendCalendarEventRemovedAlert(*calendarEvent);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
PreparedStatement* stmt;
MailDraft mail(calendarEvent->BuildCalendarMailSubject(remover), calendarEvent->BuildCalendarMailBody());
std::vector<CalendarInvite*>::iterator itr = _invites[eventId].begin();
while (itr != _invites[eventId].end())
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CALENDAR_INVITE);
stmt->setUInt64(0, (*itr)->GetInviteId());
trans->Append(stmt);
// guild events only? check invite status here?
// When an event is deleted, all invited (accepted/declined? - verify) guildies are notified via in-game mail. (wowwiki)
if (remover && (*itr)->GetInviteeGUID() != remover)
mail.SendMailTo(trans, MailReceiver((*itr)->GetInviteeGUID()), calendarEvent, MAIL_CHECK_MASK_COPIED);
delete *itr;
_invites[eventId].erase(itr);
}
_invites.erase(eventId);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CALENDAR_EVENT);
stmt->setUInt64(0, eventId);
trans->Append(stmt);
CharacterDatabase.CommitTransaction(trans);
delete calendarEvent;
_events.erase(calendarEvent);
}