mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 14:27:24 +00:00
Hide read status setting if old talk version used
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
98e2117bdf
commit
e563230fb2
@ -192,9 +192,9 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage
|
||||
else -> null
|
||||
}
|
||||
|
||||
readStatusDrawableInt?.let {
|
||||
context?.resources?.getDrawable(it, null)?.let {
|
||||
it.setColorFilter(context?.resources!!.getColor(R.color.warm_grey_four), PorterDuff.Mode.SRC_ATOP)
|
||||
readStatusDrawableInt?.let { drawableInt ->
|
||||
context?.resources?.getDrawable(drawableInt, null)?.let {
|
||||
it.setColorFilter(context?.resources!!.getColor(R.color.white60), PorterDuff.Mode.SRC_ATOP)
|
||||
checkMark?.setImageDrawable(it)
|
||||
}
|
||||
}
|
||||
|
@ -457,7 +457,11 @@ public class SettingsController extends BaseController {
|
||||
((Checkable) incognitoKeyboardSwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getIsKeyboardIncognito());
|
||||
}
|
||||
|
||||
if (userUtils.getCurrentUser().isReadStatusAvailable()) {
|
||||
((Checkable) readPrivacyPreference.findViewById(R.id.mp_checkable)).setChecked(!currentUser.isReadStatusPrivate());
|
||||
} else {
|
||||
readPrivacyPreference.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
((Checkable) linkPreviewsSwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getAreLinkPreviewsAllowed());
|
||||
((Checkable) phoneBookIntegretationPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.isPhoneBookIntegrationEnabled());
|
||||
|
@ -147,6 +147,25 @@ public interface User extends Parcelable, Persistable, Serializable {
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean isReadStatusAvailable() {
|
||||
if (getCapabilities() != null) {
|
||||
Capabilities capabilities;
|
||||
try {
|
||||
capabilities = LoganSquare.parse(getCapabilities(), Capabilities.class);
|
||||
if (capabilities != null &&
|
||||
capabilities.getSpreedCapability() != null &&
|
||||
capabilities.getSpreedCapability().getConfig() != null &&
|
||||
capabilities.getSpreedCapability().getConfig().containsKey("chat")) {
|
||||
HashMap<String, String> map = capabilities.getSpreedCapability().getConfig().get("chat");
|
||||
return map != null && map.containsKey("read-privacy");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean isReadStatusPrivate() {
|
||||
if (getCapabilities() != null) {
|
||||
Capabilities capabilities;
|
||||
|
Loading…
Reference in New Issue
Block a user