|
@@ -24,6 +24,7 @@ package com.dmdirc.parser.irc;
|
24
|
24
|
|
25
|
25
|
import com.dmdirc.parser.interfaces.ChannelInfo;
|
26
|
26
|
import com.dmdirc.parser.interfaces.callbacks.ChannelNamesListener;
|
|
27
|
+import com.dmdirc.parser.interfaces.callbacks.ChannelTopicListener;
|
27
|
28
|
|
28
|
29
|
/**
|
29
|
30
|
* Process a Names reply.
|
|
@@ -43,6 +44,10 @@ public class ProcessNames extends IRCProcessor {
|
43
|
44
|
iChannel = getChannel(token[3]);
|
44
|
45
|
if (iChannel == null) { return; }
|
45
|
46
|
|
|
47
|
+ if (!iChannel.hadTopic()) {
|
|
48
|
+ callChannelTopic(iChannel, true);
|
|
49
|
+ }
|
|
50
|
+
|
46
|
51
|
iChannel.setAddingNames(false);
|
47
|
52
|
callChannelGotNames(iChannel);
|
48
|
53
|
|
|
@@ -102,6 +107,19 @@ public class ProcessNames extends IRCProcessor {
|
102
|
107
|
}
|
103
|
108
|
}
|
104
|
109
|
|
|
110
|
+ /**
|
|
111
|
+ * Callback to all objects implementing the ChannelTopic Callback.
|
|
112
|
+ *
|
|
113
|
+ * @see IChannelTopic
|
|
114
|
+ * @param cChannel Channel that topic was set on
|
|
115
|
+ * @param bIsJoinTopic True when getting topic on join, false if set by user/server
|
|
116
|
+ * @return true if a method was called, false otherwise
|
|
117
|
+ */
|
|
118
|
+ protected boolean callChannelTopic(final ChannelInfo cChannel, final boolean bIsJoinTopic) {
|
|
119
|
+ ((IRCChannelInfo)cChannel).setHadTopic();
|
|
120
|
+ return getCallbackManager().getCallbackType(ChannelTopicListener.class).call(cChannel, bIsJoinTopic);
|
|
121
|
+ }
|
|
122
|
+
|
105
|
123
|
/**
|
106
|
124
|
* Callback to all objects implementing the ChannelGotNames Callback.
|
107
|
125
|
*
|