mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: fire MAIL_INBOX_UPDATE and UPDATE_PENDING_MAIL events
Fire MAIL_INBOX_UPDATE when the mail list is received/refreshed (SMSG_MAIL_LIST_RESULT), so mail addons can update their display. Fire UPDATE_PENDING_MAIL when new mail arrives (SMSG_RECEIVED_MAIL), enabling minimap mail icon addons and notification addons to react.
This commit is contained in:
parent
2560bd1307
commit
2e6400f22e
1 changed files with 2 additions and 0 deletions
|
|
@ -25253,6 +25253,7 @@ void GameHandler::handleMailListResult(network::Packet& packet) {
|
||||||
selectedMailIndex_ = -1;
|
selectedMailIndex_ = -1;
|
||||||
showMailCompose_ = false;
|
showMailCompose_ = false;
|
||||||
}
|
}
|
||||||
|
if (addonEventCallback_) addonEventCallback_("MAIL_INBOX_UPDATE", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameHandler::handleSendMailResult(network::Packet& packet) {
|
void GameHandler::handleSendMailResult(network::Packet& packet) {
|
||||||
|
|
@ -25327,6 +25328,7 @@ void GameHandler::handleReceivedMail(network::Packet& packet) {
|
||||||
LOG_INFO("SMSG_RECEIVED_MAIL: New mail arrived!");
|
LOG_INFO("SMSG_RECEIVED_MAIL: New mail arrived!");
|
||||||
hasNewMail_ = true;
|
hasNewMail_ = true;
|
||||||
addSystemChatMessage("New mail has arrived.");
|
addSystemChatMessage("New mail has arrived.");
|
||||||
|
if (addonEventCallback_) addonEventCallback_("UPDATE_PENDING_MAIL", {});
|
||||||
// If mailbox is open, refresh
|
// If mailbox is open, refresh
|
||||||
if (mailboxOpen_) {
|
if (mailboxOpen_) {
|
||||||
refreshMailList();
|
refreshMailList();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue