aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorsaqura <saqura@saqura.eu>2015-10-02 22:00:11 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-10-06 16:23:05 +0200
commit403db3b0800ec0dcca5fd1f5c8d94ad1f8ee9e5d (patch)
treeed853d57dbee0a5716711ec566f742b93bf9b72b /src/main/java
parent32abc766898a5524c7e945adf64bd97ffb404c2b (diff)
Show whether MAM is supported in MUCs
The conference details in "Advanced Mode" now indicate whether MAM is supported by the conference server.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/MucOptions.java5
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java13
2 files changed, 17 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java
index cf078ee5..dc070164 100644
--- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java
+++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java
@@ -247,6 +247,11 @@ public class MucOptions {
return hasFeature("muc_membersonly");
}
+ public boolean mamSupport() {
+ // Update with "urn:xmpp:mam:1" once we support it
+ return hasFeature("urn:xmpp:mam:0");
+ }
+
public boolean nonanonymous() {
return hasFeature("muc_nonanonymous");
}
diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
index 2f9d567e..42ce5349 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
@@ -19,6 +19,7 @@ import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
+import android.widget.TableLayout;
import android.widget.TextView;
import android.widget.Toast;
@@ -61,6 +62,8 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
private LinearLayout membersView;
private LinearLayout mMoreDetails;
private TextView mConferenceType;
+ private TableLayout mConferenceInfoTable;
+ private TextView mConferenceInfoMam;
private ImageButton mChangeConferenceSettingsButton;
private Button mInviteButton;
private String uuid = null;
@@ -194,7 +197,6 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
mMoreDetails.setVisibility(View.GONE);
mChangeConferenceSettingsButton = (ImageButton) findViewById(R.id.change_conference_button);
mChangeConferenceSettingsButton.setOnClickListener(this.mChangeConferenceSettings);
- mConferenceType = (TextView) findViewById(R.id.muc_conference_type);
mInviteButton = (Button) findViewById(R.id.invite);
mInviteButton.setOnClickListener(inviteListener);
mConferenceType = (TextView) findViewById(R.id.muc_conference_type);
@@ -217,6 +219,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
}
});
this.mAdvancedMode = getPreferences().getBoolean("advanced_muc_mode", false);
+ this.mConferenceInfoTable = (TableLayout) findViewById(R.id.muc_info_more);
+ mConferenceInfoTable.setVisibility(this.mAdvancedMode ? View.VISIBLE : View.GONE);
+ this.mConferenceInfoMam = (TextView) findViewById(R.id.muc_info_mam);
}
@Override
@@ -240,6 +245,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
this.mAdvancedMode = !menuItem.isChecked();
menuItem.setChecked(this.mAdvancedMode);
getPreferences().edit().putBoolean("advanced_muc_mode", mAdvancedMode).commit();
+ mConferenceInfoTable.setVisibility(this.mAdvancedMode ? View.VISIBLE : View.GONE);
invalidateOptionsMenu();
updateView();
break;
@@ -473,6 +479,11 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
} else {
mConferenceType.setText(R.string.public_conference);
}
+ if (mucOptions.mamSupport()) {
+ mConferenceInfoMam.setText(R.string.server_info_available);
+ } else {
+ mConferenceInfoMam.setText(R.string.server_info_unavailable);
+ }
if (self.getAffiliation().ranks(MucOptions.Affiliation.OWNER)) {
mChangeConferenceSettingsButton.setVisibility(View.VISIBLE);
} else {