[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:
VladimirMangos 2011-01-06 02:07:41 +03:00
parent 22115a8d04
commit 231c6d77ce
8 changed files with 39 additions and 31 deletions

View file

@ -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);