now with pcall and working

git [04-07-18 - 16:31]
now with pcall and working
Filename
DailyAutoShare/DasGuiStringBuilder.lua
DailyAutoShare/startup.lua
diff --git a/DailyAutoShare/DasGuiStringBuilder.lua b/DailyAutoShare/DasGuiStringBuilder.lua
index ca1ee18..95ef78a 100644
--- a/DailyAutoShare/DasGuiStringBuilder.lua
+++ b/DailyAutoShare/DasGuiStringBuilder.lua
@@ -22,8 +22,8 @@ function refreshQuestLogs(forceOverride)
 	DAS.QuestIndexTable		= {}
 	DAS.QuestNameTable		= {}

-	for i=1, GetNumJournalQuests() do
-		if IsValidQuestIndex(i) then
+	for i=1, 25 do
+		if IsValidQuestIndex(i) then
 			journalQuestName, _, _, _, _, _, tracked = GetJournalQuestInfo(i)
 			journalQuestName = zo_strformat(journalQuestName)
 			DAS.QuestIndexTable[i] = journalQuestName
diff --git a/DailyAutoShare/startup.lua b/DailyAutoShare/startup.lua
index 099a84c..712d4d3 100644
--- a/DailyAutoShare/startup.lua
+++ b/DailyAutoShare/startup.lua
@@ -180,8 +180,7 @@ local function OnQuestShared(eventCode, questId)
     end
 end

-local function onGroupMessage(messageText)
-
+local function onGroupMessage(messageText)
     if 	string.find(messageText, "share") or
         string.find(messageText, "quest") then
         DAS.TryShareActiveDaily()
@@ -195,22 +194,24 @@ local function OnChatMessage(eventCode, channelType, fromName, messageText, _, f

         -- react to the group asking for shares
 	if (channelType == CHAT_CHANNEL_PARTY) then
-		return pcall(onGroupMessage(messageText))
+		return pcall(onGroupMessage, messageText)
 	end

-    local status, result = pcall(messageText:find("%+"))
-    if status or not result then return end
+    local status, result = pcall(string.find, messageText, "%+")
+    if not result then return end

     local bingoCode = string.match(messageText, "%+%s?(%S+)")
     if not bingoCode then return end

+    local isPlayerMessage = cachedDisplayName:find(fromDisplayName)
     -- we're not listening in the chat channel.
-    if not channelTypes[channelType] and cachedDisplayName:find(fromDisplayName) then
+    if not channelTypes[channelType] and isPlayerMessage then
        if IsUnitGrouped('player') then
             if DAS.GetGroupLeaveOnNewSearch() then return GroupLeave() end
         else
             DAS.TryTriggerAutoAcceptInvite()
         end
+    else if isPlayerMessage then return
     end

     if not DAS.autoInviting then return end
@@ -265,6 +266,7 @@ local function OnPlayerActivated(eventCode)
 	local active 		= DAS.GetActiveIn()
 	DAS.SetHidden(not active)
     DAS.autoInviting    = DAS.GetAutoInvite()
+    DAS.SetChatListenerStatus(DAS.autoInviting)
 	DAS.RefreshControl(true)
     DAS.guildInviteText = DAS.GetGuildInviteText()
 end
@@ -365,7 +367,7 @@ function DailyAutoShare_Initialize(eventCode, addonName)

 	DailyAutoShare.CreateMenu(DailyAutoShare.settings, defaults)
 	DAS.CreateGui()
-
+    OnPlayerActivated()
 	EVENT_MANAGER:UnregisterForEvent("DailyAutoShare", EVENT_ADD_ON_LOADED)

 end