Commit 1787ea35 authored by Grigory Fedorov's avatar Grigory Fedorov

Wrong chat selected debug message removed.

parent 32ede03d
...@@ -408,51 +408,7 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -408,51 +408,7 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
@Override @Override
public void onChatViewAdapterFinishUpdate() { public void onChatViewAdapterFinishUpdate() {
insertExtraText(); insertExtraText();
updateRegisteredChats(); updateRegisteredChats();
Fragment currentFragment = chatViewerAdapter.getCurrentFragment();
if (isChatSelected) {
if (!(currentFragment instanceof ChatViewerFragment)) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Debug message")
.setMessage("Recent chats selected, but contact chat expected.")
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
builder.create().show();
} else if (!((ChatViewerFragment) currentFragment).isEqual(actionWithAccount, actionWithUser)) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Debug message")
.setMessage("Wrong contact chat selected.")
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
builder.create().show();
}
} else {
if (!(currentFragment instanceof RecentChatFragment)) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Debug message")
.setMessage("Contact chat selected, but recent chats expected.")
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
builder.create().show();
}
}
} }
private void insertExtraText() { private void insertExtraText() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment