1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-29 12:22:21 -05:00

Implemented IRCConnection.onKick()

This commit is contained in:
Sebastian Kaspari 2010-03-02 19:47:43 +01:00
parent 9d90a2d40e
commit db5ac3a467
3 changed files with 24 additions and 4 deletions

View File

@ -141,18 +141,27 @@ public class IRCConnection extends PircBot
* On Kick
*/
@Override
protected void onKick(String channel, String kickerNick, String kickerLogin, String kickerHostname, String recipientNick, String reason)
protected void onKick(String target, String kickerNick, String kickerLogin, String kickerHostname, String recipientNick, String reason)
{
debug("Kick", channel + " " + recipientNick + "(" + kickerNick + ")");
debug("Kick", target + " " + recipientNick + "(" + kickerNick + ")");
if (recipientNick.equals(getNick())) {
// We are kicked
server.removeChannel(target);
service.sendBroadcast(new Intent(Broadcast.CHANNEL_REMOVE));
} else {
server.getChannel(target).addMessage(kickerNick + " kicked " + recipientNick);
service.sendBroadcast(new Intent(Broadcast.CHANNEL_MESSAGE));
}
}
/**
* On Message
*/
@Override
protected void onMessage(String channel, String sender, String login, String hostname, String message)
protected void onMessage(String target, String sender, String login, String hostname, String message)
{
debug("Message", channel + " " + sender + " " + message);
debug("Message", target + " " + sender + " " + message);
}
/**

View File

@ -26,4 +26,5 @@ public class Broadcast
public static final String CHANNEL_MESSAGE = "org.yaaic.channel.message";
public static final String CHANNEL_NEW = "org.yaaic.channel.new";
public static final String CHANNEL_REMOVE = "org.yaaic.channel.remove";
}

View File

@ -190,6 +190,16 @@ public class Server
channels.put(channel.getName(), channel);
}
/**
* Renive a (joined) channel
*
* @param name
*/
public void removeChannel(String name)
{
channels.remove(name);
}
/**
* Get icon for current server status
*