diff options
author | saqura <saqura@saqura.eu> | 2015-10-02 22:00:11 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-10-06 16:23:05 +0200 |
commit | 403db3b0800ec0dcca5fd1f5c8d94ad1f8ee9e5d (patch) | |
tree | ed853d57dbee0a5716711ec566f742b93bf9b72b /src/main | |
parent | 32abc766898a5524c7e945adf64bd97ffb404c2b (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')
3 files changed, 47 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index cf078ee52..dc0701645 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 2f9d567eb..42ce5349a 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 { diff --git a/src/main/res/layout/activity_muc_details.xml b/src/main/res/layout/activity_muc_details.xml index 6edbb7060..1a88424e4 100644 --- a/src/main/res/layout/activity_muc_details.xml +++ b/src/main/res/layout/activity_muc_details.xml @@ -87,7 +87,7 @@ android:id="@+id/muc_conference_type" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/private_conference" + android:text="@string/private_conference" android:layout_centerVertical="true" android:textColor="@color/black87" android:textSize="?attr/TextSizeBody" @@ -107,6 +107,35 @@ android:src="?attr/icon_settings"/> </RelativeLayout> + <TableLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/muc_info_more" + android:stretchColumns="1" + android:visibility="gone"> + + <TableRow + android:layout_width="fill_parent" + android:layout_height="match_parent"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/server_info_mam" + android:textColor="@color/black87" + android:textSize="?attr/TextSizeBody" /> + + <TextView + android:id="@+id/muc_info_mam" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:textColor="@color/black87" + android:textSize="?attr/TextSizeBody" /> + </TableRow> + + </TableLayout> + <TextView android:id="@+id/details_account" android:layout_width="wrap_content" |