Skip to content

Commit 2ae7f28

Browse files
committed
[TF][FEATURE] Hide sponsored channels
1 parent 9cec615 commit 2ae7f28

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

TMessagesProj/src/main/java/org/telegram/messenger/AndroidUtilities.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@
181181
import org.telegram.ui.Components.TypefaceSpan;
182182
import org.telegram.ui.Components.URLSpanReplacement;
183183
import org.telegram.ui.Components.UndoView;
184-
import org.telegram.ui.Components.spoilers.SpoilersTextView;
185184
import org.telegram.ui.DebugRecordingCanvasReplayFragment;
186185
import org.telegram.ui.LaunchActivity;
187186
import org.telegram.ui.Stories.PeerStoriesView;
@@ -4723,14 +4722,6 @@ public static void showProxyAlert(Activity activity, final String address, final
47234722
.show();
47244723
}
47254724
}));
4726-
if (!TextUtils.isEmpty(secret)) {
4727-
final TableView.TableRowFullContent tableRow = tableView.addFullRow(getString(R.string.UseProxyTelegramInfo2));
4728-
tableRow.setFilled(true);
4729-
final SpoilersTextView textView = (SpoilersTextView) tableRow.getChildAt(0);
4730-
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 11);
4731-
textView.setGravity(Gravity.CENTER);
4732-
}
4733-
47344725
final ButtonWithCounterView buttonView = new ButtonWithCounterView(activity, null).setRound();
47354726
buttonView.setText(getString(R.string.ConnectingConnectProxy));
47364727
buttonView.setOnClickListener(v -> {

TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,11 @@ public MessagesController(int num) {
16091609
promoPsaMessage = mainPreferences.getString("promo_psa_message", null);
16101610
promoPsaType = mainPreferences.getString("promo_psa_type", null);
16111611
proxyDialogAddress = mainPreferences.getString("proxyDialogAddress", null);
1612+
if (promoDialogType == PROMO_TYPE_PROXY) {
1613+
// never show proxy sponsored channels in the chat list
1614+
promoDialogId = 0;
1615+
proxyDialogAddress = null;
1616+
}
16121617
venueSearchBot = mainPreferences.getString("venueSearchBot", "foursquare");
16131618
storyVenueSearchBot = mainPreferences.getString("storyVenueSearchBot", "foursquare");
16141619
gifSearchBot = mainPreferences.getString("gifSearchBot", "gif");
@@ -10886,6 +10891,11 @@ private void checkPromoInfoInternal(boolean reset) {
1088610891
TLRPC.TL_help_promoDataEmpty res = (TLRPC.TL_help_promoDataEmpty) response;
1088710892
nextPromoInfoCheckTime = res.expires;
1088810893
noDialog = true;
10894+
} else if (response instanceof TLRPC.TL_help_promoData && ((TLRPC.TL_help_promoData) response).proxy) {
10895+
// never show proxy sponsored channels in the chat list
10896+
TLRPC.TL_help_promoData res = (TLRPC.TL_help_promoData) response;
10897+
nextPromoInfoCheckTime = res.expires;
10898+
noDialog = true;
1088910899
} else if (response instanceof TLRPC.TL_help_promoData) {
1089010900
TLRPC.TL_help_promoData res = (TLRPC.TL_help_promoData) response;
1089110901

TMessagesProj/src/main/java/org/telegram/ui/ProxySettingsActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public void afterTextChanged(Editable s) {
442442
if (i == 0) {
443443
bottomCells[i].setText(LocaleController.getString(R.string.UseProxyInfo));
444444
} else {
445-
bottomCells[i].setText(LocaleController.getString(R.string.UseProxyTelegramInfo) + "\n\n" + LocaleController.getString(R.string.UseProxyTelegramInfo2));
445+
bottomCells[i].setText(LocaleController.getString(R.string.UseProxyTelegramInfo));
446446
bottomCells[i].setVisibility(View.GONE);
447447
}
448448
linearLayout2.addView(bottomCells[i], LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));

0 commit comments

Comments
 (0)