mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[8768] Rewrite code for prepare and send mails.
* Move send functions to new MailDraft class from WorldSession * Simplify use different args combinations used in SendMailTo by groupping its by functionality in Helper classes. This also will prevent wrong way use args combinations.
This commit is contained in:
parent
50e80d67f9
commit
d009994f59
12 changed files with 381 additions and 317 deletions
|
|
@ -2003,13 +2003,12 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
|
|||
std::string text = msgText;
|
||||
|
||||
// from console show not existed sender
|
||||
uint32 sender_guidlo = m_session ? m_session->GetPlayer()->GetGUIDLow() : 0;
|
||||
MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
|
||||
|
||||
uint32 messagetype = MAIL_NORMAL;
|
||||
uint32 stationery = MAIL_STATIONERY_GM;
|
||||
uint32 itemTextId = !text.empty() ? objmgr.CreateItemText( text ) : 0;
|
||||
|
||||
WorldSession::SendMailTo(target,messagetype, stationery, sender_guidlo, GUID_LOPART(target_guid), subject, itemTextId, NULL, 0, 0, MAIL_CHECK_MASK_NONE);
|
||||
MailDraft(subject, itemTextId)
|
||||
.SendMailTo(MailReceiver(target,GUID_LOPART(target_guid)),sender);
|
||||
|
||||
std::string nameLink = playerLink(target_name);
|
||||
PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue