something.3.4 fixed wrong bingo codes and overeager autoinvite

git [06-05-18 - 17:48]
something.3.4 fixed wrong bingo codes and overeager autoinvite
Filename
00_startup.lua
DASData.lua
DailyAutoShare.txt
DasChatMessage.lua
DasGui.lua
DasGuiStringBuilder.lua
locale/en.lua
questData/Summerset.lua
diff --git a/00_startup.lua b/00_startup.lua
index dea8691..4816325 100644
--- a/00_startup.lua
+++ b/00_startup.lua
@@ -2,7 +2,7 @@ DailyAutoShare              = DailyAutoShare or {}
 DAS                         = DailyAutoShare

 DAS.name                    = "DailyAutoShare"
-DAS.version                 = "3.3.3"
+DAS.version                 = "3.3.4"
 DAS.author                  = "manavortex"
 DAS.settings                = {}
 DAS.globalSettings          = {}
@@ -16,6 +16,7 @@ DAS.activeZoneQuests        = {}
 DAS.questFinisher           = {}
 DAS.questStarter            = {}
 DAS.questIds                = {}
+DAS.activeBingoIndices      = {}
 DAS.channelTypes 	        = {
     [CHAT_CHANNEL_PARTY]    = true,
     [CHAT_CHANNEL_SAY ]     = false,
@@ -267,7 +268,8 @@ local function OnQuestAdded(eventCode, journalIndex, questName, objectiveName)
 	if not DAS.GetActiveIn(zoneId) 			then return end
 	if not GetIsQuestSharable(journalIndex) then return end
 	local shareables = DAS.shareables[zoneId] or {}
-
+    local bingoIndex = DAS.getBingoIndexFromQuestName(questName) or 0
+    DAS.activeBingoIndices[bingoIndex] = true
 	if nil ~= shareables[questName] then
 		DAS.LogQuest(questName, false)
 		zo_callLater(forceRefreshControl, 700)
@@ -275,11 +277,12 @@ local function OnQuestAdded(eventCode, journalIndex, questName, objectiveName)
 end

 local function OnQuestShared(eventCode, questId)
+    local questName =  GetOfferedQuestShareInfo(questId)
     p(zo_strformat("<<1>> \t <<2>>", questId, questName))
-	if not allDailyQuestIds[questId] then return end
-	local zoneQuests = DAS.questIds[DAS.GetZoneId()] or {}
+	local zoneQuestIds = DAS.questIds[DAS.GetZoneId()] or {}
+	if not (zoneQuestIds[questName] or DAS_QUEST_IDS[questId]) and DAS.GetActiveIn(zoneId) then return end

-	if zoneQuests[questId] then
+	if zoneQuestIds[questId] then
         if DAS.GetAutoDeclineShared() then
             DAS.Report("DailyAutoShare declined a quest for you. Type /DailyAutoShare disabledecline to stop it from doing so.")
             DeclineSharedQuest(questId)
@@ -327,6 +330,9 @@ local function OnQuestRemoved(eventCode, isCompleted, journalIndex, questName, z
 	local autoInvite = DAS.GetAutoInvite()
     DAS.SetAutoInvite(false)

+    local bingoIndex = DAS.getBingoIndexFromQuestName(questName) or 0
+    DAS.activeBingoIndices[bingoIndex] = false
+
     zo_callLater(function()
         DAS.SetAutoInvite(autoInvite)
         forceRefreshControl()
diff --git a/DASData.lua b/DASData.lua
index 383cf0b..73838b4 100644
--- a/DASData.lua
+++ b/DASData.lua
@@ -50,7 +50,8 @@ end
 function DAS.RefreshFullBingoString()
     local ret = ""
     for _, questName in ipairs(DAS.GetActiveQuestNames()) do
-        ret = ret .. DAS.GetBingoStringFromQuestName(questName) .. " "
+        local bingoString = DAS.GetBingoStringFromQuestName(questName)
+        ret = ret .. bingoString .. " "
     end
     if (#ret > 0) then
         ret = ret .. "+any"
@@ -100,7 +101,7 @@ function DAS.GetBingoStringFromQuestName(questName)
 		if (string.find(ret, "%+%+"))  then ret.gsub("%+%+", "%+") end
 	end

-	return ret
+	return ret, index

 end

@@ -115,12 +116,14 @@ function DAS.GetQuestNameFromBingoString(bingoString)
 end

 function DAS.GetActiveQuestNames()
+    DAS.activeBingoIndices = {}
 	local ret = {}
 	local questLabel
 	for i=1, #DAS.labels do
 		questLabel = DAS.labels[i]
 		if not questLabel:IsHidden() and (questLabel.dataQuestState == DAS_STATUS_ACTIVE) or (questLabel.dataQuestState == DAS_STATUS_TRACKED) then
 			table.insert(ret, questLabel.dataQuestName)
+            DAS.activeBingoIndices[questLabel.dataBingoIndex] = true
 		end
 	end
 	return ret
diff --git a/DailyAutoShare.txt b/DailyAutoShare.txt
index fd82263..2c70f13 100644
--- a/DailyAutoShare.txt
+++ b/DailyAutoShare.txt
@@ -1,6 +1,6 @@
 ## Title: DailyAutoShare
 ## Author: manavortex
-## Version: 3.3.3
+## Version: 3.3.4
 ## APIVersion: 100023
 ## SavedVariables: DAS_Settings DAS_Globals
 ## OptionalDependsOn: LibStub LibCustomMenu LibAddonMenu-2.0 LibMediaProvider-1.0 pchat
diff --git a/DasChatMessage.lua b/DasChatMessage.lua
index 273c7f3..5c58f5f 100644
--- a/DasChatMessage.lua
+++ b/DasChatMessage.lua
@@ -26,6 +26,16 @@ function table.contains(tbl, element)
   return false
 end

+local function hasBingoQuestActive(bingoIndex)
+    if not bingoIndex then return end
+    local activeQuests = DAS.activeZoneQuests or {}
+    for _, value in pairs(activeQuests) do
+        if value == bingoIndex then return true end
+    end
+    return false
+
+end
+
 local channelTypes = DAS.channelTypes
 local stringPlus = "+"
 local stringAny = "+any"
@@ -39,7 +49,7 @@ local function HandleChatMessage(messageText, fromDisplayName, calledRecursively
     local _, bingoCode = pcall(string.match, messageText, "[%+/]+%s*(%w+)%s?[%+/]?")
     if not found and not bingoCode then return end
     local bingoIndex = DAS.bingo[DAS.GetZoneId()][bingoCode]
-    found = found or (nil ~= bingoIndex and DAS.activeZoneQuests[bingoIndex])
+    found = found or DAS.activeBingoIndices[bingoIndex]

     if not found then return HandleChatMessage(messageText:gsub(bingoCode, ""), fromDisplayName, true) end
     if found and not table.contains(inviteQueue, fromDisplayName) then
diff --git a/DasGui.lua b/DasGui.lua
index fb54248..f9e56cf 100644
--- a/DasGui.lua
+++ b/DasGui.lua
@@ -220,7 +220,9 @@ function DAS.SetSubLabels(questTable)
         local label = DAS.sublabels[idx]

         label.dataJournalIndex 	= DAS.GetLogIndex(questName)
-        label.dataBingoString 	= DAS.GetBingoStringFromQuestName(questName)
+        local bingoString, bingoIndex = DAS.GetBingoStringFromQuestName(questName)
+        label.dataBingoString 	= bingoString
+        label.dataBingoIndex 	= bingoIndex
         label.dataQuestName		= questName
         label.dataTitle         = questName
         label.dataQuestState    = DAS.GetQuestStatus(questName)
@@ -282,7 +284,9 @@ function DAS.setLabels(zoneQuests)
                 -- d(zo_strformat("DAS: <<1>> state <<2>>", label.dataQuestName, label.dataQuestState))
                 label:SetHidden(hideLabel)
                 label.dataJournalIndex 	= DAS.GetLogIndex(label.dataQuestName)
-                label.dataBingoString 	= DAS.GetBingoStringFromQuestName(label.dataQuestName)
+                bingoString, bingoIndex = DAS.GetBingoStringFromQuestName(label.dataQuestName)
+                label.dataBingoString 	= bingoString
+                label.dataBingoIndex 	= bingoIndex
                 label.dataTitle         = label.dataTitle or ""

                 if label.dataQuestState == DAS_STATUS_ACTIVE then
diff --git a/DasGuiStringBuilder.lua b/DasGuiStringBuilder.lua
index 69f813c..bb980ac 100644
--- a/DasGuiStringBuilder.lua
+++ b/DasGuiStringBuilder.lua
@@ -102,7 +102,8 @@ local function GenerateBingoString(activeQuestNames, verbose)
         end
         return zo_strformat(qsString, questNames, bingoString)
     end
-
+	if #bingoString > 0 then return bingoString end
+
     if NonContiguousCount(DAS.GetShareableLog()) == 0 and #activeQuestNames == 0 then
         return any
     end
@@ -124,7 +125,7 @@ local function SpamChat(verbose, questName)
 	end
 	if #activeQuestNames == 0 then
 		DAS.SetAutoInvite(false)
-	end
+	end
 	StartChatInput(DAS.GenerateBingoString(activeQuestNames, verbose), CHAT_CHANNEL_ZONE)

 end
diff --git a/locale/en.lua b/locale/en.lua
index 5a7603f..4761afb 100644
--- a/locale/en.lua
+++ b/locale/en.lua
@@ -45,6 +45,7 @@ local strings  = {
     DAS_ELF_SNAKE           = "Run Aground",
     DAS_ELF_WILD            = "Taming the Wild",

+    DAS_ELF_GEYSER          = "Sinking Summerset",


 	-- Clockwork City
@@ -206,6 +207,7 @@ local strings  = {

     DAS_QUEST_SS_TANO       = "Justiciar Tanorian",
     DAS_QUEST_SS_FARO       = "Justiciar Farowel",
+    DAS_QUEST_SS_TANE       = "Battlereeve Tanerline",

     DAS_QUEST_CRY_BATTLE    = "Battle Mission Board",
     DAS_QUEST_CRY_BOUNTY    = "Bounty Mission Board",
diff --git a/questData/Summerset.lua b/questData/Summerset.lua
index 92c91a3..b7d3267 100644
--- a/questData/Summerset.lua
+++ b/questData/Summerset.lua
@@ -34,6 +34,9 @@ table.insert(tbl2, {[1] = "memory"})
 table.insert(tbl, GetString(DAS_ELF_ROSE ))
 table.insert(tbl2, {[1] = "rose"})

+table.insert(tbl, GetString(DAS_ELF_GEYSER ))
+table.insert(tbl2, {[1] = "+geyser"})
+

 DAS.shareables[zoneId] = tbl
 DAS.shareables[zoneId2] = DAS.shareables[zoneId]
@@ -53,14 +56,26 @@ end
 DAS.questStarter[zoneId] = {
     [GetString(DAS_QUEST_SS_TANO)]    = true,
     [GetString(DAS_QUEST_SS_FARO)]    = true,
+    [GetString(DAS_QUEST_SS_TANE)]    = true,
 }

 DAS.questFinisher[zoneId] = {
     [GetString(DAS_QUEST_SS_TANO)]    = true,
     [GetString(DAS_QUEST_SS_FARO)]    = true,
+    [GetString(DAS_QUEST_SS_TANE)]    = true,
 }

-
 DAS.questIds[zoneId] = {
-    [5733]  = true, -- Ancient Armaments in Bangkorai
-}
\ No newline at end of file
+
+}
+for i=6082, 6087 do
+    DAS.questIds[zoneId][i] = true
+    DAS_QUEST_IDS[i] = true
+end
+for i=6152, 6160 do
+    DAS.questIds[zoneId][i] = true
+    DAS_QUEST_IDS[i] = true
+end
+
+DAS.questIds[zoneId][6202] = true
+DAS_QUEST_IDS[6202] = true
\ No newline at end of file