From 218b2a8ed57e47dc48aa7607f5a6953739468f6f Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Tue, 9 Mar 2010 22:42:12 +0100 Subject: [PATCH] Implemented onQuit() event for other users --- src/org/yaaic/irc/IRCConnection.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/org/yaaic/irc/IRCConnection.java b/src/org/yaaic/irc/IRCConnection.java index 2105c32..ffbdc80 100644 --- a/src/org/yaaic/irc/IRCConnection.java +++ b/src/org/yaaic/irc/IRCConnection.java @@ -362,7 +362,22 @@ public class IRCConnection extends PircBot { 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 + } } /**