Menu

#43 Bug in onTopic()

2_-_Moderate_Bug
open
5
2001-05-28
2001-05-28
No

I noticed that the ChannelAdapter object advertises an
onTopicChange()
callback that gets called when the current channel's
topic is changed.
Unfortunately, overriding this callback doesn't seem
to do anything. Not to
worry, adding this functionality is easy, just replace
this function in
Channel.java:

public void onTopic(String channel, String
txt) {
setTopic(txt);

final ChannelEvent event =
new ChannelEvent(Channel.this,"","",txt);

notifyListeners(new _ChannelEventNotifier
() {
public void notify(ChannelListener
listener)
{listener.onTopicChange(event);}
});
}

and make the following small bug fix in
IRCConnection.java:

else if (command.equals("TOPIC")) {
String channel = tokens[2].token;
String topic =
message.substring(tokens[3].index ).trim().substring
(1);
_mux.onTopic(channel,topic);
handled = true;

I have been using the chatengine classes in developing
an applet that's
intended to run in 1.1-compliant browsers. While I
haven't tried to compile
anything outside of the chatengine classes, the
chatengine classes seem to
work OK inside both Netscape and MSIE inside an applet.

jwb

Discussion


Log in to post a comment.