raisedragon / pircbotx

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

JoinEvent not sent if target is bot #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add a listener that overrides the onJoin method
2. Start up the bot and notice the distinct lack of onJoin event handling

What is the expected output? What do you see instead?
Expected: 

What version of the product are you using? On what operating system?
1.6, Linux x86_64 on OpenJDK 1.6.0_24 [IcedTea6 1.11.1]

Please provide any additional information below.
Example listener in attachment

Original issue reported on code.google.com by CCu...@gmail.com on 15 Mar 2012 at 12:40

Attachments:

GoogleCodeExporter commented 9 years ago
Just tested your code

1331944789593 <<<:ChanServ!ChanServ@services. JOIN #pircbotx
Got JoinEvent in Channel(name=#pircbotx, mode=sn, topic=, topicTimestamp=0, 
createTimestamp=0, topicSetter=, bot=Version{PircBotX 1.7, a fork of PircBot, 
the Java IRC bot - pircbotx.googlecode.com} Connected{true} 
Server{irc.freenode.org} Port{6667} Password{null}, modeStale=true, 
modeLatch=null, halfOps=[], superOps=[], owners=[]) for User(nick=ChanServ, 
realName=, login=ChanServ, hostmask=services., away=false, ircop=false, 
server=, identified=true, hops=0, bot=Version{PircBotX 1.7, a fork of PircBot, 
the Java IRC bot - pircbotx.googlecode.com} Connected{true} 
Server{irc.freenode.org} Port{6667} Password{null}, 
uuid=ce5ac46d-3498-49a3-aab5-4fcebc197b3b)

Are you sure you added JoinListener to the bot's ListenerManager? Otherwise 
PircBotX has no idea that it exists

Original comment by Lord.Qua...@gmail.com on 17 Mar 2012 at 12:40

GoogleCodeExporter commented 9 years ago
My bad, I'm talking about the PircBotX instance itself. Sorry for the bad 
wording.

Original comment by CCu...@gmail.com on 17 Mar 2012 at 5:29

GoogleCodeExporter commented 9 years ago
I'm confused, what exactly isn't working? Your Listener works and if you add it 
to the bots listener manager the whole bot works as expected

Attached is a mini example showing that it does indeed work

Original comment by Lord.Qua...@gmail.com on 17 Mar 2012 at 6:57

Attachments:

GoogleCodeExporter commented 9 years ago
Your example works as intended...

Turns out, the bug was on my part -- I added the join listener, but only AFTER 
I instructed PircBotX to join channels, and therefore the event was never 
received because it was sent before any listeners for it were there.

I'm very, very sorry for submitting a bug that's actually my bad.

Original comment by CCu...@gmail.com on 18 Mar 2012 at 5:58

GoogleCodeExporter commented 9 years ago
Ah, okay. Don't worry about submitting a bug report, its perfectly fine

Original comment by Lord.Qua...@gmail.com on 18 Mar 2012 at 5:35