don't send auto-reply message if sender is blocked
This commit is contained in:
+20
-16
@@ -3687,16 +3687,18 @@ static void on_81(shared_ptr<Client> c, uint16_t, uint32_t, string& data) {
|
|||||||
if (!target) {
|
if (!target) {
|
||||||
// TODO: We should store pending messages for accounts somewhere, and send
|
// TODO: We should store pending messages for accounts somewhere, and send
|
||||||
// them when the player signs on again.
|
// them when the player signs on again.
|
||||||
try {
|
if (!c->blocked_senders.count(to_guild_card_number)) {
|
||||||
auto target_license = s->license_index->get(to_guild_card_number);
|
try {
|
||||||
if (!target_license->auto_reply_message.empty()) {
|
auto target_license = s->license_index->get(to_guild_card_number);
|
||||||
send_simple_mail(
|
if (!target_license->auto_reply_message.empty()) {
|
||||||
c,
|
send_simple_mail(
|
||||||
target_license->serial_number,
|
c,
|
||||||
target_license->last_player_name,
|
target_license->serial_number,
|
||||||
target_license->auto_reply_message);
|
target_license->last_player_name,
|
||||||
|
target_license->auto_reply_message);
|
||||||
|
}
|
||||||
|
} catch (const LicenseIndex::missing_license&) {
|
||||||
}
|
}
|
||||||
} catch (const LicenseIndex::missing_license&) {
|
|
||||||
}
|
}
|
||||||
send_text_message(c, "$C6Player is offline");
|
send_text_message(c, "$C6Player is offline");
|
||||||
|
|
||||||
@@ -3708,13 +3710,15 @@ static void on_81(shared_ptr<Client> c, uint16_t, uint32_t, string& data) {
|
|||||||
|
|
||||||
// If the target has auto-reply enabled, send the autoreply. Note that we also
|
// If the target has auto-reply enabled, send the autoreply. Note that we also
|
||||||
// forward the message in this case.
|
// forward the message in this case.
|
||||||
auto target_p = target->character();
|
if (!c->blocked_senders.count(target->license->serial_number)) {
|
||||||
if (!target_p->auto_reply.empty()) {
|
auto target_p = target->character();
|
||||||
send_simple_mail(
|
if (!target_p->auto_reply.empty()) {
|
||||||
c,
|
send_simple_mail(
|
||||||
target->license->serial_number,
|
c,
|
||||||
target_p->disp.name.decode(target_p->inventory.language),
|
target->license->serial_number,
|
||||||
target_p->auto_reply.decode(target_p->inventory.language));
|
target_p->disp.name.decode(target_p->inventory.language),
|
||||||
|
target_p->auto_reply.decode(target_p->inventory.language));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forward the message
|
// Forward the message
|
||||||
|
|||||||
Reference in New Issue
Block a user