[9730] Mail send related fixes in recent code.

* Avoid use explicit MailReciever/MailSender where not need.
  Types specially added for autoconvertion from common cases.

* Prevent allow copy text auction mails. It anyway store encoded data.
  Same for some another non-player mails.
This commit is contained in:
VladimirMangos 2010-04-12 05:04:05 +04:00
parent 9304d7509d
commit c64a2e8c84
6 changed files with 14 additions and 14 deletions

View file

@ -13459,7 +13459,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
// Send reward mail
if (uint32 mail_template_id = pQuest->GetRewMailTemplateId())
MailDraft(mail_template_id).SendMailTo(MailReceiver(this), MailSender(questGiver), MAIL_CHECK_MASK_HAS_BODY, pQuest->GetRewMailDelaySecs());
MailDraft(mail_template_id).SendMailTo(this, questGiver, MAIL_CHECK_MASK_HAS_BODY, pQuest->GetRewMailDelaySecs());
if (pQuest->IsDaily())
{
@ -15737,7 +15737,7 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
draft.AddItem(item);
}
draft.SendMailTo(this, MailSender(this, MAIL_STATIONERY_GM));
draft.SendMailTo(this, MailSender(this, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_COPIED);
}
}
//if(isAlive())
@ -19899,7 +19899,7 @@ void Player::AutoUnequipOffhandIfNeed()
CharacterDatabase.CommitTransaction();
std::string subject = GetSession()->GetMangosString(LANG_NOT_EQUIPPED_ITEM);
MailDraft(subject, "There's were problems with equipping this item.").AddItem(offItem).SendMailTo(this, MailSender(this, MAIL_STATIONERY_GM));
MailDraft(subject, "There's were problems with equipping this item.").AddItem(offItem).SendMailTo(this, MailSender(this, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_COPIED);
}
}