Thread Tools Display Modes
06-09-09, 06:48 AM   #1
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Temporarily ignoring/blocking channels

During raid instances or sometimes when people start spamming I'd like to ignore/block a channel temporarily.

I know you can right click the general tab, go into settings and uncheck channels you don't want to see (this will not leave channels, which is what I want).

Doing so will remove the channel from the command GetChatWindowChannels(1) so I was hoping RemoveChatWindowChannel(1, "General") would have the same effect but it sadly doesn't. It removes it from the GetChatWindowChannels(1) list but it does not uncheck it under settings or filter it.

Any ideas or would I have to make a own chat filter to filter out the channels I want hidden?
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
06-09-09, 07:53 AM   #2
Robert1066
A Defias Bandit
Join Date: Dec 2006
Posts: 3
I'm definitely not a programmer of any sort, but can't you just make a macro that has /join "channel" and /leave "channel" ?

I'm pretty sure just typing in /leave 2 causes me to leave trade channel. Is this the type of thing you're looking for?


just my 2c .
  Reply With Quote
06-09-09, 08:05 AM   #3
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Thanks for trying to help Robert but the reason I do not wish to leave and join channels is that the channel numbers would change.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
06-09-09, 08:08 AM   #4
Petrah
A Pyroguard Emberseer
 
Petrah's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 2,988
You don't need channel numbers. /leave general /join general etcetera, work just fine.
__________________
♪~ ( ) I My Sonos!
AddOn Authors: If your addon spams the chat box with "Addon v8.3.4.5.3 now loaded!", please add an option to disable it!
  Reply With Quote
06-09-09, 08:56 AM   #5
Nafe
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 17
Originally Posted by Silenia View Post
You don't need channel numbers. /leave general /join general etcetera, work just fine.
I think what is meant by the following:
Originally Posted by Yourstruly View Post
the reason I do not wish to leave and join channels is that the channel numbers would change.
...is that by leaving and joining a channel later, the numbers (which many of us have engrained as habit to responding in a certain channel, such as /2 for Trade for the majority of players) would change.
This becomes especially true in the case where Addons use channels to communicate, and auto-join these channels, or with Blizzard's auto-rearrangement of "Default" (i.e. General, Trade, *Defense, Guild Recruiting, LFG) channel numbers that seems to occur, at least in my client.

EDIT:
If all else fails, I believe that you could write an addon to register/unregister the ChatFrames based on the event arguments of CHAT_MSG_CHANNEL:
http://www.wowwiki.com/Events/Communication

I remember seeing this in Baud Spam Filter once. Here's a code snippet from my local copy of BSF:

Code:
function BaudSpamFilterUpdateEnabled()
  local Frame;
  for Index = 1, NUM_CHAT_WINDOWS do
    Frame = getglobal("ChatFrame"..Index);
    if Config.Enabled then
      Frame:UnregisterEvent("CHAT_MSG_CHANNEL");
    else
      Frame:RegisterEvent("CHAT_MSG_CHANNEL");
    end
  end
end
Hope that helps!

Last edited by Nafe : 06-09-09 at 09:06 AM.
  Reply With Quote
06-09-09, 09:07 AM   #6
oomp
A Murloc Raider
 
oomp's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 7
I wrote a very simple addon (3 lines of code) to filter out all messages in General chat while in an instance for the very same reason as the OP. You can get it here: http://www.wowinterface.com/download...3765-Hush.html

Hope this helps.

Last edited by oomp : 06-09-09 at 09:15 AM.
  Reply With Quote
06-09-09, 09:35 AM   #7
Nafe
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 17
Originally Posted by oomp View Post
I wrote a very simple addon (3 lines of code) to filter out all messages in General chat while in an instance for the very same reason as the OP. You can get it here: http://www.wowinterface.com/download...3765-Hush.html

Hope this helps.
As long as you don't mind, Moop, I think that the addon code is really good to post here:
Code:
ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL" , function(_,_,_,_,_,_,_,_,id)
	if IsInInstance() and id == 1 then return true end
end)
I didn't realize that ChatFrame_AddMessageEventFilter(event, func) existed. This makes it insanely easy to filter out messages. Thanks for the enlightenment =)

Last edited by Nafe : 06-09-09 at 09:39 AM. Reason: Added link to WoWwiki for ChatFrame_AddMessageEventFilter()
  Reply With Quote
06-09-09, 09:48 AM   #8
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Guess that's one side-step into the correct direction even though I know how to make my own chat filters. I was just wondering if it was possible to use the ingame one as it lists all the normal channels and custom channels.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
06-10-09, 02:25 PM   #9
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by Yourstruly View Post
Guess that's one side-step into the correct direction even though I know how to make my own chat filters. I was just wondering if it was possible to use the ingame one as it lists all the normal channels and custom channels.
I'm using the same kind of "filter"

Code:
local function ChannelMessageFilter(self, event, ...)
	id = select(7, ...)
	local _, instanceType = IsInInstance()
	if instanceType == "raid" and (id == 1 or id == 22 or id == 23) then return true end
end

ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", ChannelMessageFilter)
But i was also curious if instead it would be possible to "uncheck" those channels in the blizzard options.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
  Reply With Quote
06-10-09, 02:46 PM   #10
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
Concerning the unchecking of channels in the settings-menu, I searched a bit around in Blizz' UI code and came up with the two functions:
Code:
ChatFrame_AddChannel(chatFrame, channel)
ChatFrame_RemoveChannel(chatFrame, channel)
which remove/add the channel from the chatframe's table channelList and then calls AddChatWindowChannel/RemoveChatWindowChannel automatically.

And if I see it right, the channelList-table of the chatframe is used for the settings. So, try to use:
Code:
ChatFrame_RemoveChannel(ChatFrame1, "General")
__________________
« Website | GitHub »

Oh hai!
  Reply With Quote
06-10-09, 02:56 PM   #11
Hirsute
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 14
If you have lag problems in instances, adding chatfilters will increase the problem.

You might just try creating a new chat tab, and only enabling the channels you want to see on that one, and switching to it while you're in the instance.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Temporarily ignoring/blocking channels


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off