More work on patchsets
This commit is contained in:
parent
63673d4ce1
commit
34ed66d290
6 changed files with 116 additions and 1 deletions
|
@ -1,11 +1,37 @@
|
|||
package com.discord.models.domain;
|
||||
|
||||
import java.io.IOException;
|
||||
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;
|
||||
|
||||
@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
|
||||
public class ModelChannel implements Model {
|
||||
private static final Map<Long, ModelPermissionOverwrite> EMPTY_PERMISSION_OVERWRITES = new HashMap();
|
||||
|
||||
@DexIgnore
|
||||
@Override
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
||||
}
|
14
app/src/main/java/com/discord/utilities/rest/SendUtils.java
Normal file
14
app/src/main/java/com/discord/utilities/rest/SendUtils.java
Normal 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 {
|
||||
|
||||
}
|
||||
|
||||
}
|
9
app/src/main/java/rx/Emitter.java
Normal file
9
app/src/main/java/rx/Emitter.java
Normal file
|
@ -0,0 +1,9 @@
|
|||
package rx;
|
||||
|
||||
import g0.g;
|
||||
import lanchon.dexpatcher.annotation.DexIgnore;
|
||||
|
||||
@DexIgnore
|
||||
public interface Emitter<T> extends g<T> {
|
||||
|
||||
}
|
Loading…
Reference in a new issue