Skip to content
Snippets Groups Projects
Verified Commit 3f381904 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

List missing features on connect. Fixes #53

parent 6b53db69
Branches
Tags
No related merge requests found
[
{
"name": "SynchronizedMarkerLine",
"description": "Required for synchronizing the last position in channels"
},
{
"name": "SaslAuthentication",
"description": "Required for SASL"
},
{
"name": "SaslExternal",
"description": "Required for SASL with certificates"
},
{
"name": "HideInactiveNetworks",
"description": "Required for hiding inactive networks from chat lists"
},
{
"name": "PasswordChange",
"description": "Required for changing passwords from the client"
},
{
"name": "CapNegotiation",
"description": "Required for IRCv3 capabilities"
},
{
"name": "VerifyServerSSL",
"description": "Required for verifying the SSL certificate of IRC networks you connect to"
},
{
"name": "CustomRateLimits",
"description": "Required for custom rate limits for IRC networks"
},
{
"name": "AwayFormatTimestamp",
"description": "Required for custom formatted timestamps in away messages"
},
{
"name": "BufferActivitySync",
"description": "Required for seeing activity of chats in the chat list"
},
{
"name": "CoreSideHighlights",
"description": "Required for highlights"
},
{
"name": "SenderPrefixes",
"description": "Required for seeing prefix modes (+, @) of users in channels"
},
{
"name": "RemoteDisconnect",
"description": "Required for remote disconnects of your own clients"
},
{
"name": "RichMessages",
"description": "Required for seeing real names or IRCv3 or Gravatar avatars in messages"
},
{
"name": "BacklogFilterType",
"description": "Required for receiving past notifications after connecting"
}
]
...@@ -47,6 +47,7 @@ import de.kuschku.libquassel.protocol.Buffer_Type ...@@ -47,6 +47,7 @@ import de.kuschku.libquassel.protocol.Buffer_Type
import de.kuschku.libquassel.protocol.Message import de.kuschku.libquassel.protocol.Message
import de.kuschku.libquassel.protocol.Message_Type import de.kuschku.libquassel.protocol.Message_Type
import de.kuschku.libquassel.protocol.message.HandshakeMessage import de.kuschku.libquassel.protocol.message.HandshakeMessage
import de.kuschku.libquassel.quassel.ExtendedFeature
import de.kuschku.libquassel.session.Error import de.kuschku.libquassel.session.Error
import de.kuschku.libquassel.util.Optional import de.kuschku.libquassel.util.Optional
import de.kuschku.libquassel.util.flag.and import de.kuschku.libquassel.util.flag.and
...@@ -68,6 +69,8 @@ import de.kuschku.quasseldroid.ui.setup.accounts.selection.AccountSelectionActiv ...@@ -68,6 +69,8 @@ import de.kuschku.quasseldroid.ui.setup.accounts.selection.AccountSelectionActiv
import de.kuschku.quasseldroid.ui.setup.user.UserSetupActivity import de.kuschku.quasseldroid.ui.setup.user.UserSetupActivity
import de.kuschku.quasseldroid.util.helper.* import de.kuschku.quasseldroid.util.helper.*
import de.kuschku.quasseldroid.util.irc.format.IrcFormatDeserializer import de.kuschku.quasseldroid.util.irc.format.IrcFormatDeserializer
import de.kuschku.quasseldroid.util.missingfeatures.MissingFeature
import de.kuschku.quasseldroid.util.missingfeatures.MissingFeaturesDialog
import de.kuschku.quasseldroid.util.service.ServiceBoundActivity import de.kuschku.quasseldroid.util.service.ServiceBoundActivity
import de.kuschku.quasseldroid.util.ui.DragInterceptBottomSheetBehavior import de.kuschku.quasseldroid.util.ui.DragInterceptBottomSheetBehavior
import de.kuschku.quasseldroid.util.ui.MaterialContentLoadingProgressBar import de.kuschku.quasseldroid.util.ui.MaterialContentLoadingProgressBar
...@@ -464,6 +467,52 @@ class ChatActivity : ServiceBoundActivity(), SharedPreferences.OnSharedPreferenc ...@@ -464,6 +467,52 @@ class ChatActivity : ServiceBoundActivity(), SharedPreferences.OnSharedPreferenc
if (it.identities.isEmpty()) { if (it.identities.isEmpty()) {
UserSetupActivity.launch(this) UserSetupActivity.launch(this)
} }
val missingFeatures = listOf(
ExtendedFeature.SynchronizedMarkerLine,
ExtendedFeature.SaslAuthentication,
ExtendedFeature.SaslExternal,
ExtendedFeature.HideInactiveNetworks,
ExtendedFeature.PasswordChange,
ExtendedFeature.CapNegotiation,
ExtendedFeature.VerifyServerSSL,
ExtendedFeature.CustomRateLimits,
ExtendedFeature.AwayFormatTimestamp,
ExtendedFeature.BufferActivitySync,
ExtendedFeature.CoreSideHighlights,
ExtendedFeature.SenderPrefixes,
ExtendedFeature.RemoteDisconnect,
ExtendedFeature.RichMessages,
ExtendedFeature.BacklogFilterType
) - it.features.core.enabledFeatures
if (missingFeatures.isNotEmpty()) {
MissingFeaturesDialog.Builder(this)
.missingFeatures(missingFeatures.mapNotNull { feature ->
when (feature) {
ExtendedFeature.SynchronizedMarkerLine -> R.string.label_feature_synchronizedmarkerline
ExtendedFeature.SaslAuthentication -> R.string.label_feature_saslauthentication
ExtendedFeature.SaslExternal -> R.string.label_feature_saslexternal
ExtendedFeature.HideInactiveNetworks -> R.string.label_feature_hideinactivenetworks
ExtendedFeature.PasswordChange -> R.string.label_feature_passwordchange
ExtendedFeature.CapNegotiation -> R.string.label_feature_capnegotiation
ExtendedFeature.VerifyServerSSL -> R.string.label_feature_verifyserverssl
ExtendedFeature.CustomRateLimits -> R.string.label_feature_customratelimits
ExtendedFeature.AwayFormatTimestamp -> R.string.label_feature_awayformattimestamp
ExtendedFeature.BufferActivitySync -> R.string.label_feature_bufferactivitysync
ExtendedFeature.CoreSideHighlights -> R.string.label_feature_coresidehighlights
ExtendedFeature.SenderPrefixes -> R.string.label_feature_senderprefixes
ExtendedFeature.RemoteDisconnect -> R.string.label_feature_remotedisconnect
ExtendedFeature.RichMessages -> R.string.label_feature_richmessages
ExtendedFeature.BacklogFilterType -> R.string.label_feature_backlogfiltertype
else -> null
}?.let {
MissingFeature(
feature = feature,
description = it
)
}
})
.show()
}
} }
} }
}) })
......
...@@ -94,16 +94,6 @@ public class ColorChooserDialog extends DialogFragment ...@@ -94,16 +94,6 @@ public class ColorChooserDialog extends DialogFragment
public ColorChooserDialog() { public ColorChooserDialog() {
} }
@Nullable
public static ColorChooserDialog findVisible(
@NonNull FragmentManager fragmentManager, @ColorChooserTag String tag) {
Fragment frag = fragmentManager.findFragmentByTag(tag);
if (frag != null && frag instanceof ColorChooserDialog) {
return (ColorChooserDialog) frag;
}
return null;
}
private void generateColors() { private void generateColors() {
Builder builder = getBuilder(); Builder builder = getBuilder();
colorsTop = builder.colorsTop; colorsTop = builder.colorsTop;
......
<?xml version="1.0" encoding="utf-8"?><!--
Quasseldroid - Quassel client for Android
Copyright (c) 2018 Janne Koschinski
Copyright (c) 2018 The Quassel Project
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License version 3 as published
by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingTop="8dp">
<TextView
style="@style/Widget.RtlConformTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:paddingEnd="?listPreferredItemPaddingRight"
android:paddingLeft="?listPreferredItemPaddingLeft"
android:paddingRight="?listPreferredItemPaddingRight"
android:paddingStart="?listPreferredItemPaddingLeft"
android:paddingTop="8dp"
android:text="@string/info_missing_features"
android:textColor="?colorTextPrimary"
android:textSize="16sp" />
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"
tools:ignore="UnusedAttribute"
tools:itemCount="3"
tools:listitem="@layout/widget_missing_feature" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?><!--
Quasseldroid - Quassel client for Android
Copyright (c) 2018 Janne Koschinski
Copyright (c) 2018 The Quassel Project
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License version 3 as published
by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingEnd="?android:attr/listPreferredItemPaddingRight"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
android:paddingStart="?android:attr/listPreferredItemPaddingLeft"
tools:showIn="@layout/dialog_missing_features">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingTop="16dp">
<TextView
android:id="@+id/name"
style="@style/Widget.RtlConformTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?colorTextPrimary"
android:textSize="16sp"
tools:text="@sample/features.json/name" />
<TextView
android:id="@+id/description"
style="@style/Widget.RtlConformTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?colorTextSecondary"
tools:text="@sample/features.json/description" />
</LinearLayout>
</LinearLayout>
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<string name="connection_service_description">Keeps a connection to your core to allow for notifications, and to transmit messages.</string> <string name="connection_service_description">Keeps a connection to your core to allow for notifications, and to transmit messages.</string>
<string name="label_about">About</string> <string name="label_about">About</string>
<string name="label_accept">Accept</string>
<string name="label_avatar">Avatar</string> <string name="label_avatar">Avatar</string>
<string name="label_back">Back</string> <string name="label_back">Back</string>
<string name="label_buffer_name">Buffer Name</string> <string name="label_buffer_name">Buffer Name</string>
...@@ -109,11 +110,30 @@ ...@@ -109,11 +110,30 @@
<string name="label_whois_long">Update user information</string> <string name="label_whois_long">Update user information</string>
<string name="label_yes">Yes</string> <string name="label_yes">Yes</string>
<string name="label_feature_synchronizedmarkerline">Required for synchronizing the last position in channels</string>
<string name="label_feature_saslauthentication">Required for SASL</string>
<string name="label_feature_saslexternal">Required for SASL with certificates</string>
<string name="label_feature_hideinactivenetworks">Required for hiding inactive networks from chat lists</string>
<string name="label_feature_passwordchange">Required for changing passwords from the client</string>
<string name="label_feature_capnegotiation">Required for IRCv3 capabilities</string>
<string name="label_feature_verifyserverssl">Required for verifying the SSL certificate of IRC networks you connect to</string>
<string name="label_feature_customratelimits">Required for custom rate limits for IRC networks</string>
<string name="label_feature_awayformattimestamp">Required for custom formatted timestamps in away messages</string>
<string name="label_feature_bufferactivitysync">Required for seeing activity of chats in the chat list</string>
<string name="label_feature_coresidehighlights">Required for highlights</string>
<string name="label_feature_senderprefixes">Required for seeing prefix modes (+, @) of users in channels</string>
<string name="label_feature_remotedisconnect">Required for remote disconnects of your own clients</string>
<string name="label_feature_richmessages">Required for seeing real names or IRCv3 or Gravatar avatars in messages</string>
<string name="label_feature_backlogfiltertype">Required for receiving past notifications after connecting</string>
<string name="notification_channel_background" translatable="false">background</string> <string name="notification_channel_background" translatable="false">background</string>
<string name="notification_channel_connection_title">Connection</string> <string name="notification_channel_connection_title">Connection</string>
<string name="notification_channel_highlight" translatable="false">highlight</string> <string name="notification_channel_highlight" translatable="false">highlight</string>
<string name="notification_channel_highlight_title">Highlight</string> <string name="notification_channel_highlight_title">Highlight</string>
<string name="label_missing_features">Missing Features</string>
<string name="info_missing_features">Your core is missing features that are required for Quasseldroid to work correctly.</string>
<string name="buffer_delete_confirmation">Do you want to delete this buffer permanently?</string> <string name="buffer_delete_confirmation">Do you want to delete this buffer permanently?</string>
<string name="delete_confirmation">Are you sure you want to delete this permanently? This can not be undone.</string> <string name="delete_confirmation">Are you sure you want to delete this permanently? This can not be undone.</string>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment