Skip to content

Commit

Permalink
Fixed AutoInvite.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wetxius committed Mar 23, 2016
1 parent 7362ece commit cccc27f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ShestakUI/Modules/Automation/AutoInvite.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ if C.automation.accept_invite == true then
end
end
for i = 1, select(2, BNGetNumFriends()) do
local presenceID, _, _, _, _, _, client, isOnline = BNGetFriendInfo(i)
local presenceID, _, _, _, _, toonID, client, isOnline = BNGetFriendInfo(i)
if client == BNET_CLIENT_WOW and isOnline then
local _, toonName, _, realmName = BNGetGameAccountInfo(presenceID)
local _, toonName, _, realmName = BNGetGameAccountInfo(toonID or presenceID)
if name == toonName or name == toonName.."-"..realmName then
return true
end
Expand Down Expand Up @@ -61,12 +61,13 @@ local autoinvite = CreateFrame("Frame")
autoinvite:RegisterEvent("CHAT_MSG_WHISPER")
autoinvite:RegisterEvent("CHAT_MSG_BN_WHISPER")
autoinvite:SetScript("OnEvent", function(self, event, arg1, arg2, ...)
if ((not UnitExists("party1") or UnitIsGroupLeader("player") or UnitIsGroupAssistant("player")) and arg1:lower():match(C.misc.invite_keyword)) and SavedOptionsPerChar.AutoInvite == true then
if ((not UnitExists("party1") or UnitIsGroupLeader("player") or UnitIsGroupAssistant("player")) and arg1:lower():match(C.misc.invite_keyword)) and SavedOptionsPerChar.AutoInvite == true and not QueueStatusMinimapButton:IsShown() then
if event == "CHAT_MSG_WHISPER" then
InviteUnit(arg2)
elseif event == "CHAT_MSG_BN_WHISPER" then
local _, toonName, _, realmName = BNGetGameAccountInfo(select(11, ...))
InviteUnit(toonName.."-"..realmName)
local bnetIDAccount = select(11, ...)
local bnetIDGameAccount = select(6, BNGetFriendInfoByID(bnetIDAccount))
BNInviteFriend(bnetIDGameAccount)
end
end
end)
Expand Down

0 comments on commit cccc27f

Please sign in to comment.