+updateAuras = M.UpdateAuras;
+
+function M.UpdateMajorAuras(frame, unit)
+ for _, ind in pairs(frame.majors) do
+ hideInd(ind);
+ end
+ local icon, count, expires, id;
+ local showMajors, needUpdate = false, false;
+ local majorPos = 1;
+ local alert = false; -- color the whole bar
+ local current = GetTime();
+ local i = 1;
+ while true do
+ _, _, icon, count, _, _, expires, _, _, _, id = UnitAura(unit, i, "HARMFUL");
+ if not id or majorPos > 3 then break end
+ local major = majorAuras[id];
+ if major then
+ needUpdate = showInd(frame.majors[majorPos], expires, current, count, icon) or needUpdate;
+ if major.bar then alert = true end
+ showMajors = true;
+ majorPos = majorPos + 1;
+ end
+ i = i + 1;
+ end
+
+ if showMajors then
+ frame.majorBase:Show();
+ if needUpdate and not updating[frame] then
+ updating[frame] = true; -- race?
+ -- create a function for updating the indicator
+ local func = updaters[frame];
+ if not func then
+ func = function() updateIndicators(frame) end;
+ updaters[frame] = func;
+ end
+ CTimerAfter(0.20, func);
+ end
+ else
+ frame.majorBase:Hide();
+ end