mirror of
https://github.com/moparisthebest/Yaaic
synced 2025-01-08 04:08:19 -05:00
Bugfix: Do not try to connect on resume
This commit is contained in:
parent
9fa17f6a35
commit
8bfe1d1a75
@ -296,6 +296,7 @@ public class Server
|
||||
return R.drawable.connected;
|
||||
case Status.DISCONNECTED:
|
||||
return R.drawable.disconnected;
|
||||
case Status.PRE_CONNECTING:
|
||||
case Status.CONNECTING:
|
||||
return R.drawable.connecting;
|
||||
}
|
||||
|
@ -29,4 +29,5 @@ public class Status {
|
||||
public static final int DISCONNECTED = 0;
|
||||
public static final int CONNECTING = 1;
|
||||
public static final int CONNECTED = 2;
|
||||
public static final int PRE_CONNECTING = 3;
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ import org.yaaic.model.Broadcast;
|
||||
import org.yaaic.model.Conversation;
|
||||
import org.yaaic.model.Message;
|
||||
import org.yaaic.model.Server;
|
||||
import org.yaaic.model.Status;
|
||||
import org.yaaic.receiver.ConversationReceiver;
|
||||
import org.yaaic.receiver.ServerReceiver;
|
||||
|
||||
@ -170,7 +171,8 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
||||
this.binder = (IRCBinder) service;
|
||||
|
||||
// connect to irc server if connect has been requested
|
||||
if (!server.isConnected() && getIntent().hasExtra("connect")) {
|
||||
if (server.getStatus() == Status.PRE_CONNECTING && getIntent().hasExtra("connect")) {
|
||||
server.setStatus(Status.CONNECTING);
|
||||
binder.connect(server);
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
|
||||
Intent intent = new Intent(this, ConversationActivity.class);
|
||||
|
||||
if (server.getStatus() == Status.DISCONNECTED) {
|
||||
server.setStatus(Status.CONNECTING);
|
||||
server.setStatus(Status.PRE_CONNECTING);
|
||||
intent.putExtra("connect", true);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user