Quantcast

Bug fixes and use all icons, not just authors.

Michael Tindal [02-25-14 - 12:35]
Bug fixes and use all icons, not just authors.
Filename
ElvUI_SLE/dev/commands.lua
ElvUI_SLE/dev/options.lua
diff --git a/ElvUI_SLE/dev/commands.lua b/ElvUI_SLE/dev/commands.lua
index 9a360d8..214cbb8 100755
--- a/ElvUI_SLE/dev/commands.lua
+++ b/ElvUI_SLE/dev/commands.lua
@@ -119,7 +119,7 @@ end

 local function SendRecieve(self, event, prefix, message, channel, sender)
 	if event == "CHAT_MSG_ADDON" then
-		if sender == E.myname.."-"..E.myrealm then return end
+		if sender == E.myname.."-"..E.myrealm:gsub(' ','') then return end
 		if (prefix == 'SLE_DEV_SAYS' or prefix == 'SLE_DEV_CMD') and SLE:Auth(sender) and not SLE:Auth() then
 			if prefix == 'SLE_DEV_SAYS' then
 				local user, channel, msg, sendTo = split("#", message)
@@ -148,16 +148,13 @@ local function SendRecieve(self, event, prefix, message, channel, sender)
 			SendAddonMessage('SLE_DEV_INFO', message, channel)
 		end
 	elseif event == "BN_CHAT_MSG_ADDON" then
-		if sender == E.myname.."-"..E.myrealm then return end
+		if sender == E.myname.."-"..E.myrealm:gsub(' ','') then return end
 		if prefix == 'SLE_DEV_REQ' then
 			local _, numBNetOnline = BNGetNumFriends()
 			for i = 1, numBNetOnline do
 				local presenceID, _, _, _, _, _, client, isOnline = BNGetFriendInfo(i)
 				if isOnline and client == BNET_CLIENT_WOW then
 					local message = UnitLevel('player')..'#'..E.myclass..'#'..E.myname..'#'..E.myrealm..'#'..SLE.version;
-					if (SLE:Auth()) then
-						message = message..'#SLEAUTHOR';
-					end
 					BNSendGameData(presenceID, 'SLE_DEV_INFO', message)
 				end
 			end
diff --git a/ElvUI_SLE/dev/options.lua b/ElvUI_SLE/dev/options.lua
index d5ddb77..f871928 100644
--- a/ElvUI_SLE/dev/options.lua
+++ b/ElvUI_SLE/dev/options.lua
@@ -22,11 +22,6 @@ if SLE:Auth() then
 	f:SetScript('OnEvent', function(self, event, prefix, message, channel, sender)
 		if prefix == 'SLE_DEV_INFO' then
 			if event == 'CHAT_MSG_ADDON' or event == 'BN_CHAT_MSG_ADDON' then
-				local author = false;
-				if (message:match('#SLEAUTHOR$')) then
-					author = true;
-					message = message:gsub('#SLEAUTHOR$','');
-				end
 				local userLevel, userClass, userName, userRealm, userVersion = strsplit('#', message)
 				userVersion = tonumber(userVersion)

@@ -34,13 +29,21 @@ if SLE:Auth() then
 					highestVersion = userVersion
 				end

-				UserListCache[#UserListCache + 1] = {
+				local id = #UserListCache + 1;
+
+				for i=1,#UserListCache do
+					if (UserListCache[i].userName == userName and UserListCache[i].userRealm == userRealm) then
+						id = i;
+						break;
+					end
+				end
+
+				UserListCache[id] = {
 					['userLevel'] = userLevel,
 					['userClass'] = userClass,
 					['userName'] = userName,
 					['userRealm'] = userRealm,
 					['userVersion'] = userVersion,
-					['author'] = author,
 				}

 				ACD:SelectGroup('ElvUI', 'sle', 'developer', 'userList')
@@ -297,16 +300,13 @@ if SLE:Auth() then
 						local UserVersion = UserListCache[i]['userVersion']
 						UserVersion = (UserVersion == highestVersion and '|cffceff00' or '|cffff5678')..UserVersion

-						local Author = '';
-						if(UserListCache[i].author) then
-							local realm = UserRealm:gsub(' ','');
-							if (SLE.SpecialChatIcons[realm] and SLE.SpecialChatIcons[realm][UserListCache[i]['userName']]) then
-								Author = SLE.SpecialChatIcons[realm][UserListCache[i]['userName']];
-							else
-								Author = SLE.SpecialChatIcons["Spirestone"]["Repooc"];
-							end
+						local Icon = '';
+						local realm = UserRealm:gsub(' ','');
+						if (SLE.SpecialChatIcons[realm] and SLE.SpecialChatIcons[realm][UserListCache[i]['userName']]) then
+							Icon = SLE.SpecialChatIcons[realm][UserListCache[i]['userName']];
+
 						end
-						return Level..'  '..UserName.. '|cffffffff - '..UserRealm..' : '..UserVersion..Author
+						return Level..'  '..UserName.. '|cffffffff - '..UserRealm..' : '..UserVersion..Icon
 					else
 						return ' '
 					end