zD12 / pircbotx

Automatically exported from code.google.com/p/pircbotx
0 stars 0 forks source link

OutputChannel.setMode() puts space between mode to set and hostmask #185

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
OutputChannel o = new OutputChannel(botObject, channelObject);
o.setMode(modeToSet, hostmask);

What is the expected output? What do you see instead?
I expect to see when I input to this function modetoset as "+b m:", 
*!*@something - I should see the output as +b m:*!*@something instead of +b m: 
*!*@something - the extra space 

What version of the product are you using? On what operating system?
PircBotX 2.1-SNAPshot

Please provide any additional information below.

I have done a temporary fix by simply merging them together as a single 
modeToSet. The function above worked fine in 2.0.1 by the way.

Original issue reported on code.google.com by jzhou2...@gmail.com on 17 Jul 2014 at 2:08

GoogleCodeExporter commented 9 years ago
Further thoughts tells me the temporary fix may be the permanent fix. As I see 
why the space is there. EXTBANs however do rely on the lack of spacing. But 
they are technically the mode to set. So.. I dunno.

Original comment by jzhou2...@gmail.com on 17 Jul 2014 at 2:13

GoogleCodeExporter commented 9 years ago
First, don't create OutputChannel like that. Use channelObject.send()

I'm unfamiliar with the m: syntax, but setMode was designed to easily say "MODE 
<+/-mode> <arg1> <arg2> <arg3>". If you want your hostmask to be prefixed with 
m: call setMode like this

channel.send().setMode("+b", "m:" + hostmask)

Or just use the simpler

channel.send().ban("m:" + hostmask)

Original comment by Lord.Qua...@gmail.com on 31 Aug 2014 at 7:49