More work on patchsets

This commit is contained in:
clienthax 2021-01-02 16:41:50 +00:00
parent 63673d4ce1
commit 34ed66d290
6 changed files with 116 additions and 1 deletions

View file

@ -1,12 +1,38 @@
package com.discord.models.domain;
import com.discord.stores.StoreStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import lanchon.dexpatcher.annotation.DexEdit;
import lanchon.dexpatcher.annotation.DexIgnore;
import lanchon.dexpatcher.annotation.DexWrap;
@DexIgnore
@DexEdit
public class ModelChannel implements Model {
// supplemental patch
@DexWrap
public Map<Long, ModelPermissionOverwrite> getPermissionOverwrites() {
// Allows us to see all channels
if (StoreStream.getUserSettings().getLeakChannels()) {
return EMPTY_PERMISSION_OVERWRITES;
}
return getPermissionOverwrites();
}
// end
// class setup
@DexIgnore
private static final Map<Long, ModelPermissionOverwrite> EMPTY_PERMISSION_OVERWRITES = new HashMap();
@DexIgnore
@Override
public void assignField(JsonReader jsonReader) throws IOException {

View file

@ -1,12 +1,14 @@
package com.discord.models.domain;
import com.PatchConfig;
import com.discord.stores.StoreStream;
import com.discordtest.BuildConfig;
import java.io.IOException;
import lanchon.dexpatcher.annotation.DexEdit;
import lanchon.dexpatcher.annotation.DexIgnore;
import lanchon.dexpatcher.annotation.DexReplace;
import lanchon.dexpatcher.annotation.DexWrap;
@DexEdit
@ -26,6 +28,23 @@ public class ModelMessageEmbed implements Model {
// end of nospoiler patch
// supplemental patch
// Enable gif autoplaying
@DexReplace
public boolean isVideo() {
String str = this.type;
boolean equals = str.equals("video");
return !StoreStream.getUserSettings().getAutoplayGifs() ? equals | str.equals("gifv") : equals;
}
// end
// class setup
@DexIgnore
private String type;
// Interfaces
@DexIgnore

View file

@ -0,0 +1,13 @@
package com.discord.models.domain;
import java.io.IOException;
import lanchon.dexpatcher.annotation.DexIgnore;
@DexIgnore
public class ModelPermissionOverwrite implements Model {
@DexIgnore
@Override
public void assignField(JsonReader jsonReader) throws IOException {
}
}

View file

@ -0,0 +1,34 @@
package com.discord.utilities.rest;
import com.discord.stores.StoreStream;
import lanchon.dexpatcher.annotation.DexAdd;
import lanchon.dexpatcher.annotation.DexEdit;
import lanchon.dexpatcher.annotation.DexIgnore;
import rx.Emitter;
import rx.functions.Action1;
@DexEdit
public final class SendUtils$getPart$1<T> implements Action1<Emitter<SendUtils.FileUpload>> {
// supplemental patch
@DexAdd
public static final String interceptFilename(String str) {
if (!StoreStream.getUserSettings().getImageSpoiler()) {
return str;
}
return "SPOILER_" + str;
}
// TODO see if theres a way to target the lambda directly..
@DexIgnore
@Override
public final void call(Emitter<SendUtils.FileUpload> emitter) {
}
// end
}

View file

@ -0,0 +1,14 @@
package com.discord.utilities.rest;
import lanchon.dexpatcher.annotation.DexEdit;
import lanchon.dexpatcher.annotation.DexIgnore;
@DexIgnore
public final class SendUtils {
@DexIgnore
public static final class FileUpload {
}
}

View file

@ -0,0 +1,9 @@
package rx;
import g0.g;
import lanchon.dexpatcher.annotation.DexIgnore;
@DexIgnore
public interface Emitter<T> extends g<T> {
}