Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable sensitive content filtering #43

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
boringssl:
name: Native Build (BoringSSL)
runs-on: ubuntu-latest
needs: check
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.telegram.messenger.MediaController;
import org.telegram.messenger.R;
import org.telegram.tgnet.TLRPC;
import org.telegram.tgnet.tl.TL_account;
import org.telegram.ui.ActionBar.ActionBar;
import org.telegram.ui.ActionBar.AlertDialog;
import org.telegram.ui.ActionBar.Theme;
Expand Down Expand Up @@ -282,7 +283,7 @@ public void onItemClick(int id) {
} else if (a instanceof ConfigCellCustom) { // Custom onclick
if (position == cellGroup.rows.indexOf(disableFilteringRow)) {
sensitiveEnabled = !sensitiveEnabled;
TLRPC.TL_account_setContentSettings req = new TLRPC.TL_account_setContentSettings();
TL_account.setContentSettings req = new TL_account.setContentSettings();
req.sensitive_enabled = sensitiveEnabled;
AlertDialog progressDialog = new AlertDialog(getParentActivity(), 3);
progressDialog.show();
Expand Down Expand Up @@ -502,10 +503,10 @@ public ArrayList<ThemeDescription> getThemeDescriptions() {
}

private void checkSensitive() {
TLRPC.TL_account_getContentSettings req = new TLRPC.TL_account_getContentSettings();
TL_account.getContentSettings req = new TL_account.getContentSettings();
getConnectionsManager().sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Add error handling for the case where the request fails

Currently, if the request fails (error != null), the UI state won't be updated. This could lead to inconsistent state. Consider handling the error case appropriately.

if (error == null) {
TLRPC.TL_account_contentSettings settings = (TLRPC.TL_account_contentSettings) response;
TL_account.contentSettings settings = (TL_account.contentSettings) response;
sensitiveEnabled = settings.sensitive_enabled;
sensitiveCanChange = settings.sensitive_can_change;
int count = listView.getChildCount();
Expand Down