Commit 16d3b7a4 authored by TOM_RUS's avatar TOM_RUS
Browse files

WOW-26936patch8.0.1_Beta

parent 46d53f88
......@@ -550,6 +550,23 @@ local Club =
{ Name = "tickets", Type = "table", InnerType = "ClubTicketInfo", Nilable = false },
},
},
{
Name = "IsBeginningOfStream",
Type = "Function",
Documentation = { "Returns whether the given message is the first message in the stream, taking into account ignored messages" },
Arguments =
{
{ Name = "clubId", Type = "string", Nilable = false },
{ Name = "streamId", Type = "string", Nilable = false },
{ Name = "messageId", Type = "ClubMessageIdentifier", Nilable = false },
},
Returns =
{
{ Name = "isBeginningOfStream", Type = "bool", Nilable = false },
},
},
{
Name = "IsEnabled",
Type = "Function",
......@@ -1158,9 +1175,9 @@ local Club =
{
Name = "ClubErrorType",
Type = "Enumeration",
NumValues = 37,
NumValues = 39,
MinValue = 0,
MaxValue = 36,
MaxValue = 38,
Fields =
{
{ Name = "ErrorCommunitiesNone", Type = "ClubErrorType", EnumValue = 0 },
......@@ -1176,30 +1193,32 @@ local Club =
{ Name = "ErrorCommunitiesUnknownTicket", Type = "ClubErrorType", EnumValue = 10 },
{ Name = "ErrorCommunitiesMissingShortName", Type = "ClubErrorType", EnumValue = 11 },
{ Name = "ErrorCommunitiesProfanity", Type = "ClubErrorType", EnumValue = 12 },
{ Name = "ErrorClubFull", Type = "ClubErrorType", EnumValue = 13 },
{ Name = "ErrorClubNoClub", Type = "ClubErrorType", EnumValue = 14 },
{ Name = "ErrorClubNotMember", Type = "ClubErrorType", EnumValue = 15 },
{ Name = "ErrorClubAlreadyMember", Type = "ClubErrorType", EnumValue = 16 },
{ Name = "ErrorClubNoSuchMember", Type = "ClubErrorType", EnumValue = 17 },
{ Name = "ErrorClubNoSuchInvitation", Type = "ClubErrorType", EnumValue = 18 },
{ Name = "ErrorClubInvitationAlreadyExists", Type = "ClubErrorType", EnumValue = 19 },
{ Name = "ErrorClubInvalidRoleID", Type = "ClubErrorType", EnumValue = 20 },
{ Name = "ErrorClubInsufficientPrivileges", Type = "ClubErrorType", EnumValue = 21 },
{ Name = "ErrorClubTooManyClubsJoined", Type = "ClubErrorType", EnumValue = 22 },
{ Name = "ErrorClubVoiceFull", Type = "ClubErrorType", EnumValue = 23 },
{ Name = "ErrorClubStreamNoStream", Type = "ClubErrorType", EnumValue = 24 },
{ Name = "ErrorClubStreamInvalidName", Type = "ClubErrorType", EnumValue = 25 },
{ Name = "ErrorClubStreamCountAtMin", Type = "ClubErrorType", EnumValue = 26 },
{ Name = "ErrorClubStreamCountAtMax", Type = "ClubErrorType", EnumValue = 27 },
{ Name = "ErrorClubMemberHasRequiredRole", Type = "ClubErrorType", EnumValue = 28 },
{ Name = "ErrorClubSentInvitationCountAtMax", Type = "ClubErrorType", EnumValue = 29 },
{ Name = "ErrorClubReceivedInvitationCountAtMax", Type = "ClubErrorType", EnumValue = 30 },
{ Name = "ErrorClubTargetIsBanned", Type = "ClubErrorType", EnumValue = 31 },
{ Name = "ErrorClubBanAlreadyExists", Type = "ClubErrorType", EnumValue = 32 },
{ Name = "ErrorClubBanCountAtMax", Type = "ClubErrorType", EnumValue = 33 },
{ Name = "ErrorClubTicketCountAtMax", Type = "ClubErrorType", EnumValue = 34 },
{ Name = "ErrorClubTicketNoSuchTicket", Type = "ClubErrorType", EnumValue = 35 },
{ Name = "ErrorClubTicketHasConsumedAllowedRedeemCount", Type = "ClubErrorType", EnumValue = 36 },
{ Name = "ErrorCommunitiesTrial", Type = "ClubErrorType", EnumValue = 13 },
{ Name = "ErrorCommunitiesVeteranTrial", Type = "ClubErrorType", EnumValue = 14 },
{ Name = "ErrorClubFull", Type = "ClubErrorType", EnumValue = 15 },
{ Name = "ErrorClubNoClub", Type = "ClubErrorType", EnumValue = 16 },
{ Name = "ErrorClubNotMember", Type = "ClubErrorType", EnumValue = 17 },
{ Name = "ErrorClubAlreadyMember", Type = "ClubErrorType", EnumValue = 18 },
{ Name = "ErrorClubNoSuchMember", Type = "ClubErrorType", EnumValue = 19 },
{ Name = "ErrorClubNoSuchInvitation", Type = "ClubErrorType", EnumValue = 20 },
{ Name = "ErrorClubInvitationAlreadyExists", Type = "ClubErrorType", EnumValue = 21 },
{ Name = "ErrorClubInvalidRoleID", Type = "ClubErrorType", EnumValue = 22 },
{ Name = "ErrorClubInsufficientPrivileges", Type = "ClubErrorType", EnumValue = 23 },
{ Name = "ErrorClubTooManyClubsJoined", Type = "ClubErrorType", EnumValue = 24 },
{ Name = "ErrorClubVoiceFull", Type = "ClubErrorType", EnumValue = 25 },
{ Name = "ErrorClubStreamNoStream", Type = "ClubErrorType", EnumValue = 26 },
{ Name = "ErrorClubStreamInvalidName", Type = "ClubErrorType", EnumValue = 27 },
{ Name = "ErrorClubStreamCountAtMin", Type = "ClubErrorType", EnumValue = 28 },
{ Name = "ErrorClubStreamCountAtMax", Type = "ClubErrorType", EnumValue = 29 },
{ Name = "ErrorClubMemberHasRequiredRole", Type = "ClubErrorType", EnumValue = 30 },
{ Name = "ErrorClubSentInvitationCountAtMax", Type = "ClubErrorType", EnumValue = 31 },
{ Name = "ErrorClubReceivedInvitationCountAtMax", Type = "ClubErrorType", EnumValue = 32 },
{ Name = "ErrorClubTargetIsBanned", Type = "ClubErrorType", EnumValue = 33 },
{ Name = "ErrorClubBanAlreadyExists", Type = "ClubErrorType", EnumValue = 34 },
{ Name = "ErrorClubBanCountAtMax", Type = "ClubErrorType", EnumValue = 35 },
{ Name = "ErrorClubTicketCountAtMax", Type = "ClubErrorType", EnumValue = 36 },
{ Name = "ErrorClubTicketNoSuchTicket", Type = "ClubErrorType", EnumValue = 37 },
{ Name = "ErrorClubTicketHasConsumedAllowedRedeemCount", Type = "ClubErrorType", EnumValue = 38 },
},
},
{
......
......@@ -11,12 +11,12 @@ local IslandsQueueUI =
Type = "Function",
},
{
Name = "GetIslandDifficultyIds",
Name = "GetIslandDifficultyInfo",
Type = "Function",
Returns =
{
{ Name = "lfgIslandDifficultyIds", Type = "table", InnerType = "number", Nilable = false },
{ Name = "islandDifficultyInfo", Type = "table", InnerType = "IslandsQueueDifficultyInfo", Nilable = false },
},
},
{
......@@ -46,6 +46,15 @@ local IslandsQueueUI =
{ Name = "difficultyID", Type = "number", Nilable = false },
},
},
{
Name = "RequestPreloadRewardData",
Type = "Function",
Arguments =
{
{ Name = "questId", Type = "number", Nilable = false },
},
},
},
Events =
......@@ -64,6 +73,15 @@ local IslandsQueueUI =
Tables =
{
{
Name = "IslandsQueueDifficultyInfo",
Type = "Structure",
Fields =
{
{ Name = "difficultyId", Type = "number", Nilable = false },
{ Name = "previewRewardQuestId", Type = "number", Nilable = false },
},
},
},
};
......
......@@ -17,6 +17,8 @@ local PlayerLocation =
Returns =
{
{ Name = "className", Type = "string", Nilable = true },
{ Name = "classFilename", Type = "string", Nilable = true },
{ Name = "classID", Type = "number", Nilable = true },
},
},
......@@ -62,6 +64,20 @@ local PlayerLocation =
{ Name = "sex", Type = "number", Nilable = true },
},
},
{
Name = "IsConnected",
Type = "Function",
Arguments =
{
{ Name = "playerLocation", Type = "table", Mixin = "PlayerLocationMixin", Nilable = true },
},
Returns =
{
{ Name = "isConnected", Type = "bool", Nilable = true },
},
},
},
Events =
......
......@@ -71,22 +71,6 @@ local Unit =
{ Name = "classID", Type = "number", Nilable = false },
},
},
{
Name = "UnitClassByPlayerLocation",
Type = "Function",
Arguments =
{
{ Name = "playerLocation", Type = "table", Mixin = "PlayerLocationMixin", Nilable = false },
},
Returns =
{
{ Name = "className", Type = "string", Nilable = false },
{ Name = "classFilename", Type = "string", Nilable = false },
{ Name = "classID", Type = "number", Nilable = false },
},
},
{
Name = "UnitIsConnected",
Type = "Function",
......
......@@ -24,6 +24,15 @@ local VoiceChat =
{ Name = "listenToLocalUser", Type = "bool", Nilable = false },
},
},
{
Name = "CanPlayerUseVoiceChat",
Type = "Function",
Returns =
{
{ Name = "canUseVoiceChat", Type = "bool", Nilable = false },
},
},
{
Name = "CreateChannel",
Type = "Function",
......@@ -326,21 +335,6 @@ local VoiceChat =
{ Name = "isLoggedIn", Type = "bool", Nilable = false },
},
},
{
Name = "IsMemberConnected",
Type = "Function",
Arguments =
{
{ Name = "memberID", Type = "number", Nilable = false },
{ Name = "channelID", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "isConnected", Type = "bool", Nilable = false },
},
},
{
Name = "IsMemberLocalPlayer",
Type = "Function",
......@@ -409,6 +403,24 @@ local VoiceChat =
{ Name = "isMuted", Type = "bool", Nilable = true },
},
},
{
Name = "IsParentalDisabled",
Type = "Function",
Returns =
{
{ Name = "isParentalDisabled", Type = "bool", Nilable = false },
},
},
{
Name = "IsParentalMuted",
Type = "Function",
Returns =
{
{ Name = "isParentalMuted", Type = "bool", Nilable = false },
},
},
{
Name = "IsPlayerUsingVoice",
Type = "Function",
......@@ -964,9 +976,9 @@ local VoiceChat =
{
Name = "VoiceChatStatusCode",
Type = "Enumeration",
NumValues = 22,
NumValues = 23,
MinValue = 0,
MaxValue = 21,
MaxValue = 22,
Fields =
{
{ Name = "Success", Type = "VoiceChatStatusCode", EnumValue = 0 },
......@@ -991,6 +1003,7 @@ local VoiceChat =
{ Name = "UnsupportedChatChannelType", Type = "VoiceChatStatusCode", EnumValue = 19 },
{ Name = "InvalidCommunityStream", Type = "VoiceChatStatusCode", EnumValue = 20 },
{ Name = "PlayerSilenced", Type = "VoiceChatStatusCode", EnumValue = 21 },
{ Name = "PlayerVoiceChatParentalDisabled", Type = "VoiceChatStatusCode", EnumValue = 22 },
},
},
{
......
UIPanelWindows["ArchaeologyFrame"] = {area = "left", pushable = 3, showFailedFunc = "ArchaeologyFrame_ShowFailed" };
ARCHAEOLOGY_BUTTON_HEIGHT = 59;
ARCHAEOLOGY_MID_TITLE_YOFFSET = -110;
......@@ -59,6 +54,7 @@ end
function ArchaeologyFrame_OnLoad(self)
UIPanelWindows["ArchaeologyFrame"] = {area = "left", pushable = 3, showFailedFunc = ArchaeologyFrame_ShowFailed };
ButtonFrameTemplate_HideButtonBar(ArchaeologyFrame);
ButtonFrameTemplate_HideAttic(ArchaeologyFrame);
......
......@@ -406,13 +406,11 @@ end
function ChannelFrameMixin:OnVoiceChatError(platformCode, statusCode)
local errorCode = Voice_GetGameErrorFromStatusCode(statusCode);
if errorCode then
local errorString = Voice_GetGameErrorStringFromStatusCode(statusCode);
if errorString then
UIErrorsFrame:TryDisplayMessage(errorCode, errorString, RED_FONT_COLOR:GetRGB());
ChatFrame_DisplayUsageError(errorString);
self.lastError = statusCode;
end
local errorString = Voice_GetGameAlertStringFromStatusCode(statusCode);
if errorString then
UIErrorsFrame:TryDisplayMessage(errorCode, errorString, RED_FONT_COLOR:GetRGB());
ChatFrame_DisplayUsageError(errorString);
self.lastError = statusCode;
end
end
......
......@@ -176,12 +176,18 @@ do
local function UpdateChatSystemChannelRosterEntry(channelID, rosterIndex, voiceChannelID, rosterEntry)
local name, owner, moderator, guid = C_ChatInfo.GetChannelRosterInfo(channelID, rosterIndex);
if not name then
-- we don't have the roster info yet
return;
end
rosterEntry:SetMemberID(rosterIndex);
rosterEntry:SetMemberPlayerLocationFromGuid(guid);
rosterEntry:SetMemberName(name);
rosterEntry:SetMemberIsOwner(owner);
rosterEntry:SetMemberIsModerator(moderator);
rosterEntry:SetVoiceEnabled(false);
rosterEntry:SetIsConnected(C_PlayerInfo.IsConnected(rosterEntry:GetMemberPlayerLocation()));
if voiceChannelID then
local voiceMemberID = C_VoiceChat.GetMemberID(voiceChannelID, guid);
......@@ -193,16 +199,12 @@ do
rosterEntry:SetVoiceMemberID(voiceMemberID);
rosterEntry:SetVoiceActive(voiceMemberInfo.isActive);
rosterEntry:SetVoiceMuted(voiceMemberInfo.isMutedForMe);
rosterEntry:SetIsConnected(C_VoiceChat.IsMemberConnected(voiceMemberID, voiceChannelID));
else
rosterEntry:SetIsConnected(false);
end
else
rosterEntry:SetVoiceChannelID(nil);
rosterEntry:SetVoiceMemberID(nil);
rosterEntry:SetVoiceActive(nil);
rosterEntry:SetVoiceMuted(nil);
rosterEntry:SetIsConnected(true);
end
rosterEntry:Update();
......@@ -241,7 +243,7 @@ do
rosterEntry:SetVoiceEnabled(true);
rosterEntry:SetVoiceActive(member.isActive);
rosterEntry:SetVoiceMuted(member.isMutedForMe);
rosterEntry:SetIsConnected(C_VoiceChat.IsMemberConnected(member.memberID, voiceChannelID));
rosterEntry:SetIsConnected(C_PlayerInfo.IsConnected(rosterEntry:GetMemberPlayerLocation()));
rosterEntry:Update();
end
......
......@@ -274,10 +274,11 @@ function ChannelRosterButtonMixin:UpdateName()
local r, g, b;
if not self:IsConnected() then
-- Check for false here, because nil indicates we don't know if they are online
if self:IsConnected() == false then
r, g, b = DISABLED_FONT_COLOR:GetRGB();
elseif self.playerLocation then
local _, class= UnitClassByPlayerLocation(self.playerLocation);
local _, class = C_PlayerInfo.GetClass(self.playerLocation)
if class then
r, g, b = GetClassColor(class);
end
......
......@@ -59,6 +59,8 @@ local voiceChatStatusToGameError =
[Enum.VoiceChatStatusCode.ProxyConnectionTimeOut] = LE_GAME_ERR_VOICE_CHAT_SERVICE_LOST,
[Enum.VoiceChatStatusCode.ProxyConnectionUnexpectedDisconnect] = LE_GAME_ERR_VOICE_CHAT_SERVICE_LOST,
[Enum.VoiceChatStatusCode.PlayerSilenced] = LE_GAME_ERR_VOICE_CHAT_PLAYER_SILENCED,
[Enum.VoiceChatStatusCode.PlayerVoiceChatParentalDisabled] = LE_GAME_ERR_VOICE_CHAT_PARENTAL_DISABLE_ALL,
[Enum.VoiceChatStatusCode.Disabled] = LE_GAME_ERR_VOICE_CHAT_DISABLED,
};
function Voice_GetGameErrorFromStatusCode(statusCode)
......@@ -80,6 +82,21 @@ function Voice_GetGameErrorStringFromStatusCode(statusCode)
end
end
local SUPPRESS_ALERT_MESSAGE = true;
local voiceChatStatusAlertBlacklist =
{
[Enum.VoiceChatStatusCode.PlayerVoiceChatParentalDisabled] = SUPPRESS_ALERT_MESSAGE,
[Enum.VoiceChatStatusCode.Disabled] = SUPPRESS_ALERT_MESSAGE,
};
function Voice_GetGameAlertStringFromStatusCode(statusCode)
if voiceChatStatusAlertBlacklist[statusCode] == SUPPRESS_ALERT_MESSAGE then
return nil;
end
return Voice_GetGameErrorStringFromStatusCode(statusCode);
end
local partyCategoryToChannelType =
{
[LE_PARTY_CATEGORY_HOME] = Enum.ChatChannelType.Private_Party;
......@@ -98,4 +115,4 @@ end
function IsPublicVoiceChannel(channel)
return channel and channel.channelType == Enum.ChatChannelType.Public_Party;
end
\ No newline at end of file
end
......@@ -27,3 +27,4 @@ GuildInfo.xml
GuildNews.xml
GuildRoster.xml
CommunitiesFrame.xml
Localization.lua
\ No newline at end of file
......@@ -8,6 +8,7 @@ local COMMUNITIES_CHAT_FRAME_EVENTS = {
"CLUB_MESSAGE_UPDATED",
"CLUB_MESSAGE_HISTORY_RECEIVED",
"CLUB_UPDATED",
"CLUB_STREAM_SUBSCRIBED",
};
function GetCommunitiesChatPermissionOptions()
......@@ -94,6 +95,12 @@ function CommunitiesChatMixin:OnEvent(event, ...)
if clubId == self:GetCommunitiesFrame():GetSelectedClubId() then
self:AddBroadcastMessage(clubId);
end
elseif event == "CLUB_STREAM_SUBSCRIBED" then
local clubId, streamId = ...;
local communitiesFrame = self:GetCommunitiesFrame();
if clubId == communitiesFrame:GetSelectedClubId() and streamId == communitiesFrame:GetSelectedStreamId() then
self:RequestInitialMessages(clubId, streamId);
end
end
end
......@@ -135,15 +142,25 @@ function CommunitiesChatMixin:GetMessagesToDisplay()
return C_Club.GetMessagesBefore(clubId, streamId, newestMessageId, MAX_NUM_CHAT_LINES_PER_REQUEST);
end
function CommunitiesChatMixin:HasAllMessages()
return self.messageRangeOldest and self.messageRangeOldest.epoch == 0;
function CommunitiesChatMixin:HasAllMessages(clubId, streamId)
return self.messageRangeOldest and C_Club.IsBeginningOfStream(clubId, streamId, self.messageRangeOldest);
end
function CommunitiesChatMixin:RequestMoreHistory()
if self.requestedMoreHistory or self:HasAllMessages() then
return;
local function RangeIsEmpty(range)
return range.newestMessageId.epoch < range.oldestMessageId.epoch or (range.newestMessageId.epoch == range.oldestMessageId.epoch and range.newestMessageId.position < range.oldestMessageId.position);
end
function CommunitiesChatMixin:RequestInitialMessages(clubId, streamId)
local ranges = C_Club.GetMessageRanges(clubId, streamId);
if (not ranges or #ranges == 0 or RangeIsEmpty(ranges[#ranges])) then
C_Club.RequestMoreMessagesBefore(clubId, streamId, nil);
self.requestedMoreHistory = true;
else
self.requestedMoreHistory = false;
end
end
function CommunitiesChatMixin:RequestMoreHistory()
local communitiesFrame = self:GetCommunitiesFrame();
local clubId = communitiesFrame:GetSelectedClubId();
local streamId = communitiesFrame:GetSelectedStreamId();
......@@ -151,6 +168,10 @@ function CommunitiesChatMixin:RequestMoreHistory()
return;
end
if self.requestedMoreHistory or self:HasAllMessages(clubId, streamId) then
return;
end
local hasMessages = C_Club.RequestMoreMessagesBefore(clubId, streamId, self.messageRangeOldest, MAX_NUM_CHAT_LINES_PER_REQUEST);
if hasMessages then
self:BackfillMessages(MAX_NUM_CHAT_LINES_PER_REQUEST);
......@@ -159,6 +180,10 @@ function CommunitiesChatMixin:RequestMoreHistory()
end
end
local function MessageIsEqual(messageId, compareMessageId)
return messageId.epoch == compareMessageId.epoch and messageId.position == messageId.position;
end
function CommunitiesChatMixin:BackfillMessages(maxCount)
local clubId = self:GetCommunitiesFrame():GetSelectedClubId();
local streamId = self:GetCommunitiesFrame():GetSelectedStreamId();
......@@ -171,7 +196,8 @@ function CommunitiesChatMixin:BackfillMessages(maxCount)
return;
end
for index = #messages, 1, -1 do
local lastIndex = #messages - (MessageIsEqual(messages[#messages].messageId, self.messageRangeOldest) and 1 or 0);
for index = lastIndex, 1, -1 do
local message = messages[index];
self:AddMessage(clubId, streamId, message, true);
end
......
......@@ -55,6 +55,8 @@ local errorStrings =
[Enum.ClubErrorType.ErrorCommunitiesUnknownTicket] = "ERROR_COMMUNITIES_UNKNOWN_TICKET",
[Enum.ClubErrorType.ErrorCommunitiesMissingShortName] = "ERROR_COMMUNITIES_MISSING_SHORT_NAME",
[Enum.ClubErrorType.ErrorCommunitiesProfanity] = "ERROR_COMMUNITIES_PROFANITY",
[Enum.ClubErrorType.ErrorCommunitiesTrial] = "ERROR_COMMUNITIES_TRIAL",
[Enum.ClubErrorType.ErrorCommunitiesVeteranTrial] = "ERROR_COMMUNITIES_VETERAN_TRIAL",
[Enum.ClubErrorType.ErrorClubFull] = "ERROR_CLUB_FULL",
[Enum.ClubErrorType.ErrorClubNoClub] = "ERROR_CLUB_NO_CLUB",
[Enum.ClubErrorType.ErrorClubNotMember] = "ERROR_CLUB_NOT_MEMBER",
......
......@@ -15,7 +15,6 @@ local COMMUNITIES_FRAME_EVENTS = {
"CLUB_STREAMS_LOADED",
"CLUB_STREAM_ADDED",
"CLUB_STREAM_REMOVED",
"CLUB_STREAM_SUBSCRIBED",
"CLUB_ADDED",
"CLUB_REMOVED",
"CLUB_SELF_MEMBER_ROLE_UPDATED",
......@@ -37,17 +36,6 @@ local COMMUNITIES_STATIC_POPUPS = {
"CONFIRM_LEAVE_COMMUNITY",
};
local function RangeIsEmpty(range)
return range.newestMessageId.epoch < range.oldestMessageId.epoch or (range.newestMessageId.epoch == range.oldestMessageId.epoch and range.newestMessageId.position < range.oldestMessageId.position);
end
local function RequestInitialMessages(clubId, streamId)
local ranges = C_Club.GetMessageRanges(clubId, streamId);
if (not ranges or #ranges == 0 or RangeIsEmpty(ranges[#ranges])) then
C_Club.RequestMoreMessagesBefore(clubId, streamId, nil);
end
end
function CommunitiesFrameMixin:OnLoad()
CallbackRegistryBaseMixin.OnLoad(self);
......@@ -121,11 +109,6 @@ function CommunitiesFrameMixin:OnEvent(event, ...)
self:UpdateStreamDropDown();
end
end
elseif event == "CLUB_STREAM_SUBSCRIBED" then
local clubId, streamId = ...;
if clubId == self:GetSelectedClubId() and streamId == self:GetSelectedStreamId() then
RequestInitialMessages(clubId, streamId);
end
elseif event == "CLUB_ADDED" then
local clubId = ...;
self:AddNewClubId(clubId);
......@@ -480,6 +463,7 @@ function CommunitiesFrameMixin:OnClubSelected(clubId)
self:SelectStream(clubId, selectedStream.streamId);
else
local streams = C_Club.GetStreams(clubId);
CommunitiesUtil.SortStreams(streams);
if #streams >= 1 then
self:SelectStream(clubId, streams[1].streamId);
else
......@@ -594,7 +578,7 @@ function CommunitiesFrameMixin:SelectStream(clubId, streamId)
self:SetFocusedStream(clubId, streamId);
C_Club.SetAutoAdvanceStreamViewMarker(clubId, streamId);
if C_Club.IsSubscribedToStream(clubId, streamId) then
RequestInitialMessages(clubId, streamId);
self.Chat:RequestInitialMessages(clubId, streamId);
end
self:TriggerEvent(CommunitiesFrameMixin.Event.StreamSelected, streamId);
......
......@@ -27,9 +27,7 @@ function CommunitiesStreamDropDownMenu_Initialize(self)
end
local streams = C_Club.GetStreams(clubId);
if not streams then
return;
end
CommunitiesUtil.SortStreams(streams);
local streamToNotificationSetting = CommunitiesUtil.GetStreamNotificationSettingsLookup(clubId);
local canEditStream = self:GetCommunitiesFrame():GetPrivilegesForClub(clubId).canDestroyStream;
......@@ -225,6 +223,7 @@ function CommunitiesNotificationSettingsDialogMixin:Refresh()
local scrollHeight = 105;
local streams = C_Club.GetStreams(clubId);