mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-05 06:50:04 +00:00
Email bugfixes
- Fix item flag not getting updated - Fix attachments getting written to the same slot
This commit is contained in:
parent
8f90fdaac4
commit
d505b09e98
@ -836,6 +836,11 @@ void Database::updateEmailContent(EmailData* data) {
|
|||||||
|
|
||||||
db.begin_transaction();
|
db.begin_transaction();
|
||||||
|
|
||||||
|
auto attachments = db.get_all<Database::EmailItem>(
|
||||||
|
where(c(&Database::EmailItem::PlayerId) == data->PlayerId && c(&Database::EmailItem::MsgIndex) == data->MsgIndex)
|
||||||
|
);
|
||||||
|
data->ItemFlag = (data->Taros > 0 || attachments.size() > 0) ? 1 : 0; // set attachment flag dynamically
|
||||||
|
|
||||||
db.remove_all<Database::EmailData>(
|
db.remove_all<Database::EmailData>(
|
||||||
where(c(&Database::EmailData::PlayerId) == data->PlayerId && c(&Database::EmailData::MsgIndex) == data->MsgIndex)
|
where(c(&Database::EmailData::PlayerId) == data->PlayerId && c(&Database::EmailData::MsgIndex) == data->MsgIndex)
|
||||||
);
|
);
|
||||||
@ -901,7 +906,7 @@ void Database::sendEmail(EmailData* data, std::vector<sItemBase> attachments) {
|
|||||||
EmailItem dbItem = {
|
EmailItem dbItem = {
|
||||||
data->PlayerId,
|
data->PlayerId,
|
||||||
data->MsgIndex,
|
data->MsgIndex,
|
||||||
slot,
|
slot++,
|
||||||
item.iType,
|
item.iType,
|
||||||
item.iID,
|
item.iID,
|
||||||
item.iOpt,
|
item.iOpt,
|
||||||
|
Loading…
Reference in New Issue
Block a user