mirror of
https://github.com/moparisthebest/Yaaic
synced 2025-01-10 05:08:18 -05:00
ConversationActivity: Only show reconnect popup if automatic reconnect is disabled
This commit is contained in:
parent
5dd6982314
commit
8766f785a0
@ -386,28 +386,30 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
||||
input.setEnabled(true);
|
||||
} else {
|
||||
input.setEnabled(false);
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setMessage("You disconnected from " + server.getTitle() + ". Do you want to reconnect?")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
binder.getService().getConnection(server.getId()).setAutojoinChannels(
|
||||
server.getCurrentChannelNames()
|
||||
);
|
||||
server.clearConversations();
|
||||
deckAdapter.clearConversations();
|
||||
deckAdapter.addItem(server.getConversation(ServerInfo.DEFAULT_NAME));
|
||||
binder.connect(server);
|
||||
}
|
||||
})
|
||||
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
|
||||
if (!binder.getService().getSettings().isReconnectEnabled()) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setMessage("You disconnected from " + server.getTitle() + ". Do you want to reconnect?")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
binder.getService().getConnection(server.getId()).setAutojoinChannels(
|
||||
server.getCurrentChannelNames()
|
||||
);
|
||||
server.clearConversations();
|
||||
deckAdapter.clearConversations();
|
||||
deckAdapter.addItem(server.getConversation(ServerInfo.DEFAULT_NAME));
|
||||
binder.connect(server);
|
||||
}
|
||||
})
|
||||
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user