1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2025-01-11 13:48:21 -05:00

Send server id on CHANNEL broadcasts

This commit is contained in:
Sebastian Kaspari 2010-03-05 19:47:19 +01:00
parent 9367d44220
commit 38fe74fcc9
2 changed files with 16 additions and 0 deletions

View File

@ -82,6 +82,7 @@ public class IRCConnection extends PircBot
server.getChannel(target).addMessage("* " + sender + " " + action);
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
@ -106,6 +107,7 @@ public class IRCConnection extends PircBot
server.getChannel(target).addMessage(sourceNick + " deoped " + recipient);
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
@ -121,6 +123,7 @@ public class IRCConnection extends PircBot
server.getChannel(target).addMessage(sourceNick + " devoiced " + recipient);
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
@ -136,6 +139,7 @@ public class IRCConnection extends PircBot
server.getChannel(target).addMessage(sourceNick + " invited " + targetNick);
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
@ -154,11 +158,13 @@ public class IRCConnection extends PircBot
Intent intent = new Intent(Broadcast.CHANNEL_NEW);
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
service.sendBroadcast(intent);
} else {
server.getChannel(target).addMessage(sender + " joined");
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
@ -177,12 +183,14 @@ public class IRCConnection extends PircBot
server.removeChannel(target);
Intent intent = new Intent(Broadcast.CHANNEL_REMOVE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
} else {
server.getChannel(target).addMessage(kickerNick + " kicked " + recipientNick);
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
@ -199,6 +207,7 @@ public class IRCConnection extends PircBot
server.getChannel(target).addMessage("<" + sender + "> " + message);
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
@ -214,6 +223,7 @@ public class IRCConnection extends PircBot
server.getChannel(target).addMessage(sourceNick + " sets mode " + mode);
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
@ -247,6 +257,7 @@ public class IRCConnection extends PircBot
server.getChannel(target).addMessage(sourceNick + " oped " + recipient);
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
@ -264,12 +275,14 @@ public class IRCConnection extends PircBot
server.removeChannel(target);
Intent intent = new Intent(Broadcast.CHANNEL_REMOVE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
} else {
server.getChannel(target).addMessage(sender + " parted");
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
@ -308,6 +321,7 @@ public class IRCConnection extends PircBot
}
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}
@ -332,6 +346,7 @@ public class IRCConnection extends PircBot
server.getChannel(target).addMessage(sourceNick + " voiced " + recipient);
Intent intent = new Intent(Broadcast.CHANNEL_MESSAGE);
intent.putExtra(Broadcast.EXTRA_SERVER, server.getId());
intent.putExtra(Broadcast.EXTRA_CHANNEL, target);
service.sendBroadcast(intent);
}

View File

@ -29,4 +29,5 @@ public class Broadcast
public static final String CHANNEL_REMOVE = "org.yaaic.channel.remove";
public static final String EXTRA_CHANNEL = "channel";
public static final String EXTRA_SERVER = "server";
}