1.8.7a: Oqueue grabbing channel 1 - potential fix

As for the addon using channel 1 for the data channel and the issues preventing it from doing that. E.g (It's fixed, wait, no its not -repeat- )

This should fix it.

--put this on line 19
function oq_getlastchannel()
    if(DEFAULT_CHAT_FRAME:GetID()) then
        local chatchannels = { GetChatWindowChannels(DEFAULT_CHAT_FRAME:GetID()) }

        if (#chatchannels ~= 0) then
            local numchannels = (#chatchannels / 2)
            if (numchannels >= 1) then
                OQ_LASTCHANNEL = numchannels + 1
            else
                OQ_LASTCHANNEL = 1
            end
        else
            OQ_LASTCHANNEL = 1
        end
    end
end

--init with 1 as global to be modified for passing through functions
OQ_LASTCHANNEL = 1
--48
local OQ_REALM_CHANNEL         =  OQ_LASTCHANNEL;
    
--2632
function oq.join_oq_general()
  if (oq._banned) or (OQ_data.auto_join_oqgeneral == 0) or (oq._inside_instance) or (oq._oqgeneral_initialized == nil) then
    return ;
  end
  oq_getlastchannel()
  oq.channel_join( OQ_LASTCHANNEL ) ;
end

function oq.oqgeneral_join()
  if (oq._banned) or (OQ_data.auto_join_oqgeneral == 0) or (oq._inside_instance) or (oq._oqgeneral_initialized == nil) then
    return ;
  end
  oq_getlastchannel()
  oq.channel_join( OQ_LASTCHANNEL ) ;
  oq.timer( "hook_roster_update"   ,  5, oq.hook_roster_update      , true, OQ_LASTCHANNEL ) ; -- will repeat until channel joined
  oq.timer( "chk_OQGeneralLockdown", 30, oq.check_oqgeneral_lockdown, true ) ; -- will check capacity every 30 seconds
end

--2659
function oq.channel_general( msg )
  if (_oqgeneral_lockdown) then
    return ; -- too many ppl in oqgeneral, voluntary mute engaged
  end
  oq_getlastchannel()
  oq.channel_say(   OQ_LASTCHANNEL, msg ) ;
end

 
i may have missed some OQ_REALMCHANNEL (s) somewhere in the file, but if you do a replace all with OQ_LASTCHANNEL, that should fix that

edit: i was tired and this and the above is wrong, below should be right though
--put this on line 19
function oq_getlastchannel()
    if(DEFAULT_CHAT_FRAME:GetID()) then
        local chatchannels = { GetChatWindowChannels(DEFAULT_CHAT_FRAME:GetID()) }

        if (#chatchannels ~= 0) then
            local numchannels = (#chatchannels / 2)
            if (numchannels >= 1) then
                OQ_LASTCHANNEL = numchannels + 1
            else
                OQ_LASTCHANNEL = 1
            end
        else
            OQ_LASTCHANNEL = 1
        end
    end
end

--init with 1 as global to be modified for passing through functions
OQ_LASTCHANNEL = 1
--48
local OQ_REALM_CHANNEL         =  "oqchannel";
    
--2632
function oq.join_oq_general()
  if (oq._banned) or (OQ_data.auto_join_oqgeneral == 0) or (oq._inside_instance) or (oq._oqgeneral_initialized == nil) then
    return ;
  end
  oq_getlastchannel()
  if (OQ_LASTCHANNEL >= 2) then
    oq.channel_join( OQ_REALMCHANNEL ) ;
  end
end

function oq.oqgeneral_join()
  if (oq._banned) or (OQ_data.auto_join_oqgeneral == 0) or (oq._inside_instance) or (oq._oqgeneral_initialized == nil) then
    return ;
  end
  oq_getlastchannel()
  if (OQ_LASTCHANNEL >= 2) then
      oq.channel_join( OQ_REALMCHANNEL ) ;
      oq.timer( "hook_roster_update"   ,  5, oq.hook_roster_update      , true, OQ_REALMCHANNEL ) ; -- will repeat until channel joined
      oq.timer( "chk_OQGeneralLockdown", 30, oq.check_oqgeneral_lockdown, true ) ; -- will check capacity every 30 seconds
  end
end

--2659
function oq.channel_general( msg )
  if (_oqgeneral_lockdown) then
    return ; -- too many ppl in oqgeneral, voluntary mute engaged
  end
  oq_getlastchannel()
  if (OQ_LASTCHANNEL >= 2) then
    oq.channel_say(   OQ_REALMCHANNEL, msg ) ;
  end
end

 
corrected an oversight i made when i was tired. basically all this does is check to see how many channels are currently available and it should wait until the other default channels are in place before adding the oqchannel. this way should allow you to remove the in bg, in instance, etc constraints also
another edit to the oq_getlastchannel function. this actually checks to see if the channel is present and if its the last channel or not

http://pastebin.com/Q2stHHFz
thx woozles but i haven't spent the time needed to dig into this at the moment.

i'll try to get to it this week (icebox & waffles are screamin at me at this point)
lol aye sir
Log in to leave a reply.