aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-07-18 12:44:33 +0200
committeriNPUTmice <daniel@gultsch.de>2014-07-18 12:44:33 +0200
commit6b74c0594e95dcedfdbeeb33ef7bdd8b52c1093e (patch)
tree6c1333aa62a68409d28f9663d4d0887d856202e8 /src/eu/siacs/conversations/ui
parent38a9242955704232039272fd8b6011d47622495d (diff)
show snackbar if conference was not found
Diffstat (limited to 'src/eu/siacs/conversations/ui')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationActivity.java2
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java14
2 files changed, 13 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java
index ae1d218a..05b7cb4a 100644
--- a/src/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/ConversationActivity.java
@@ -568,7 +568,7 @@ public class ConversationActivity extends XmppActivity {
return super.onOptionsItemSelected(item);
}
- private void endConversation(Conversation conversation) {
+ public void endConversation(Conversation conversation) {
conversation.setStatus(Conversation.STATUS_ARCHIVED);
paneShouldBeOpen = true;
spl.openPane();
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index 206e40a0..e33e2cf3 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -124,6 +124,14 @@ public class ConversationFragment extends Fragment {
startActivity(intent);
}
};
+
+ private OnClickListener leaveMuc = new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ activity.endConversation(conversation);
+ }
+ };
private OnScrollListener mOnScrollListener = new OnScrollListener() {
@@ -687,6 +695,7 @@ public class ConversationFragment extends Fragment {
if (getView() == null) {
return;
}
+ hideSnackbar();
ConversationActivity activity = (ConversationActivity) getActivity();
if (this.conversation != null) {
for (Message message : this.conversation.getMessages()) {
@@ -715,10 +724,11 @@ public class ConversationFragment extends Fragment {
makeFingerprintWarning(conversation.getLatestEncryption());
}
} else {
- if (conversation.getMucOptions().getError() != 0) {
- showSnackbar(R.string.nick_in_use, R.string.edit,clickToMuc);
+ if (!conversation.getMucOptions().online()) {
if (conversation.getMucOptions().getError() == MucOptions.ERROR_NICK_IN_USE) {
showSnackbar(R.string.nick_in_use, R.string.edit,clickToMuc);
+ } else if (conversation.getMucOptions().getError() == MucOptions.ERROR_ROOM_NOT_FOUND) {
+ showSnackbar(R.string.conference_not_found,R.string.leave,leaveMuc);
}
}
}