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

Implemented onQuit() event for other users

This commit is contained in:
Sebastian Kaspari 2010-03-09 22:42:12 +01:00
parent 608ea2e614
commit 218b2a8ed5

View File

@ -362,7 +362,22 @@ public class IRCConnection extends PircBot
{ {
debug("Quit", sourceNick); debug("Quit", sourceNick);
// XXX: Add message to all channels where this user has been if (!sourceNick.equals(this.getNick())) {
for (String target : getChannelsByNickname(sourceNick)) {
Channel channel = server.getChannel(target);
Message message = new Message(sourceNick + " quitted");
message.setColor(Message.COLOR_GREEN);
message.setIcon(R.drawable.quit);
channel.addMessage(message);
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
} else {
// XXX: We quitted
}
} }
/** /**