Skip to content

Commit

Permalink
Fixed whisper redirect not working
Browse files Browse the repository at this point in the history
  • Loading branch information
3vcloud committed Apr 13, 2024
1 parent 5567573 commit 002d617
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions GWToolboxdll/Windows/FriendListWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ namespace {
}
break;
case GW::UI::UIMessage::kSendChatMessage: {
const auto message = *(wchar_t**)wparam;
const auto packet = (GW::UI::UIPacket::kSendChatMessage*)wparam;
const auto message = packet->message;
const auto channel = GW::Chat::GetChannel(*message);
// If this outgoing whisper was created due to a redirect, or its not a whisper, drop out here.
if (is_redirecting_whisper || channel != GW::Chat::CHANNEL_WHISPER) {
Expand All @@ -379,7 +380,7 @@ namespace {
return;
}
// If the recipient is in my friend list, but under a different player name, redirect it now...
const auto target = std::wstring(message, separator_pos);
const auto target = std::wstring(&message[1], separator_pos);
const auto text = separator_pos + 1;
if (const auto friend_ = FriendListWindow::GetFriend(target.c_str())) {
const auto& friendname = friend_->current_char->getNameW();
Expand Down

0 comments on commit 002d617

Please sign in to comment.