mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-04 16:35:05 -05:00
Moved connect from ServersActivity to ConversationActivity for faster responses
This commit is contained in:
parent
3ca4ea981c
commit
70c9ab644b
@ -166,6 +166,11 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
||||
public void onServiceConnected(ComponentName name, IBinder service)
|
||||
{
|
||||
this.binder = (IRCBinder) service;
|
||||
|
||||
// connect to irc server if connect has been requested
|
||||
if (!server.isConnected() && getIntent().hasExtra("connect")) {
|
||||
binder.connect(server);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -134,12 +134,13 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
|
||||
protected void onListItemClick(ListView l, View v, int position, long id) {
|
||||
Server server = adapter.getItem(position);
|
||||
|
||||
Intent intent = new Intent(this, ConversationActivity.class);
|
||||
|
||||
if (server.getStatus() == Status.DISCONNECTED) {
|
||||
server.setStatus(Status.CONNECTING);
|
||||
binder.connect(server);
|
||||
}
|
||||
|
||||
Intent intent = new Intent(this, ConversationActivity.class);
|
||||
intent.putExtra("connect", true);
|
||||
}
|
||||
|
||||
intent.putExtra("serverId", server.getId());
|
||||
startActivity(intent);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user