Skip to content

Commit

Permalink
Merge branch 'master' into compile_perl_5.22
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonrag committed May 13, 2021
2 parents ebe5fef + 7592b23 commit b7eb30a
Show file tree
Hide file tree
Showing 18 changed files with 328,262 additions and 101,454 deletions.
27 changes: 24 additions & 3 deletions src/Network/Receive.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8288,6 +8288,13 @@ sub rodex_mail_list {
}
$print_msg .= sprintf("%s\n", ('-'x119));
message $print_msg, "list";

Plugins::callHook('rodex_mail_list', {
'mails' => $rodexList->{mails},
'current_page' => $rodexList->{current_page},
'last_mailID' => $rodexList->{current_page_last_mailID},
'isEnd' => $args->{isEnd},
});
}

sub rodex_read_mail {
Expand All @@ -8300,7 +8307,7 @@ sub rodex_read_mail {

my $mail = {};

$mail->{body} = substr($msg, $header_len, $args->{text_len});
$mail->{body} = solveMSG(bytesToString(substr($msg, $header_len, $args->{text_len})));
$mail->{zeny1} = $args->{zeny1};
$mail->{zeny2} = $args->{zeny2};

Expand All @@ -8311,9 +8318,9 @@ sub rodex_read_mail {

$mail->{items} = [];

message center(" " . "Mail (" . $args->{mailID1} . ")" . $rodexList->{mails}{$args->{mailID1}}->{sender} . " ", 119, '-') . "\n";
message center(" " . "Mail (" . $args->{mailID1} . ") " . $rodexList->{mails}{$args->{mailID1}}->{sender} . " ", 119, '-') . "\n";
message sprintf("From: %s \n", $rodexList->{mails}{$args->{mailID1}}->{sender});
message "Message:\n" . solveMSG(bytesToString($mail->{body}));
message "Message:\n" . $mail->{body};
# FIXME for some reason message can't concatenate bytesToString + "\n"
message "\n";

Expand Down Expand Up @@ -8354,6 +8361,16 @@ sub rodex_read_mail {
$rodexList->{mails}{$args->{mailID1}}{isRead} = 1;

$rodexList->{current_read} = $args->{mailID1};

Plugins::callHook('rodex_mail', {
'mailID' => $args->{mailID1},
'from' => $rodexList->{mails}{$args->{mailID1}}->{sender},
'title' => $rodexList->{mails}{$args->{mailID1}}->{title},
'content' => $mail->{body},
'zeny' => $args->{zeny1},
'itemCount' => $args->{itemCount},
'items' => $mail->{items},
});
}

sub unread_rodex {
Expand Down Expand Up @@ -8501,6 +8518,10 @@ sub rodex_delete {

message TF("You have deleted the mail of ID %s.\n", $args->{mailID1});

Plugins::callHook('rodex_mail_deleted', {
'mailID' => $args->{mailID1},
});

delete $rodexList->{mails}{$args->{mailID1}};
}

Expand Down
Loading

0 comments on commit b7eb30a

Please sign in to comment.