Port some mailsending-fixes from MaNGOS - prevents copying maildata/text into new mails

Original fix by Vladimir

--HG--
branch : trunk
This commit is contained in:
click
2010-04-14 19:06:37 +02:00
parent 1e573cf11c
commit 34a70d3e46
5 changed files with 13 additions and 13 deletions
+3 -3
View File
@@ -138,7 +138,7 @@ void WorldSession::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPri
MailDraft(msgAuctionOutbiddedSubject.str(), "") // TODO: fix body
.AddMoney(auction->bid)
.SendMailTo(MailReceiver(oldBidder, auction->bidder), auction);
.SendMailTo(MailReceiver(oldBidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED);
}
}
@@ -160,7 +160,7 @@ void WorldSession::SendAuctionCancelledToBidderMail(AuctionEntry* auction)
MailDraft(msgAuctionCancelledSubject.str(), "") // TODO: fix body
.AddMoney(auction->bid)
.SendMailTo(MailReceiver(bidder, auction->bidder), auction);
.SendMailTo(MailReceiver(bidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED);
}
}
@@ -464,7 +464,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
// item will deleted or added to received mail list
MailDraft(msgAuctionCanceledOwner.str(), "") // TODO: fix body
.AddItem(pItem)
.SendMailTo(pl, auction);
.SendMailTo(pl, auction, MAIL_CHECK_MASK_COPIED);
}
else
{
+4 -4
View File
@@ -156,7 +156,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction)
MailDraft(msgAuctionWonSubject.str(), msgAuctionWonBody.str())
.AddItem(pItem)
.SendMailTo(MailReceiver(bidder,auction->bidder), MailSender(auction), MAIL_CHECK_MASK_NONE);
.SendMailTo(MailReceiver(bidder,auction->bidder), auction, MAIL_CHECK_MASK_COPIED);
}
}
@@ -185,7 +185,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction)
sLog.outDebug("AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str());
MailDraft(msgAuctionSalePendingSubject.str(), msgAuctionSalePendingBody.str())
.SendMailTo(MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_NONE);
.SendMailTo(MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED);
}
}
@@ -222,7 +222,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction)
}
MailDraft(msgAuctionSuccessfulSubject.str(), auctionSuccessfulBody.str())
.AddMoney(profit)
.SendMailTo(MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_NONE, sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY));
.SendMailTo(MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY));
}
}
@@ -247,7 +247,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry * auction)
MailDraft(subject.str(), "") // TODO: fix body
.AddItem(pItem)
.SendMailTo(MailReceiver(owner,auction->owner), auction);
.SendMailTo(MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED);
}
}
+1 -1
View File
@@ -274,7 +274,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
draft
.AddMoney(money)
.AddCOD(COD)
.SendMailTo(MailReceiver(receive, GUID_LOPART(rc)), MailSender(pl), body.empty() ? MailCheckMask(MAIL_CHECK_MASK_NONE | MAIL_CHECK_MASK_COPIED) : MAIL_CHECK_MASK_HAS_BODY, deliver_delay);
.SendMailTo(MailReceiver(receive, GUID_LOPART(rc)), pl, body.empty() ? MAIL_CHECK_MASK_COPIED : MAIL_CHECK_MASK_HAS_BODY, deliver_delay);
CharacterDatabase.BeginTransaction();
pl->SaveInventoryAndGoldToDB();
+2 -2
View File
@@ -44,8 +44,8 @@ enum MailCheckMask
{
MAIL_CHECK_MASK_NONE = 0x00,
MAIL_CHECK_MASK_READ = 0x01,
MAIL_CHECK_MASK_RETURNED = 0x02, /// This mail was returned.
MAIL_CHECK_MASK_COPIED = 0x04, /// This mail was copied.
MAIL_CHECK_MASK_RETURNED = 0x02, /// This mail was returned. Do not allow returning mail back again.
MAIL_CHECK_MASK_COPIED = 0x04, /// This mail was copied. Do not allow making a copy of items in mail.
MAIL_CHECK_MASK_COD_PAYMENT = 0x08,
MAIL_CHECK_MASK_HAS_BODY = 0x10, /// This mail has body text.
};
+3 -3
View File
@@ -14118,7 +14118,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())
{
@@ -16548,7 +16548,7 @@ void Player::_LoadInventory(QueryResult_AutoPtr 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())
@@ -21139,7 +21139,7 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/)
CharacterDatabase.CommitTransaction();
std::string subject = GetSession()->GetTrinityString(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 were problems with equipping one or several items").AddItem(offItem).SendMailTo(this, MailSender(this, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_COPIED);
}
}