Commit fc643162 authored by Thomas's avatar Thomas
Browse files

Hide self messages

parent 1b80aa8d
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
    public static List<Filter> mainFilters;
    public static List<app.fedilab.android.mastodon.client.entities.api.Account> filteredAccounts;
    public static boolean filterFetched;
    public static boolean show_boosts, show_replies, show_dms, show_art_nsfw, show_self_boosts, show_self_replies;
    public static boolean show_boosts, show_replies, show_dms, show_art_nsfw, show_self_boosts, show_self_replies, show_my_messages;
    public static String regex_home, regex_local, regex_public;
    public static BaseAccount currentAccount;
    public static iconLauncher mLauncher = iconLauncher.BUBBLES;
@@ -1206,6 +1206,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                currentUserID = currentAccount.user_id;

                show_boosts = sharedpreferences.getBoolean(getString(R.string.SET_SHOW_BOOSTS) + currentUserID + currentInstance, true);
                show_my_messages = sharedpreferences.getBoolean(getString(R.string.SET_SHOW_MY_MESSAGES) + currentUserID + currentInstance, true);
                show_self_boosts = sharedpreferences.getBoolean(getString(R.string.SET_SHOW_SELF_BOOSTS) + currentUserID + currentInstance, true);
                show_replies = sharedpreferences.getBoolean(getString(R.string.SET_SHOW_REPLIES) + currentUserID + currentInstance, true);
                show_self_replies = sharedpreferences.getBoolean(getString(R.string.SET_SHOW_SELF_REPLIES) + currentUserID + currentInstance, true);
@@ -1540,6 +1541,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                .inflate(R.menu.option_filter_toots, popup.getMenu());
        Menu menu = popup.getMenu();
        final MenuItem itemShowBoosts = menu.findItem(R.id.action_show_boosts);
        final MenuItem itemShowMyMessages = menu.findItem(R.id.action_show_my_messages);
        final MenuItem itemShowSelfBoosts = menu.findItem(R.id.action_show_self_boosts);
        final MenuItem itemShowDMs = menu.findItem(R.id.action_show_dms);
        final MenuItem itemShowReplies = menu.findItem(R.id.action_show_replies);
@@ -1550,12 +1552,14 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
            itemShowReplies.setVisible(false);
            itemShowSelfBoosts.setVisible(false);
            itemShowSelfReplies.setVisible(false);
            itemShowMyMessages.setVisible(false);
            itemShowDMs.setVisible(false);
        } else {
            itemShowBoosts.setVisible(true);
            itemShowReplies.setVisible(true);
            itemShowSelfBoosts.setVisible(true);
            itemShowSelfReplies.setVisible(true);
            itemShowMyMessages.setVisible(true);
            itemShowDMs.setVisible(true);
        }

@@ -1570,6 +1574,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
        }

        itemShowBoosts.setChecked(show_boosts);
        itemShowMyMessages.setChecked(show_my_messages);
        itemShowReplies.setChecked(show_replies);
        itemShowSelfBoosts.setChecked(show_self_boosts);
        itemShowSelfReplies.setChecked(show_self_replies);
@@ -1609,6 +1614,11 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                editor.putBoolean(getString(R.string.SET_SHOW_BOOSTS) + currentUserID + currentInstance, show_boosts);
                itemShowBoosts.setChecked(show_boosts);
                editor.apply();
            } else if (itemId == R.id.action_show_my_messages) {
                show_my_messages = !show_my_messages;
                editor.putBoolean(getString(R.string.SET_SHOW_MY_MESSAGES) + currentUserID + currentInstance, show_my_messages);
                itemShowMyMessages.setChecked(show_my_messages);
                editor.apply();
            } else if (itemId == R.id.action_show_self_boosts) {
                show_self_boosts = !show_self_boosts;
                editor.putBoolean(getString(R.string.SET_SHOW_SELF_BOOSTS) + currentUserID + currentInstance, show_self_boosts);
+10 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static app.fedilab.android.BaseMainActivity.currentInstance;
import static app.fedilab.android.BaseMainActivity.currentUserID;
import static app.fedilab.android.BaseMainActivity.show_boosts;
import static app.fedilab.android.BaseMainActivity.show_dms;
import static app.fedilab.android.BaseMainActivity.show_my_messages;
import static app.fedilab.android.BaseMainActivity.show_replies;
import static app.fedilab.android.BaseMainActivity.show_self_boosts;
import static app.fedilab.android.BaseMainActivity.show_self_replies;
@@ -635,6 +636,7 @@ public class PinnedTimelineHelper {
                .inflate(R.menu.option_filter_toots, popup.getMenu());
        Menu menu = popup.getMenu();
        final MenuItem itemShowBoosts = menu.findItem(R.id.action_show_boosts);
        final MenuItem itemShowMyMessages = menu.findItem(R.id.action_show_my_messages);
        final MenuItem itemShowSelfBoosts = menu.findItem(R.id.action_show_self_boosts);
        final MenuItem itemShowReplies = menu.findItem(R.id.action_show_replies);
        final MenuItem itemShowSelfReplies = menu.findItem(R.id.action_show_self_replies);
@@ -645,12 +647,14 @@ public class PinnedTimelineHelper {
            itemShowReplies.setVisible(false);
            itemShowSelfBoosts.setVisible(false);
            itemShowSelfReplies.setVisible(false);
            itemShowMyMessages.setVisible(false);
            itemShowDMs.setVisible(false);
        } else {
            itemShowBoosts.setVisible(true);
            itemShowReplies.setVisible(true);
            itemShowSelfBoosts.setVisible(true);
            itemShowSelfReplies.setVisible(true);
            itemShowMyMessages.setVisible(true);
            itemShowDMs.setVisible(true);
        }
        SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
@@ -664,6 +668,7 @@ public class PinnedTimelineHelper {
        }

        itemShowBoosts.setChecked(show_boosts);
        itemShowMyMessages.setChecked(show_my_messages);
        itemShowReplies.setChecked(show_replies);
        itemShowSelfBoosts.setChecked(show_self_boosts);
        itemShowSelfReplies.setChecked(show_self_replies);
@@ -702,6 +707,11 @@ public class PinnedTimelineHelper {
                editor.putBoolean(activity.getString(R.string.SET_SHOW_BOOSTS) + currentUserID + currentInstance, show_boosts);
                itemShowBoosts.setChecked(show_boosts);
                editor.apply();
            } else if (itemId == R.id.action_show_my_messages) {
                show_my_messages = !show_my_messages;
                editor.putBoolean(activity.getString(R.string.SET_SHOW_MY_MESSAGES) + currentUserID + currentInstance, show_my_messages);
                itemShowMyMessages.setChecked(show_my_messages);
                editor.apply();
            } else if (itemId == R.id.action_show_self_boosts) {
                show_self_boosts = !show_self_boosts;
                editor.putBoolean(activity.getString(R.string.SET_SHOW_SELF_BOOSTS) + currentUserID + currentInstance, show_self_boosts);
+5 −0
Original line number Diff line number Diff line
@@ -17,12 +17,14 @@ package app.fedilab.android.mastodon.ui.drawer;

import static android.content.Context.INPUT_METHOD_SERVICE;
import static app.fedilab.android.BaseMainActivity.currentAccount;
import static app.fedilab.android.BaseMainActivity.currentUserID;
import static app.fedilab.android.BaseMainActivity.emojis;
import static app.fedilab.android.BaseMainActivity.regex_home;
import static app.fedilab.android.BaseMainActivity.regex_local;
import static app.fedilab.android.BaseMainActivity.regex_public;
import static app.fedilab.android.BaseMainActivity.show_boosts;
import static app.fedilab.android.BaseMainActivity.show_dms;
import static app.fedilab.android.BaseMainActivity.show_my_messages;
import static app.fedilab.android.BaseMainActivity.show_replies;
import static app.fedilab.android.BaseMainActivity.show_self_boosts;
import static app.fedilab.android.BaseMainActivity.show_self_replies;
@@ -221,6 +223,9 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
        if (timelineType == Timeline.TimeLineEnum.HOME && !show_boosts && status.reblog != null) {
            return false;
        }
        if (timelineType == Timeline.TimeLineEnum.HOME && !show_my_messages && status.account.id.equals(currentUserID)) {
            return false;
        }
        if (timelineType == Timeline.TimeLineEnum.HOME && !show_self_boosts && status.reblog != null && status.reblog.account.id.equals(status.account.id)) {
            return false;
        }
+6 −0
Original line number Diff line number Diff line
@@ -28,6 +28,12 @@
        android:title="@string/show_self_replies"
        app:actionViewClass="android.widget.CheckBox"
        app:showAsAction="always" />
    <item
        android:id="@+id/action_show_my_messages"
        android:checkable="true"
        android:title="@string/show_my_messages"
        app:actionViewClass="android.widget.CheckBox"
        app:showAsAction="always" />
    <item
        android:id="@+id/action_show_dms"
        android:checkable="true"
+2 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@
    <string name="show_replies">Show replies</string>
    <string name="show_self_boosts">Show self boosts</string>
    <string name="show_self_replies">Show self replies</string>
    <string name="show_my_messages">Show my messages</string>
    <string name="show_privates">Show direct messages</string>
    <string name="action_open_in_web">Open in browser</string>
    <string name="translate">Translate</string>
@@ -1045,6 +1046,7 @@
    <string name="SET_TIMELINES_IN_A_LIST" translatable="false">SET_TIMELINES_IN_A_LIST</string>
    <string name="SET_LED_COLOUR_VAL_N" translatable="false">SET_LED_COLOUR_VAL_N</string>
    <string name="SET_SHOW_BOOSTS" translatable="false">SET_SHOW_BOOSTS</string>
    <string name="SET_SHOW_MY_MESSAGES" translatable="false">SET_SHOW_MY_MESSAGES</string>
    <string name="SET_SHOW_SELF_BOOSTS" translatable="false">SET_SHOW_SELF_BOOSTS</string>
    <string name="SET_SHOW_REPLIES" translatable="false">SET_SHOW_REPLIES</string>
    <string name="SET_SHOW_SELF_REPLIES" translatable="false">SET_SHOW_SELF_REPLIES</string>
Loading