if (null == channel_name ||
0 == channel_name.length())
{
return;
}
Channel channel = bot.getServer().getChannel(channel_name);
if (null == channel)
{
return;
}
synchronized (mConstructedChannelNames)
{
// received additional name entries
if (ResponseCode.RPL_NAMREPLY == responseCode)
{
ArrayList nicknames = mConstructedChannelNames.getSeens(channel);
if (null == nicknames)
{
nicknames = new ArrayList();
mConstructedChannelNames.put(channel, nicknames);
}
ArrayList received_names = StringUtils.split(fullMessage.getTrailing(), " ");
Iterator received_names_it = received_names.iterator();
String received_name = null;
while (received_names_it.hasNext())
{
received_name = (String)received_names_it.next();
// remove operator and voice indicators
if (received_name.startsWith("@") ||
received_name.startsWith("+"))
{
nicknames.add(received_name.substring(1));
}
else
{
nicknames.add(received_name);
}
}
}
// received all name entries, so process all the waiting seen messages
else if (ResponseCode.RPL_ENDOFNAMES == responseCode)
{
ArrayList channel_nicknames = mConstructedChannelNames.removeSeens(channel);
if (null == channel_nicknames)
{
return;
}
mFinishedChannelNames.put(channel, channel_nicknames);
// check of there are seen nicks names that are waiting for a
// channel namelist
if (!mChannelSeensWaiting.hasChannel(channel) &&
!mMessageSeensWaiting.hasChannel(channel))
{
return;
}
synchronized (mChannelSeensWaiting)
{
ArrayList channel_seens = mChannelSeensWaiting.getSeens(channel);
String channel_seen = null;
// go over all the waiting channel seen requests and process
// them, removing them from the waiting list
while (channel_seens != null &&
channel_seens.size() > 0)
{
channel_seen = (String)channel_seens.remove(0);
String reply = processSeenWaiting(bot, channel, channel_seen);
if (reply != null)
{
channel.send(reply);
}
}
}
synchronized (mMessageSeensWaiting)