aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Chat/Channels/Channel.cpp12
-rw-r--r--src/server/game/Chat/Channels/Channel.h2
-rw-r--r--src/server/game/Entities/Player/Player.cpp2
3 files changed, 9 insertions, 7 deletions
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index 98bcf8c7e48..b56b456a3e3 100644
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -241,14 +241,16 @@ void Channel::JoinChannel(Player* player, std::string const& pass)
SendToOne(builder, guid);
*/
- auto builder = [&](LocaleConstant /*locale*/)
+ auto builder = [&](LocaleConstant locale)
{
+ LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale);
+
WorldPackets::Channel::ChannelNotifyJoined* notify = new WorldPackets::Channel::ChannelNotifyJoined();
//notify->ChannelWelcomeMsg = "";
notify->ChatChannelID = _channelId;
//notify->InstanceID = 0;
notify->_ChannelFlags = _channelFlags;
- notify->_Channel = _channelName;
+ notify->_Channel = GetName(localeIdx);
return notify;
};
@@ -276,7 +278,7 @@ void Channel::JoinChannel(Player* player, std::string const& pass)
}
}
-void Channel::LeaveChannel(Player* player, bool send)
+void Channel::LeaveChannel(Player* player, bool send, bool suspend)
{
ObjectGuid const& guid = player->GetGUID();
if (!IsOn(guid))
@@ -306,8 +308,8 @@ void Channel::LeaveChannel(Player* player, bool send)
WorldPackets::Channel::ChannelNotifyLeft* notify = new WorldPackets::Channel::ChannelNotifyLeft();
notify->Channel = GetName(localeIdx);
- notify->ChatChannelID = 0;
- //notify->Suspended = false;
+ notify->ChatChannelID = _channelId;
+ notify->Suspended = suspend;
return notify;
};
diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h
index ed67204f290..b4455decdb9 100644
--- a/src/server/game/Chat/Channels/Channel.h
+++ b/src/server/game/Chat/Channels/Channel.h
@@ -197,7 +197,7 @@ class TC_GAME_API Channel
AreaTableEntry const* GetZoneEntry() const { return _zoneEntry; }
void JoinChannel(Player* player, std::string const& pass);
- void LeaveChannel(Player* player, bool send = true);
+ void LeaveChannel(Player* player, bool send = true, bool suspend = false);
void KickOrBan(Player const* player, std::string const& badname, bool ban);
void Kick(Player const* player, std::string const& badname) { KickOrBan(player, badname, false); }
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 1ad659210fc..1298f5815bc 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -4760,7 +4760,7 @@ void Player::UpdateLocalChannels(uint32 newZone)
if (removeChannel)
{
- removeChannel->LeaveChannel(this, sendRemove); // Leave old channel
+ removeChannel->LeaveChannel(this, sendRemove, true); // Leave old channel
LeftChannel(removeChannel); // Remove from player's channel list
cMgr->LeftChannel(removeChannel->GetChannelId(), removeChannel->GetZoneEntry()); // Delete if empty