mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10969] Some cleanups in MailDraft API
* Use Set* names for cases when function replace old value by new (instead Add*) * Prevent hidden MailDraft copy create becase if draft have items its can't be just shared and need preoprtly cloned, but item close is high price operation (guid use, DB tiuched and etc) So this must be explictly operation. In next commits will be added clone function for this. * Some MailDraft overwrite by assign cases rewrited to more clean way.
This commit is contained in:
parent
22115a8d04
commit
231c6d77ce
8 changed files with 39 additions and 31 deletions
|
|
@ -1763,14 +1763,10 @@ bool ChatHandler::HandleSendMailCommand(char* args)
|
|||
if (!msgText)
|
||||
return false;
|
||||
|
||||
// msgSubject, msgText isn't NUL after prev. check
|
||||
std::string subject = msgSubject;
|
||||
std::string text = msgText;
|
||||
|
||||
// from console show nonexistent sender
|
||||
MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetObjectGuid().GetCounter() : 0, MAIL_STATIONERY_GM);
|
||||
|
||||
MailDraft(subject, text)
|
||||
MailDraft(msgSubject, msgText)
|
||||
.SendMailTo(MailReceiver(target, target_guid),sender);
|
||||
|
||||
std::string nameLink = playerLink(target_name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue