Commit fbf77a6b authored by Simpy's avatar Simpy 🐹

use Resike's method here, its like the code previously except this will only...

use Resike's method here, its like the code previously except this will only send message if someone joins! Thanks Resike :D
parent 27cc781b
......@@ -178,12 +178,12 @@ function lib:VersionCheck(event, prefix, message, channel, sender)
E.SendPluginVersionCheck = SendPluginVersionCheck
end
local numMembers = GetNumGroupMembers()
if numMembers == 0 and lib.numMembers then
lib.numMembers = nil -- clear this after we leave the group
elseif numMembers > 1 and lib.numMembers ~= numMembers then
E["ElvUIPluginSendMSGTimer"] = E:ScheduleTimer("SendPluginVersionCheck", 12)
lib.numMembers = numMembers
local num = GetNumGroupMembers()
if num ~= lib.groupSize then
if num > 1 and lib.groupSize and num > lib.groupSize then
E["ElvUIPluginSendMSGTimer"] = E:ScheduleTimer("SendPluginVersionCheck", 12)
end
lib.groupSize = num
end
end
end
......
......@@ -907,7 +907,7 @@ function E:SendMessage()
end
end
local rosterNumMembers
local SendRecieveGroupSize
local myRealm = gsub(E.myrealm,'[%s%-]','')
local myName = E.myname..'-'..myRealm
local function SendRecieve(_, event, prefix, message, _, sender)
......@@ -926,12 +926,12 @@ local function SendRecieve(_, event, prefix, message, _, sender)
end
end
else
local numMembers = GetNumGroupMembers()
if numMembers == 0 and rosterNumMembers then
rosterNumMembers = nil -- clear this after we leave the group
elseif numMembers > 1 and rosterNumMembers ~= numMembers then
E.SendMSGTimer = E:ScheduleTimer('SendMessage', 12)
rosterNumMembers = numMembers
local num = GetNumGroupMembers()
if num ~= SendRecieveGroupSize then
if num > 1 and SendRecieveGroupSize and num > SendRecieveGroupSize then
E.SendMSGTimer = E:ScheduleTimer('SendMessage', 12)
end
SendRecieveGroupSize = num
end
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment