diff --git a/src/org/yaaic/model/Broadcast.java b/src/org/yaaic/model/Broadcast.java index 56760d1..e7a3790 100644 --- a/src/org/yaaic/model/Broadcast.java +++ b/src/org/yaaic/model/Broadcast.java @@ -25,7 +25,7 @@ package org.yaaic.model; * * @author Sebastian Kaspari */ -public class Broadcast +public abstract class Broadcast { public static final String SERVER_UPDATE = "org.yaaic.server.status"; @@ -35,4 +35,15 @@ public class Broadcast public static final String EXTRA_SERVER = "server"; public static final String EXTRA_CONVERSATION = "conversation"; + + /** + * Create an intent for conversation broadcasting + * @param serverId + * @param conversationName + * @return + */ + public static Intent createConversationIntent(int serverId, String conversationName) + { + + } } diff --git a/src/org/yaaic/receiver/ChannelReceiver.java b/src/org/yaaic/receiver/ConversationReceiver.java similarity index 90% rename from src/org/yaaic/receiver/ChannelReceiver.java rename to src/org/yaaic/receiver/ConversationReceiver.java index f956c83..bad1d4c 100644 --- a/src/org/yaaic/receiver/ChannelReceiver.java +++ b/src/org/yaaic/receiver/ConversationReceiver.java @@ -24,7 +24,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import org.yaaic.listener.ChannelListener; +import org.yaaic.listener.ConversationListener; import org.yaaic.model.Broadcast; /** @@ -32,11 +32,11 @@ import org.yaaic.model.Broadcast; * * @author Sebastian Kaspari */ -public class ChannelReceiver extends BroadcastReceiver +public class ConversationReceiver extends BroadcastReceiver { public static final String TAG = "Yaaic/ChannelReceiver"; - private ChannelListener listener; + private ConversationListener listener; private int serverId; /** @@ -45,7 +45,7 @@ public class ChannelReceiver extends BroadcastReceiver * @param serverId Only listen on channels of this server * @param listener */ - public ChannelReceiver(int serverId, ChannelListener listener) + public ConversationReceiver(int serverId, ConversationListener listener) { this.listener = listener; this.serverId = serverId; diff --git a/src/org/yaaic/view/ConversationActivity.java b/src/org/yaaic/view/ConversationActivity.java index 40cefd9..1b7b922 100644 --- a/src/org/yaaic/view/ConversationActivity.java +++ b/src/org/yaaic/view/ConversationActivity.java @@ -54,13 +54,13 @@ import org.yaaic.adapter.MessageListAdapter; import org.yaaic.command.CommandParser; import org.yaaic.irc.IRCBinder; import org.yaaic.irc.IRCService; -import org.yaaic.listener.ChannelListener; +import org.yaaic.listener.ConversationListener; import org.yaaic.listener.ServerListener; import org.yaaic.model.Broadcast; import org.yaaic.model.Conversation; import org.yaaic.model.Message; import org.yaaic.model.Server; -import org.yaaic.receiver.ChannelReceiver; +import org.yaaic.receiver.ConversationReceiver; import org.yaaic.receiver.ServerReceiver; /** @@ -68,14 +68,14 @@ import org.yaaic.receiver.ServerReceiver; * * @author Sebastian Kaspari */ -public class ConversationActivity extends Activity implements ServiceConnection, ServerListener, ChannelListener, OnItemClickListener, OnKeyListener, OnItemSelectedListener +public class ConversationActivity extends Activity implements ServiceConnection, ServerListener, ConversationListener, OnItemClickListener, OnKeyListener, OnItemSelectedListener { public static final String TAG = "Yaaic/ConversationActivity"; private int serverId; private Server server; private IRCBinder binder; - private ChannelReceiver channelReceiver; + private ConversationReceiver channelReceiver; private ServerReceiver serverReceiver; private ViewSwitcher switcher; @@ -125,7 +125,7 @@ public class ConversationActivity extends Activity implements ServiceConnection, Intent intent = new Intent(this, IRCService.class); bindService(intent, this, 0); - channelReceiver = new ChannelReceiver(server.getId(), this); + channelReceiver = new ConversationReceiver(server.getId(), this); registerReceiver(channelReceiver, new IntentFilter(Broadcast.CONVERSATION_MESSAGE)); registerReceiver(channelReceiver, new IntentFilter(Broadcast.CONVERSATION_NEW)); registerReceiver(channelReceiver, new IntentFilter(Broadcast.CONVERSATION_REMOVE));