├── BetterStatus
├── src
│ └── main
│ │ ├── java
│ │ ├── c
│ │ │ ├── d
│ │ │ │ └── b
│ │ │ │ │ └── a
│ │ │ │ │ └── a.java
│ │ │ └── a
│ │ │ │ └── o
│ │ │ │ └── t
│ │ │ │ └── c
│ │ │ │ └── a.java
│ │ ├── com
│ │ │ ├── discord
│ │ │ │ ├── api
│ │ │ │ │ ├── activity
│ │ │ │ │ │ ├── ActivityPlatform.java
│ │ │ │ │ │ ├── ActivityTypeTypeAdapter.java
│ │ │ │ │ │ ├── ActivityFlags.java
│ │ │ │ │ │ ├── ActivityTimestampsKt.java
│ │ │ │ │ │ ├── ActivityPlatformTypeAdapter.java
│ │ │ │ │ │ ├── Activity.java
│ │ │ │ │ │ ├── ActivityParty.java
│ │ │ │ │ │ ├── ActivityAssets.java
│ │ │ │ │ │ ├── ActivityMetadata.java
│ │ │ │ │ │ ├── ActivityEmoji.java
│ │ │ │ │ │ ├── ActivityActionConfirmation.java
│ │ │ │ │ │ ├── ActivityTimestamps.java
│ │ │ │ │ │ └── ActivityType.java
│ │ │ │ │ └── presence
│ │ │ │ │ │ ├── ClientStatus.java
│ │ │ │ │ │ └── ClientStatuses.java
│ │ │ │ ├── models
│ │ │ │ │ └── presence
│ │ │ │ │ │ └── Presence.java
│ │ │ │ └── stores
│ │ │ │ │ └── StoreUserPresence.java
│ │ │ └── aliucord
│ │ │ │ └── plugins
│ │ │ │ ├── betterstatus
│ │ │ │ └── PresenceUtils.java
│ │ │ │ └── BetterStatus.java
│ │ └── c0
│ │ │ └── z
│ │ │ └── d
│ │ │ └── m.java
│ │ ├── AndroidManifest.xml
│ │ └── res
│ │ └── drawable
│ │ ├── ic_idle.xml
│ │ ├── ic_dnd.xml
│ │ ├── ic_online.xml
│ │ ├── ic_profile_radial_status.xml
│ │ ├── ic_radial_status.xml
│ │ ├── ic_rectangle_status.xml
│ │ ├── ic_profile_rectangle_status.xml
│ │ ├── ic_rectangle_status_cml.xml
│ │ ├── ic_desktop.xml
│ │ ├── ic_desktop_dnd.xml
│ │ ├── ic_desktop_idle.xml
│ │ ├── ic_status_invisible_16dp.xml
│ │ ├── ic_web.xml
│ │ ├── ic_web_idle.xml
│ │ ├── ic_mobile.xml
│ │ ├── ic_mobile_dnd.xml
│ │ ├── ic_mobile_idle.xml
│ │ ├── ic_web_dnd.xml
│ │ ├── ic_desktop_mobile.xml
│ │ ├── ic_desktop_mobile_dnd.xml
│ │ ├── ic_desktop_mobile_idle.xml
│ │ ├── ic_desktop_web.xml
│ │ ├── ic_desktop_web_dnd.xml
│ │ ├── ic_desktop_web_idle.xml
│ │ ├── ic_web_mobile.xml
│ │ ├── ic_web_mobile_dnd.xml
│ │ ├── ic_web_mobile_idle.xml
│ │ ├── ic_desktop_web_mobile.xml
│ │ ├── ic_desktop_web_mobile_dnd.xml
│ │ └── ic_desktop_web_mobile_idle.xml
└── build.gradle.kts
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── settings.gradle.kts
├── .gitignore
├── updater.json
├── README.md
├── gradle.properties
├── .github
└── workflows
│ └── build.yml
├── gradlew.bat
├── gradlew
└── LICENSE
/BetterStatus/src/main/java/c/d/b/a/a.java:
--------------------------------------------------------------------------------
1 | package c.d.b.a;
2 |
3 | public class a {
4 | }
5 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/c/a/o/t/c/a.java:
--------------------------------------------------------------------------------
1 | package c.a.o.t.c;
2 |
3 | public class a {
4 | }
5 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityPlatform.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityTypeTypeAdapter.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peter1599/Aliucord-plugins/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/BetterStatus/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | // include(":MyFirstPlugin")
2 |
3 | include(":BetterStatus")
4 |
5 | rootProject.name = "Aliucord-plugins"
6 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityFlags.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
3 | public final class ActivityFlags {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea
5 | .DS_Store
6 | /build
7 | /captures
8 | .externalNativeBuild
9 | .cxx
10 | local.properties
11 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityTimestampsKt.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
3 | public final class ActivityTimestampsKt {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityPlatformTypeAdapter.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
3 | public final class ActivityPlatformTypeAdapter {
4 |
5 | }
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/Activity.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
3 |
4 | public final class Activity {
5 | public final Long a() {
6 | return null;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityParty.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
3 | public final class ActivityParty {
4 | public final String a() {
5 | return null;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityAssets.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
3 |
4 | public final class ActivityAssets {
5 | public final String a() {
6 | return null;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityMetadata.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
3 | public final class ActivityMetadata {
4 | public final String a() {
5 | return null;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/presence/ClientStatus.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.presence;
2 |
3 | public enum ClientStatus {
4 | ONLINE,
5 | IDLE,
6 | DND,
7 | INVISIBLE,
8 | OFFLINE
9 | }
10 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityEmoji.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
3 | public final class ActivityEmoji {
4 | public final boolean a() {
5 | return Boolean.parseBoolean(null);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityActionConfirmation.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
3 |
4 | public final class ActivityActionConfirmation {
5 | public final String a() {
6 | return null;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityTimestamps.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
3 | public final class ActivityTimestamps {
4 | public final long a(String str) {
5 | return Long.parseLong(null);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_idle.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_dnd.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_online.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jun 09 16:18:24 EST 2021
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
7 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_profile_radial_status.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/updater.json:
--------------------------------------------------------------------------------
1 | {
2 | "default": {
3 | "minimumDiscordVersion": 105112,
4 | "version": "1.0.0",
5 | "build": "https://raw.githubusercontent.com/peter1599/Aliucord-plugins/builds/%s.zip"
6 | },
7 | "BetterStatus": {
8 | "version": "1.1.5"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_radial_status.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_rectangle_status.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_profile_rectangle_status.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
8 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_rectangle_status_cml.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/presence/ClientStatuses.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.presence;
2 |
3 | public final class ClientStatuses {
4 |
5 | public final ClientStatus a() {
6 | return null;
7 | }
8 |
9 | public final ClientStatus b() {
10 | return null;
11 | }
12 |
13 | public final ClientStatus c() {
14 | return null;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop_dnd.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop_idle.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_status_invisible_16dp.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/api/activity/ActivityType.java:
--------------------------------------------------------------------------------
1 | package com.discord.api.activity;
2 |
3 | public enum ActivityType {
4 | PLAYING(0),
5 | STREAMING(1),
6 | LISTENING(2),
7 | WATCHING(3),
8 | CUSTOM_STATUS(4),
9 | COMPETING(5),
10 | UNKNOWN(-1);
11 |
12 | private final int apiInt;
13 |
14 | private ActivityType(int i) {
15 | this.apiInt = i;
16 | }
17 |
18 | public final int getApiInt$discord_api() {
19 | return this.apiInt;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_web.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/models/presence/Presence.java:
--------------------------------------------------------------------------------
1 | package com.discord.models.presence;
2 |
3 | import com.discord.api.activity.Activity;
4 | import com.discord.api.presence.ClientStatus;
5 | import com.discord.api.presence.ClientStatuses;
6 |
7 | import java.util.List;
8 |
9 | public final class Presence {
10 | public final ClientStatuses getClientStatuses() {
11 | return null;
12 | }
13 |
14 | public final ClientStatus getStatus() {
15 | return null;
16 | }
17 |
18 | public final List getActivities()
19 | {
20 | return null;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_web_idle.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_mobile.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_mobile_dnd.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_mobile_idle.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_web_dnd.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop_mobile.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop_mobile_dnd.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop_mobile_idle.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # `Aliucord-plugins`
2 |
3 | ## How To Download
4 | Download plugins from `builds` branch to `Aliucord/plugins`. Please do not rename plugin file.
5 |
6 | ## Plugins
7 |
8 | ### BetterStatus
9 | Replaces Discord default status icons with better ones.
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/discord/stores/StoreUserPresence.java:
--------------------------------------------------------------------------------
1 | package com.discord.stores;
2 |
3 | import com.discord.models.presence.Presence;
4 | import com.discord.utilities.collections.SnowflakePartitionMap;
5 |
6 | import kotlin.jvm.internal.DefaultConstructorMarker;
7 |
8 | public class StoreUserPresence extends StoreV2 {
9 |
10 | private final SnowflakePartitionMap.CopiablePartitionMap presences = new SnowflakePartitionMap.CopiablePartitionMap<>(0, 1, (DefaultConstructorMarker) null);
11 | private Presence localPresence;
12 |
13 | public SnowflakePartitionMap.CopiablePartitionMap getPresences() {
14 | return this.presences;
15 | }
16 |
17 | public final Presence getLocalPresence$app_productionCanaryRelease() {
18 | return this.localPresence;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop_web.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop_web_dnd.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop_web_idle.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_web_mobile.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_web_mobile_dnd.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_web_mobile_idle.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop_web_mobile.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop_web_mobile_dnd.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/res/drawable/ic_desktop_web_mobile_idle.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-20.04
11 | steps:
12 | - name: Checkout
13 | uses: actions/checkout@master
14 | with:
15 | path: "src"
16 |
17 | - name: Checkout builds
18 | uses: actions/checkout@master
19 | with:
20 | ref: "builds"
21 | path: "builds"
22 |
23 | - name: Checkout Aliucord
24 | uses: actions/checkout@master
25 | with:
26 | repository: "Aliucord/Aliucord"
27 | path: "repo"
28 |
29 | - name: Setup JDK 11
30 | uses: actions/setup-java@v1
31 | with:
32 | java-version: 11
33 |
34 | - name: Setup Android SDK
35 | uses: android-actions/setup-android@v2
36 |
37 | - name: Build Plugins
38 | run: |
39 | cd $GITHUB_WORKSPACE/src
40 | chmod +x gradlew
41 | ./gradlew make
42 | cp **/build/*.zip $GITHUB_WORKSPACE/builds
43 |
44 | - name: Push builds
45 | run: |
46 | cd $GITHUB_WORKSPACE/builds
47 | cp ../src/updater.json .
48 | git config --local user.email "actions@github.com"
49 | git config --local user.name "GitHub Actions"
50 | git add .
51 | git pull
52 | git commit -m "Build $GITHUB_SHA" || exit 0 # do not error if nothing to commit
53 | git push
54 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/c0/z/d/m.java:
--------------------------------------------------------------------------------
1 | package c0.z.d;
2 |
3 | import java.util.Arrays;
4 | import java.lang.Thread;
5 |
6 | public class m {
7 | public static String a(String str) {
8 | StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[4];
9 | String className = stackTraceElement.getClassName();
10 | String methodName = stackTraceElement.getMethodName();
11 | return "Parameter specified as non-null is null: method " + className + "." + methodName + ", parameter " + str;
12 | }
13 |
14 | public static boolean areEqual(Object obj, Object obj2) {
15 | if (obj == null) {
16 | return obj2 == null;
17 | }
18 | return obj.equals(obj2);
19 | }
20 |
21 | public static T b(T t, String str) {
22 | StackTraceElement[] stackTrace = t.getStackTrace();
23 | int length = stackTrace.length;
24 | int i = -1;
25 | for (int i2 = 0; i2 < length; i2++) {
26 | if (str.equals(stackTrace[i2].getClassName())) {
27 | i = i2;
28 | }
29 | }
30 | t.setStackTrace((StackTraceElement[]) Arrays.copyOfRange(stackTrace, i + 1, length));
31 | return t;
32 | }
33 |
34 | public static void checkNotNullParameter(Object obj, String str) {
35 | if (obj == null) {
36 | NullPointerException nullPointerException = new NullPointerException(a(str));
37 | b(nullPointerException, m.class.getName());
38 | throw nullPointerException;
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/BetterStatus/build.gradle.kts:
--------------------------------------------------------------------------------
1 | version = "1.1.5"
2 | description = "BetterStatus replaces default discord status icons"
3 |
4 | aliucord {
5 | changelog.set("""
6 | # 1.1.5 Known Issues:
7 | * Resizing bug
8 | * AlwaysAnimate compatibilty
9 | # 1.1.5
10 | * Fixed error spamming
11 | # 1.1.4 Known Issues:
12 | * Resizing bug
13 | * NOTE: I will push another update today to add AlwaysAnimate compatibilty again cause i previously messed up the checks and i have to redo. Please be patient.
14 | # 1.1.4
15 | * Added a new option Voice Status: Shows the status ring around the speaking user based on their status instead of only green. This means you can see the speaking user(s) status in voice channels now.
16 | * Fixed SquareAvatars compatibilty
17 | # 1.1.3 Known Issues:
18 | * Resizing bug
19 | * ChannelMembersList showing wrong status icons and ring sometimes
20 | # 1.1.3
21 | * Fixed another small bug
22 | # 1.1.2 Known Issues:
23 | * Resizing bug
24 | * ChannelMembersList showing wrong status icons and ring sometimes
25 | # 1.1.2
26 | * Fixed a small bug
27 | # 1.1.1 Known Issues:
28 | * Resizing bug
29 | * ChannelMembersList showing wrong status icons and ring sometimes
30 | # 1.1.1
31 | * Fixed AlwaysAnimate compatibility
32 | # 1.1.0 Known Issues:
33 | * Resizing bug
34 | * ChannelMembersList showing wrong status icons and ring sometimes
35 | # 1.1.0
36 | * Fixed Themer compatibilty (probably)
37 | # 1.0.9 Known Issues:
38 | * Resizing bug
39 | * ChannelMembersList showing wrong status icons and ring sometimes
40 | # 1.0.9
41 | * Fixed own user had random status
42 | * Fixed status icons not rendering correctly on ChannelMembersList
43 | # 1.0.8 Known Issues:
44 | * Own avatar still gets radial status
45 | * Resizing bug still exists
46 | * ChannelMembersList sometimes shows "wrong" status icon(s) and the icons dont rendering correctly. Just scroll down a few and then back up or vice-versa and it will show the icons.
47 | # 1.0.8
48 | * Optimizations and bug fixes. (Huge thanks for mantikafasi#4444, ID: 287555395151593473)
49 | * Fixed offline users had radial status (mantikafasi#4444)
50 | * Added a new option toggle, Chat Status: Displays a little status circle next to usernames.
51 | * Added a new option toggle, RadialStatus (Chat): Shows a status ring around the user avatar in the Chat.
52 | # 1.0.7 Known Issues:
53 | * I know there is resizing bug. Please dont post screenshots about it in support channel or anywhere and dont DM me about it. Im still working on it to fix it.
54 | * The icons dont rendering on the channel member list. Just scroll down a few and then back up and it will show the icons. I will push an update for this if I figured out how to reredner.
55 | * Invisible or Offline users have radial status (sometimes). I know. Fix coming soon.
56 | # 1.0.7
57 | * Added compatibilty to work with Square Avatars plugin from Juby210#0577
58 | # 1.0.6
59 | * A little fix
60 | # 1.0.5
61 | * Added RadialStatus with 3 options (DM's, ChannelsMemeberList and UserProfile)
62 | # 1.0.4
63 | * Improved icons displaying positions
64 | # 1.0.3
65 | * Added an option to use filled color status icons
66 | # 1.0.2
67 | * Fixed some codes
68 | # 1.0.1
69 | * Fixed error spamming in debug
70 | * Changed status icons from png to svg
71 | # 1.0.0
72 | * Released
73 | """.trimIndent())
74 | }
75 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Open Software License ("OSL") v. 3.0
2 |
3 | This Open Software License (the "License") applies to any original work of
4 | authorship (the "Original Work") whose owner (the "Licensor") has placed the
5 | following licensing notice adjacent to the copyright notice for the Original
6 | Work:
7 |
8 | Licensed under the Open Software License version 3.0
9 |
10 | 1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free,
11 | non-exclusive, sublicensable license, for the duration of the copyright, to do
12 | the following:
13 |
14 | a) to reproduce the Original Work in copies, either alone or as part of a
15 | collective work;
16 |
17 | b) to translate, adapt, alter, transform, modify, or arrange the Original
18 | Work, thereby creating derivative works ("Derivative Works") based upon the
19 | Original Work;
20 |
21 | c) to distribute or communicate copies of the Original Work and Derivative
22 | Works to the public, with the proviso that copies of Original Work or
23 | Derivative Works that You distribute or communicate shall be licensed under
24 | this Open Software License;
25 |
26 | d) to perform the Original Work publicly; and
27 |
28 | e) to display the Original Work publicly.
29 |
30 | 2) Grant of Patent License. Licensor grants You a worldwide, royalty-free,
31 | non-exclusive, sublicensable license, under patent claims owned or controlled
32 | by the Licensor that are embodied in the Original Work as furnished by the
33 | Licensor, for the duration of the patents, to make, use, sell, offer for sale,
34 | have made, and import the Original Work and Derivative Works.
35 |
36 | 3) Grant of Source Code License. The term "Source Code" means the preferred
37 | form of the Original Work for making modifications to it and all available
38 | documentation describing how to modify the Original Work. Licensor agrees to
39 | provide a machine-readable copy of the Source Code of the Original Work along
40 | with each copy of the Original Work that Licensor distributes. Licensor
41 | reserves the right to satisfy this obligation by placing a machine-readable
42 | copy of the Source Code in an information repository reasonably calculated to
43 | permit inexpensive and convenient access by You for as long as Licensor
44 | continues to distribute the Original Work.
45 |
46 | 4) Exclusions From License Grant. Neither the names of Licensor, nor the names
47 | of any contributors to the Original Work, nor any of their trademarks or
48 | service marks, may be used to endorse or promote products derived from this
49 | Original Work without express prior permission of the Licensor. Except as
50 | expressly stated herein, nothing in this License grants any license to
51 | Licensor's trademarks, copyrights, patents, trade secrets or any other
52 | intellectual property. No patent license is granted to make, use, sell, offer
53 | for sale, have made, or import embodiments of any patent claims other than the
54 | licensed claims defined in Section 2. No license is granted to the trademarks
55 | of Licensor even if such marks are included in the Original Work. Nothing in
56 | this License shall be interpreted to prohibit Licensor from licensing under
57 | terms different from this License any Original Work that Licensor otherwise
58 | would have a right to license.
59 |
60 | 5) External Deployment. The term "External Deployment" means the use,
61 | distribution, or communication of the Original Work or Derivative Works in any
62 | way such that the Original Work or Derivative Works may be used by anyone
63 | other than You, whether those works are distributed or communicated to those
64 | persons or made available as an application intended for use over a network.
65 | As an express condition for the grants of license hereunder, You must treat
66 | any External Deployment by You of the Original Work or a Derivative Work as a
67 | distribution under section 1(c).
68 |
69 | 6) Attribution Rights. You must retain, in the Source Code of any Derivative
70 | Works that You create, all copyright, patent, or trademark notices from the
71 | Source Code of the Original Work, as well as any notices of licensing and any
72 | descriptive text identified therein as an "Attribution Notice." You must cause
73 | the Source Code for any Derivative Works that You create to carry a prominent
74 | Attribution Notice reasonably calculated to inform recipients that You have
75 | modified the Original Work.
76 |
77 | 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
78 | the copyright in and to the Original Work and the patent rights granted herein
79 | by Licensor are owned by the Licensor or are sublicensed to You under the
80 | terms of this License with the permission of the contributor(s) of those
81 | copyrights and patent rights. Except as expressly stated in the immediately
82 | preceding sentence, the Original Work is provided under this License on an "AS
83 | IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without
84 | limitation, the warranties of non-infringement, merchantability or fitness for
85 | a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK
86 | IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this
87 | License. No license to the Original Work is granted by this License except
88 | under this disclaimer.
89 |
90 | 8) Limitation of Liability. Under no circumstances and under no legal theory,
91 | whether in tort (including negligence), contract, or otherwise, shall the
92 | Licensor be liable to anyone for any indirect, special, incidental, or
93 | consequential damages of any character arising as a result of this License or
94 | the use of the Original Work including, without limitation, damages for loss
95 | of goodwill, work stoppage, computer failure or malfunction, or any and all
96 | other commercial damages or losses. This limitation of liability shall not
97 | apply to the extent applicable law prohibits such limitation.
98 |
99 | 9) Acceptance and Termination. If, at any time, You expressly assented to this
100 | License, that assent indicates your clear and irrevocable acceptance of this
101 | License and all of its terms and conditions. If You distribute or communicate
102 | copies of the Original Work or a Derivative Work, You must make a reasonable
103 | effort under the circumstances to obtain the express assent of recipients to
104 | the terms of this License. This License conditions your rights to undertake
105 | the activities listed in Section 1, including your right to create Derivative
106 | Works based upon the Original Work, and doing so without honoring these terms
107 | and conditions is prohibited by copyright law and international treaty.
108 | Nothing in this License is intended to affect copyright exceptions and
109 | limitations (including "fair use" or "fair dealing"). This License shall
110 | terminate immediately and You may no longer exercise any of the rights granted
111 | to You by this License upon your failure to honor the conditions in Section
112 | 1(c).
113 |
114 | 10) Termination for Patent Action. This License shall terminate automatically
115 | and You may no longer exercise any of the rights granted to You by this
116 | License as of the date You commence an action, including a cross-claim or
117 | counterclaim, against Licensor or any licensee alleging that the Original Work
118 | infringes a patent. This termination provision shall not apply for an action
119 | alleging patent infringement by combinations of the Original Work with other
120 | software or hardware.
121 |
122 | 11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
123 | License may be brought only in the courts of a jurisdiction wherein the
124 | Licensor resides or in which Licensor conducts its primary business, and under
125 | the laws of that jurisdiction excluding its conflict-of-law provisions. The
126 | application of the United Nations Convention on Contracts for the
127 | International Sale of Goods is expressly excluded. Any use of the Original
128 | Work outside the scope of this License or after its termination shall be
129 | subject to the requirements and penalties of copyright or patent law in the
130 | appropriate jurisdiction. This section shall survive the termination of this
131 | License.
132 |
133 | 12) Attorneys' Fees. In any action to enforce the terms of this License or
134 | seeking damages relating thereto, the prevailing party shall be entitled to
135 | recover its costs and expenses, including, without limitation, reasonable
136 | attorneys' fees and costs incurred in connection with such action, including
137 | any appeal of such action. This section shall survive the termination of this
138 | License.
139 |
140 | 13) Miscellaneous. If any provision of this License is held to be
141 | unenforceable, such provision shall be reformed only to the extent necessary
142 | to make it enforceable.
143 |
144 | 14) Definition of "You" in This License. "You" throughout this License,
145 | whether in upper or lower case, means an individual or a legal entity
146 | exercising rights under, and complying with all of the terms of, this License.
147 | For legal entities, "You" includes any entity that controls, is controlled by,
148 | or is under common control with you. For purposes of this definition,
149 | "control" means (i) the power, direct or indirect, to cause the direction or
150 | management of such entity, whether by contract or otherwise, or (ii) ownership
151 | of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
152 | ownership of such entity.
153 |
154 | 15) Right to Use. You may use the Original Work in all ways not otherwise
155 | restricted or conditioned by this License or by law, and Licensor promises not
156 | to interfere with or be responsible for such uses by You.
157 |
158 | 16) Modification of This License. This License is Copyright © 2005 Lawrence
159 | Rosen. Permission is granted to copy, distribute, or communicate this License
160 | without modification. Nothing in this License permits You to modify this
161 | License as applied to the Original Work or to Derivative Works. However, You
162 | may modify the text of this License and copy, distribute or communicate your
163 | modified version (the "Modified License") and apply it to other original works
164 | of authorship subject to the following conditions: (i) You may not indicate in
165 | any way that your Modified License is the "Open Software License" or "OSL" and
166 | you may not use those names in the name of your Modified License; (ii) You
167 | must replace the notice specified in the first paragraph above with the notice
168 | "Licensed under " or with a notice of your own
169 | that is not confusingly similar to the notice in this License; and (iii) You
170 | may not claim that your original works are open source software unless your
171 | Modified License has been approved by Open Source Initiative (OSI) and You
172 | comply with its license review and certification process.
173 |
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/aliucord/plugins/betterstatus/PresenceUtils.java:
--------------------------------------------------------------------------------
1 | /*package com.aliucord.plugins.betterstatus;
2 |
3 | import c0.z.d.m;
4 | import com.discord.api.activity.Activity;
5 | import com.discord.api.activity.ActivityType;
6 | import com.discord.api.presence.ClientStatus;
7 | import com.discord.api.presence.ClientStatuses;
8 | import com.discord.models.presence.Presence;
9 |
10 | import java.util.List;
11 |
12 | public final class PresenceUtils {
13 | public static final PresenceUtils INSTANCE = new PresenceUtils();
14 |
15 | public final boolean isDesktop(ClientStatuses clientStatuses)
16 | {
17 | ClientStatus a = clientStatuses.a();
18 | ClientStatus clientStatus = ClientStatus.ONLINE;
19 | return a == clientStatus && clientStatuses.b() != clientStatus && clientStatuses.c() != clientStatus;
20 | }
21 |
22 | public final boolean isDesktopAndMobile(ClientStatuses clientStatuses) {
23 | ClientStatus a = clientStatuses.a();
24 | ClientStatus clientStatus = ClientStatus.ONLINE;
25 | return a == clientStatus && clientStatuses.b() == clientStatus && clientStatuses.c() != clientStatus;
26 | }
27 |
28 | public final boolean isDesktopAndMobileDND(ClientStatuses clientStatuses) {
29 | ClientStatus a = clientStatuses.a();
30 | ClientStatus clientStatus = ClientStatus.DND;
31 | return a == clientStatus && clientStatuses.b() == clientStatus && clientStatuses.c() != clientStatus;
32 | }
33 |
34 | public final boolean isDesktopAndMobileIDLE(ClientStatuses clientStatuses) {
35 | ClientStatus a = clientStatuses.a();
36 | ClientStatus clientStatus = ClientStatus.IDLE;
37 | return a == clientStatus && clientStatuses.b() == clientStatus && clientStatuses.c() != clientStatus;
38 | }
39 |
40 | public final boolean isDesktopAndWeb(ClientStatuses clientStatuses) {
41 | ClientStatus a = clientStatuses.a();
42 | ClientStatus clientStatus = ClientStatus.ONLINE;
43 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() != clientStatus;
44 | }
45 |
46 | public final boolean isDesktopAndWebDND(ClientStatuses clientStatuses) {
47 | ClientStatus a = clientStatuses.a();
48 | ClientStatus clientStatus = ClientStatus.DND;
49 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() != clientStatus;
50 | }
51 |
52 | public final boolean isDesktopAndWebIDLE(ClientStatuses clientStatuses) {
53 | ClientStatus a = clientStatuses.a();
54 | ClientStatus clientStatus = ClientStatus.IDLE;
55 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() != clientStatus;
56 | }
57 |
58 | public final boolean isDesktopDND(ClientStatuses clientStatuses) {
59 | ClientStatus a = clientStatuses.a();
60 | ClientStatus clientStatus = ClientStatus.DND;
61 | return a == clientStatus && clientStatuses.b() != clientStatus && clientStatuses.c() != clientStatus;
62 | }
63 |
64 | public final boolean isDesktopIDLE(ClientStatuses clientStatuses) {
65 | ClientStatus a = clientStatuses.a();
66 | ClientStatus clientStatus = ClientStatus.IDLE;
67 | return a == clientStatus && clientStatuses.b() != clientStatus && clientStatuses.c() != clientStatus;
68 | }
69 |
70 | public final boolean isDesktopWebMobile(ClientStatuses clientStatuses) {
71 | ClientStatus a = clientStatuses.a();
72 | ClientStatus clientStatus = ClientStatus.ONLINE;
73 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() == clientStatus;
74 | }
75 |
76 | public final boolean isDesktopWebMobileDND(ClientStatuses clientStatuses) {
77 | ClientStatus a = clientStatuses.a();
78 | ClientStatus clientStatus = ClientStatus.DND;
79 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() == clientStatus;
80 | }
81 |
82 | public final boolean isDesktopWebMobileIDLE(ClientStatuses clientStatuses) {
83 | ClientStatus a = clientStatuses.a();
84 | ClientStatus clientStatus = ClientStatus.IDLE;
85 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() == clientStatus;
86 | }
87 |
88 | public final boolean isMobile(final ClientStatuses clientStatuses) {
89 | final ClientStatus b = clientStatuses.b();
90 | final ClientStatus online = ClientStatus.ONLINE;
91 | return b == online && clientStatuses.c() != online && clientStatuses.a() != online;
92 | }
93 |
94 | public final boolean isMobileDND(final ClientStatuses clientStatuses) {
95 | final ClientStatus b = clientStatuses.b();
96 | final ClientStatus dnd = ClientStatus.DND;
97 | return b == dnd && clientStatuses.c() != dnd && clientStatuses.a() != dnd;
98 | }
99 |
100 | public final boolean isMobileIDLE(final ClientStatuses clientStatuses) {
101 | final ClientStatus b = clientStatuses.b();
102 | final ClientStatus idle = ClientStatus.IDLE;
103 | return b == idle && clientStatuses.c() != idle && clientStatuses.a() != idle;
104 | }
105 |
106 | public final boolean isWeb(final ClientStatuses clientStatuses) {
107 | final ClientStatus c = clientStatuses.c();
108 | final ClientStatus online = ClientStatus.ONLINE;
109 | return c == online && clientStatuses.b() != online && clientStatuses.a() != online;
110 | }
111 |
112 | public final boolean isWebDND(final ClientStatuses clientStatuses) {
113 | final ClientStatus c = clientStatuses.c();
114 | final ClientStatus dnd = ClientStatus.DND;
115 | return c == dnd && clientStatuses.b() != dnd && clientStatuses.a() != dnd;
116 | }
117 |
118 | public final boolean isWebIDLE(final ClientStatuses clientStatuses) {
119 | final ClientStatus c = clientStatuses.c();
120 | final ClientStatus idle = ClientStatus.IDLE;
121 | return c == idle && clientStatuses.b() != idle && clientStatuses.a() != idle;
122 | }
123 |
124 | public final boolean isWebMobile(final ClientStatuses clientStatuses) {
125 | final ClientStatus c = clientStatuses.c();
126 | final ClientStatus online = ClientStatus.ONLINE;
127 | return c == online && clientStatuses.b() == online && clientStatuses.a() != online;
128 | }
129 |
130 | public final boolean isWebMobileDND(final ClientStatuses clientStatuses) {
131 | final ClientStatus c = clientStatuses.c();
132 | final ClientStatus dnd = ClientStatus.DND;
133 | return c == dnd && clientStatuses.b() == dnd && clientStatuses.a() != dnd;
134 | }
135 |
136 | public final boolean isWebMobileIDLE(final ClientStatuses clientStatuses) {
137 | final ClientStatus c = clientStatuses.c();
138 | final ClientStatus idle = ClientStatus.IDLE;
139 | return c == idle && clientStatuses.b() == idle && clientStatuses.a() != idle;
140 | }
141 |
142 | public final boolean isDesktopWebMobileOFFLINE() {
143 | ClientStatuses clientStatuses = null;
144 | ClientStatus a = clientStatuses.a();
145 | ClientStatus clientStatus = ClientStatus.OFFLINE;
146 | return a == null && clientStatuses.c() == null && clientStatuses.b() == null;
147 | }
148 |
149 | public final Activity getActivityByType(final List list, final ActivityType activityType)
150 | {
151 | return null;
152 | }
153 | }*/
154 |
155 |
156 | package com.aliucord.plugins.betterstatus;
157 |
158 | import com.discord.api.presence.ClientStatus;
159 | import com.discord.api.presence.ClientStatuses;
160 |
161 | public final class PresenceUtils {
162 |
163 | public static boolean isDesktop(ClientStatuses clientStatuses) {
164 | ClientStatus a = clientStatuses.a();
165 | ClientStatus clientStatus = ClientStatus.ONLINE;
166 | return a == clientStatus && clientStatuses.b() != clientStatus && clientStatuses.c() != clientStatus;
167 | }
168 |
169 | public static boolean isDesktopAndMobile(ClientStatuses clientStatuses) {
170 | ClientStatus a = clientStatuses.a();
171 | ClientStatus clientStatus = ClientStatus.ONLINE;
172 | return a == clientStatus && clientStatuses.b() == clientStatus && clientStatuses.c() != clientStatus;
173 | }
174 |
175 | public static boolean isDesktopAndMobileDND(ClientStatuses clientStatuses) {
176 | ClientStatus a = clientStatuses.a();
177 | ClientStatus clientStatus = ClientStatus.DND;
178 | return a == clientStatus && clientStatuses.b() == clientStatus && clientStatuses.c() != clientStatus;
179 | }
180 |
181 | public static boolean isDesktopAndMobileIDLE(ClientStatuses clientStatuses) {
182 | ClientStatus a = clientStatuses.a();
183 | ClientStatus clientStatus = ClientStatus.IDLE;
184 | return a == clientStatus && clientStatuses.b() == clientStatus && clientStatuses.c() != clientStatus;
185 | }
186 |
187 | public static boolean isDesktopAndWeb(ClientStatuses clientStatuses) {
188 | ClientStatus a = clientStatuses.a();
189 | ClientStatus clientStatus = ClientStatus.ONLINE;
190 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() != clientStatus;
191 | }
192 |
193 | public static boolean isDesktopAndWebDND(ClientStatuses clientStatuses) {
194 | ClientStatus a = clientStatuses.a();
195 | ClientStatus clientStatus = ClientStatus.DND;
196 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() != clientStatus;
197 | }
198 |
199 | public static boolean isDesktopAndWebIDLE(ClientStatuses clientStatuses) {
200 | ClientStatus a = clientStatuses.a();
201 | ClientStatus clientStatus = ClientStatus.IDLE;
202 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() != clientStatus;
203 | }
204 |
205 | public static boolean isDesktopDND(ClientStatuses clientStatuses) {
206 | ClientStatus a = clientStatuses.a();
207 | ClientStatus clientStatus = ClientStatus.DND;
208 | return a == clientStatus && clientStatuses.b() != clientStatus && clientStatuses.c() != clientStatus;
209 | }
210 |
211 | public static boolean isDesktopIDLE(ClientStatuses clientStatuses) {
212 | ClientStatus a = clientStatuses.a();
213 | ClientStatus clientStatus = ClientStatus.IDLE;
214 | return a == clientStatus && clientStatuses.b() != clientStatus && clientStatuses.c() != clientStatus;
215 | }
216 |
217 | public static boolean isDesktopWebMobile(ClientStatuses clientStatuses) {
218 | ClientStatus a = clientStatuses.a();
219 | ClientStatus clientStatus = ClientStatus.ONLINE;
220 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() == clientStatus;
221 | }
222 |
223 | public static boolean isDesktopWebMobileDND(ClientStatuses clientStatuses) {
224 | ClientStatus a = clientStatuses.a();
225 | ClientStatus clientStatus = ClientStatus.DND;
226 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() == clientStatus;
227 | }
228 |
229 | public static boolean isDesktopWebMobileIDLE(ClientStatuses clientStatuses) {
230 | ClientStatus a = clientStatuses.a();
231 | ClientStatus clientStatus = ClientStatus.IDLE;
232 | return a == clientStatus && clientStatuses.c() == clientStatus && clientStatuses.b() == clientStatus;
233 | }
234 |
235 | public static boolean isMobile(final ClientStatuses clientStatuses) {
236 | final ClientStatus b = clientStatuses.b();
237 | final ClientStatus online = ClientStatus.ONLINE;
238 | return b == online && clientStatuses.c() != online && clientStatuses.a() != online;
239 | }
240 |
241 | public static boolean isMobileDND(final ClientStatuses clientStatuses) {
242 | final ClientStatus b = clientStatuses.b();
243 | final ClientStatus dnd = ClientStatus.DND;
244 | return b == dnd && clientStatuses.c() != dnd && clientStatuses.a() != dnd;
245 | }
246 |
247 | public static boolean isMobileIDLE(final ClientStatuses clientStatuses) {
248 | final ClientStatus b = clientStatuses.b();
249 | final ClientStatus idle = ClientStatus.IDLE;
250 | return b == idle && clientStatuses.c() != idle && clientStatuses.a() != idle;
251 | }
252 |
253 | public static boolean isWeb(final ClientStatuses clientStatuses) {
254 | final ClientStatus c = clientStatuses.c();
255 | final ClientStatus online = ClientStatus.ONLINE;
256 | return c == online && clientStatuses.b() != online && clientStatuses.a() != online;
257 | }
258 |
259 | public static boolean isWebDND(final ClientStatuses clientStatuses) {
260 | final ClientStatus c = clientStatuses.c();
261 | final ClientStatus dnd = ClientStatus.DND;
262 | return c == dnd && clientStatuses.b() != dnd && clientStatuses.a() != dnd;
263 | }
264 |
265 | public static boolean isWebIDLE(final ClientStatuses clientStatuses) {
266 | final ClientStatus c = clientStatuses.c();
267 | final ClientStatus idle = ClientStatus.IDLE;
268 | return c == idle && clientStatuses.b() != idle && clientStatuses.a() != idle;
269 | }
270 |
271 | public static boolean isWebMobile(final ClientStatuses clientStatuses) {
272 | final ClientStatus c = clientStatuses.c();
273 | final ClientStatus online = ClientStatus.ONLINE;
274 | return c == online && clientStatuses.b() == online && clientStatuses.a() != online;
275 | }
276 |
277 | public static boolean isWebMobileDND(final ClientStatuses clientStatuses) {
278 | final ClientStatus c = clientStatuses.c();
279 | final ClientStatus dnd = ClientStatus.DND;
280 | return c == dnd && clientStatuses.b() == dnd && clientStatuses.a() != dnd;
281 | }
282 |
283 | public static boolean isWebMobileIDLE(final ClientStatuses clientStatuses) {
284 | final ClientStatus c = clientStatuses.c();
285 | final ClientStatus idle = ClientStatus.IDLE;
286 | return c == idle && clientStatuses.b() == idle && clientStatuses.a() != idle;
287 | }
288 |
289 | public static boolean isCompletelyOffline(ClientStatuses statuses) {
290 | return statuses.a() == ClientStatus.OFFLINE && statuses.b() == ClientStatus.OFFLINE && statuses.c() == ClientStatus.OFFLINE;
291 | }
292 |
293 |
294 | }
--------------------------------------------------------------------------------
/BetterStatus/src/main/java/com/aliucord/plugins/BetterStatus.java:
--------------------------------------------------------------------------------
1 | package com.aliucord.plugins;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.graphics.drawable.Drawable;
6 | import android.graphics.drawable.VectorDrawable;
7 | import android.os.Bundle;
8 | import android.text.style.ImageSpan;
9 | import android.view.View;
10 | import android.view.ViewParent;
11 | import android.widget.FrameLayout;
12 | import android.widget.ImageView;
13 | import android.widget.RelativeLayout;
14 | import android.widget.TextView;
15 |
16 | import androidx.appcompat.widget.AppCompatImageView;
17 | import androidx.constraintlayout.widget.ConstraintLayout;
18 | import androidx.core.content.res.ResourcesCompat;
19 |
20 | import com.aliucord.Logger;
21 | import com.aliucord.PluginManager;
22 | import com.aliucord.Utils;
23 | import com.aliucord.annotations.AliucordPlugin;
24 | import com.aliucord.api.SettingsAPI;
25 | import com.aliucord.entities.Plugin;
26 | import com.aliucord.patcher.Hook;
27 | import com.aliucord.plugins.betterstatus.PresenceUtils;
28 | import com.aliucord.widgets.BottomSheet;
29 | import com.discord.api.presence.ClientStatus;
30 | import com.discord.api.presence.ClientStatuses;
31 | import com.discord.databinding.WidgetChannelMembersListItemUserBinding;
32 | import com.discord.databinding.WidgetChannelsListItemChannelPrivateBinding;
33 | import com.discord.models.message.Message;
34 | import com.discord.models.presence.Presence;
35 | import com.discord.models.user.User;
36 | import com.discord.stores.StoreStream;
37 | import com.discord.stores.StoreVoiceParticipants;
38 | import com.discord.stores.StoreVoiceParticipants$get$1;
39 | import com.discord.utilities.anim.RingAnimator;
40 | import com.discord.utilities.collections.SnowflakePartitionMap;
41 | import com.discord.views.CheckedSetting;
42 | import com.discord.views.StatusView;
43 | import com.discord.views.VoiceUserView;
44 | import com.discord.views.user.UserAvatarPresenceView;
45 | import com.discord.widgets.channels.list.WidgetChannelsListAdapter;
46 | import com.discord.widgets.channels.list.items.ChannelListItem;
47 | import com.discord.widgets.channels.list.items.ChannelListItemPrivate;
48 | import com.discord.widgets.channels.memberlist.adapter.ChannelMembersListAdapter;
49 | import com.discord.widgets.channels.memberlist.adapter.ChannelMembersListViewHolderMember;
50 | import com.discord.widgets.chat.list.adapter.WidgetChatListAdapterItemMessage;
51 | import com.discord.widgets.chat.list.adapter.WidgetChatListItem;
52 | import com.discord.widgets.chat.list.entries.ChatListEntry;
53 | import com.discord.widgets.chat.list.entries.MessageEntry;
54 | import com.discord.widgets.user.profile.UserProfileHeaderView;
55 | import com.discord.widgets.user.profile.UserProfileHeaderViewModel;
56 | import com.facebook.drawee.span.DraweeSpanStringBuilder;
57 | import com.facebook.drawee.span.SimpleDraweeSpanTextView;
58 | import com.facebook.drawee.view.SimpleDraweeView;
59 |
60 | import java.lang.reflect.Field;
61 | import java.util.ArrayList;
62 | import java.util.List;
63 | import java.util.Objects;
64 |
65 | import kotlin.jvm.functions.Function0;
66 |
67 | @SuppressWarnings("unused")
68 | @AliucordPlugin
69 | public class BetterStatus extends Plugin {
70 |
71 | public BetterStatus() {
72 | needsResources = true;
73 | settingsTab = new SettingsTab(BetterStatusSettings.class, SettingsTab.Type.BOTTOM_SHEET).withArgs(settings);
74 | }
75 | public Logger logger = new Logger("BetterStatus");
76 |
77 | public void setImageResource(AppCompatImageView appCompatImageView, int imageResource)
78 | {
79 | appCompatImageView.setImageResource(imageResource);
80 | }
81 |
82 | @SuppressLint("ResourceType")
83 | public void setImageDrawable(AppCompatImageView appCompatImageView, Drawable imageResource)
84 | {
85 | appCompatImageView.setImageDrawable(imageResource);
86 | appCompatImageView.setAdjustViewBounds(true);
87 | appCompatImageView.setScaleType(ImageView.ScaleType.FIT_XY);
88 | }
89 |
90 | public void setImageDrawableAround(AppCompatImageView appCompatImageView, int visibility) {
91 | appCompatImageView.setVisibility(visibility);
92 | }
93 |
94 | public void setImageDrawable2(AppCompatImageView appCompatImageView, Drawable imageResource, int width)
95 | {
96 | appCompatImageView.setImageDrawable(imageResource);
97 | appCompatImageView.setAdjustViewBounds(true);
98 | appCompatImageView.setScaleType(ImageView.ScaleType.FIT_XY);
99 | appCompatImageView.getLayoutParams().width = width;
100 | }
101 |
102 | @SuppressLint("ResourceType")
103 | public void setImageDrawableWidth2(AppCompatImageView appCompatImageView, Drawable imageResource, int width) {
104 | AppCompatImageView status2 = appCompatImageView.findViewById(0x7f0a0209);
105 | appCompatImageView.setImageDrawable(imageResource);
106 | status2.getLayoutParams().width = width;
107 | }
108 |
109 | @SuppressLint("ResourceType")
110 | @Override
111 | public void start(Context context) throws Throwable {
112 | VectorDrawable isWeb = (VectorDrawable)ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_web", "drawable", "com.aliucord.plugins"), null);
113 | VectorDrawable isWebDND =(VectorDrawable) ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_web_dnd", "drawable", "com.aliucord.plugins"), null);
114 | VectorDrawable isWebIDLE =(VectorDrawable) ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_web_idle", "drawable", "com.aliucord.plugins"), null);
115 | //-----
116 | VectorDrawable isDesktop = (VectorDrawable) ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop", "drawable", "com.aliucord.plugins"), null);
117 | VectorDrawable isDesktopDND = (VectorDrawable)ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop_dnd", "drawable", "com.aliucord.plugins"), null);
118 | VectorDrawable isDesktopIDLE = (VectorDrawable)ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop_idle", "drawable", "com.aliucord.plugins"), null);
119 | //-----
120 | VectorDrawable isMobile =(VectorDrawable) ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_mobile", "drawable", "com.aliucord.plugins"), null);
121 | VectorDrawable isMobileDND =(VectorDrawable) ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_mobile_dnd", "drawable", "com.aliucord.plugins"), null);
122 | VectorDrawable isMobileIDLE = (VectorDrawable)ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_mobile_idle", "drawable", "com.aliucord.plugins"), null);
123 | //-----
124 | VectorDrawable isWebMobile =(VectorDrawable) ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_web_mobile", "drawable", "com.aliucord.plugins"), null);
125 | VectorDrawable isWebMobileDND =(VectorDrawable) ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_web_mobile_dnd", "drawable", "com.aliucord.plugins"), null);
126 | VectorDrawable isWebMobileIDLE = (VectorDrawable)ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_web_mobile_idle", "drawable", "com.aliucord.plugins"), null);
127 | //-----
128 | VectorDrawable isDesktopMobile = (VectorDrawable)ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop_mobile", "drawable", "com.aliucord.plugins"), null);
129 | VectorDrawable isDesktopMobileDND =(VectorDrawable) ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop_mobile_dnd", "drawable", "com.aliucord.plugins"), null);
130 | VectorDrawable isDesktopMobileIDLE = (VectorDrawable)ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop_mobile_idle", "drawable", "com.aliucord.plugins"), null);
131 | //-----
132 | VectorDrawable isDesktopWeb =(VectorDrawable) ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop_web", "drawable", "com.aliucord.plugins"), null);
133 | VectorDrawable isDesktopWebDND = (VectorDrawable)ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop_web_dnd", "drawable", "com.aliucord.plugins"), null);
134 | VectorDrawable isDesktopWebIDLE =(VectorDrawable) ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop_web_idle", "drawable", "com.aliucord.plugins"), null);
135 | //-----
136 | VectorDrawable isDesktopWebMobile = (VectorDrawable)ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop_web_mobile", "drawable", "com.aliucord.plugins"), null);
137 | VectorDrawable isDesktopWebMobileDND = (VectorDrawable)ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop_web_mobile_dnd", "drawable", "com.aliucord.plugins"), null);
138 | VectorDrawable isDesktopWebMobileIDLE = (VectorDrawable)ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_desktop_web_mobile_idle", "drawable", "com.aliucord.plugins"), null);
139 | //-----
140 |
141 | final boolean[] MoreIcons = {false};
142 |
143 | if (!settings.getBool("filled_colors", false)) {
144 | patcher.patch(StatusView.class.getDeclaredMethod("setPresence", Presence.class), new Hook(callFrame -> {
145 | Presence presence = (Presence) callFrame.args[0];
146 | if (presence == null) return;
147 | ClientStatuses clientStatuses = presence.getClientStatuses();
148 |
149 | if (clientStatuses != null) {
150 | List drawableList = new ArrayList<>();
151 | var desktopStatus = clientStatuses.a();
152 | var mobileStatus = clientStatuses.b();
153 | var webStatus = clientStatuses.c();
154 |
155 | switch (webStatus) {
156 | case ONLINE:
157 | drawableList.add(isWeb);
158 | break;
159 | case DND:
160 | drawableList.add(isWebDND);
161 | break;
162 | case IDLE:
163 | drawableList.add(isWebIDLE);
164 | }
165 |
166 | switch (desktopStatus) {
167 | case ONLINE:
168 | drawableList.add(isDesktop);
169 | break;
170 | case DND:
171 | drawableList.add(isDesktopDND);
172 | break;
173 | case IDLE:
174 | drawableList.add(isDesktopIDLE);
175 | break;
176 | }
177 |
178 | switch (mobileStatus) {
179 | case ONLINE:
180 | drawableList.add(isMobile);
181 | break;
182 | case DND:
183 | drawableList.add(isMobileDND);
184 | break;
185 | case IDLE:
186 | drawableList.add(isMobileIDLE);
187 | }
188 |
189 |
190 | View parent = (View) ((AppCompatImageView) callFrame.thisObject).getParent();
191 |
192 | if (drawableList.size() == 1) {
193 | setImageDrawable((AppCompatImageView) callFrame.thisObject, drawableList.get(0));
194 | MoreIcons[0] = false;
195 | } else if(drawableList.size() > 1) {
196 | MoreIcons[0] = true;
197 | }
198 | }
199 | }));
200 |
201 | patcher.patch(ChannelMembersListViewHolderMember.class.getDeclaredMethod("bind", ChannelMembersListAdapter.Item.Member.class, Function0.class), new Hook(callFrame -> {
202 |
203 | Field bindingField1 = null;
204 | try {
205 | bindingField1 = ChannelMembersListViewHolderMember.class.getDeclaredField("binding");
206 | bindingField1.setAccessible(true);
207 | } catch (NoSuchFieldException e) {
208 | e.printStackTrace();
209 | }
210 |
211 | WidgetChannelMembersListItemUserBinding binding = null;
212 | try {
213 | binding = (WidgetChannelMembersListItemUserBinding) bindingField1.get(callFrame.thisObject);
214 | } catch (IllegalAccessException e) {
215 | e.printStackTrace();
216 | }
217 | ConstraintLayout layout = (ConstraintLayout) binding.getRoot();
218 |
219 | ChannelMembersListAdapter.Item.Member member = (ChannelMembersListAdapter.Item.Member) callFrame.args[0];
220 |
221 | Presence presence = null;
222 | if(member.getUserId() != StoreStream.getUsers().getMe().getId()) {
223 | presence = member.getPresence();
224 | }
225 |
226 | ClientStatuses clientStatuses = null;
227 | if(presence != null) {
228 | clientStatuses = presence.getClientStatuses();
229 | }
230 |
231 | if (clientStatuses != null) {
232 | //List drawableList = new ArrayList<>();
233 | var desktopStatus = clientStatuses.a();
234 | var mobileStatus = clientStatuses.b();
235 | var webStatus = clientStatuses.c();
236 |
237 | SimpleDraweeSpanTextView username_status = layout.findViewById(Utils.getResId("username_text", "id"));
238 |
239 | if(username_status != null && MoreIcons[0]) {
240 | switch (webStatus) {
241 | case ONLINE:
242 | DraweeSpanStringBuilder icon = new DraweeSpanStringBuilder();
243 | icon.append(" ", new ImageSpan(isWeb, 1), 0);
244 | username_status.append(" ");
245 | username_status.append(icon);
246 | break;
247 | case DND:
248 | DraweeSpanStringBuilder icon2 = new DraweeSpanStringBuilder();
249 | icon2.append(" ", new ImageSpan(isWebDND, 1), 0);
250 | username_status.append(" ");
251 | username_status.append(icon2);
252 | break;
253 | case IDLE:
254 | DraweeSpanStringBuilder icon3 = new DraweeSpanStringBuilder();
255 | icon3.append(" ", new ImageSpan(isWebIDLE, 1), 0);
256 | username_status.append(" ");
257 | username_status.append(icon3);
258 | }
259 |
260 | switch (desktopStatus) {
261 | case ONLINE:
262 | DraweeSpanStringBuilder icon = new DraweeSpanStringBuilder();
263 | icon.append(" ", new ImageSpan(isDesktop, 1), 0);
264 | username_status.append(" ");
265 | username_status.append(icon);
266 | break;
267 | case DND:
268 | DraweeSpanStringBuilder icon2 = new DraweeSpanStringBuilder();
269 | icon2.append(" ", new ImageSpan(isDesktopDND, 1), 0);
270 | username_status.append(" ");
271 | username_status.append(icon2);
272 | break;
273 | case IDLE:
274 | DraweeSpanStringBuilder icon3 = new DraweeSpanStringBuilder();
275 | icon3.append(" ", new ImageSpan(isDesktopIDLE, 1), 0);
276 | username_status.append(" ");
277 | username_status.append(icon3);
278 | }
279 |
280 | switch (mobileStatus) {
281 | case ONLINE:
282 | DraweeSpanStringBuilder icon = new DraweeSpanStringBuilder();
283 | icon.append(" ", new ImageSpan(isMobile, 1), 0);
284 | username_status.append(" ");
285 | username_status.append(icon);
286 | break;
287 | case DND:
288 | DraweeSpanStringBuilder icon2 = new DraweeSpanStringBuilder();
289 | icon2.append(" ", new ImageSpan(isMobileDND, 1), 0);
290 | username_status.append(" ");
291 | username_status.append(icon2);
292 | break;
293 | case IDLE:
294 | DraweeSpanStringBuilder icon3 = new DraweeSpanStringBuilder();
295 | icon3.append(" ", new ImageSpan(isMobileIDLE, 1), 0);
296 | username_status.append(" ");
297 | username_status.append(icon3);
298 | }
299 | }
300 | }
301 | }));
302 |
303 | //--------UserProfileHeaderView---------
304 |
305 | try {
306 | patcher.patch(UserProfileHeaderView.class.getDeclaredMethod("updateViewState", UserProfileHeaderViewModel.ViewState.Loaded.class), new Hook(callFrame1 ->
307 | {
308 | try {
309 | Presence presence1 = ((UserProfileHeaderViewModel.ViewState.Loaded) callFrame1.args[0]).getPresence();
310 | View username_profile_header = (View) ((UserProfileHeaderView) callFrame1.thisObject).getParent();
311 | TextView username_profile_header2 = username_profile_header.findViewById(Utils.getResId("username_text", "id"));
312 |
313 | if (presence1 == null) {
314 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
315 | return;
316 | }
317 |
318 | ClientStatuses clientStatuses1 = presence1.getClientStatuses();
319 | if (clientStatuses1 != null) {
320 | username_profile_header2.setCompoundDrawablePadding(2);
321 | if (PresenceUtils.isWebMobile(clientStatuses1)) {
322 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isWebMobile, null);
323 | }
324 | if (PresenceUtils.isWebMobileDND(clientStatuses1)) {
325 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isWebMobileDND, null);
326 | }
327 | if (PresenceUtils.isWebMobileIDLE(clientStatuses1)) {
328 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isWebMobileIDLE, null);
329 | }
330 | //-------------------
331 | if (PresenceUtils.isDesktopAndMobile(clientStatuses1)) {
332 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isDesktopMobile, null);
333 | }
334 | if (PresenceUtils.isDesktopAndMobileDND(clientStatuses1)) {
335 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isDesktopMobileDND, null);
336 | }
337 | if (PresenceUtils.isDesktopAndMobileIDLE(clientStatuses1)) {
338 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isDesktopMobileIDLE, null);
339 | }
340 | //-------
341 | if (PresenceUtils.isDesktopAndWeb(clientStatuses1)) {
342 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isDesktopWeb, null);
343 | }
344 | if (PresenceUtils.isDesktopAndWebDND(clientStatuses1)) {
345 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isDesktopWebDND, null);
346 | }
347 | if (PresenceUtils.isDesktopAndWebIDLE(clientStatuses1)) {
348 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isDesktopWebIDLE, null);
349 | }
350 | //-------
351 | if (PresenceUtils.isDesktopWebMobile(clientStatuses1)) {
352 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isDesktopWebMobile, null);
353 | }
354 | if (PresenceUtils.isDesktopWebMobileDND(clientStatuses1)) {
355 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isDesktopWebMobileDND, null);
356 | }
357 | if (PresenceUtils.isDesktopWebMobileIDLE(clientStatuses1)) {
358 | username_profile_header2.setCompoundDrawablesWithIntrinsicBounds(null, null, isDesktopWebMobileIDLE, null);
359 | }
360 | }
361 | } catch (Throwable e) {
362 | logger.error("An error occurred in UserProfileHeaderView", e);
363 | }
364 | }));
365 | } catch (Throwable e) {
366 | logger.error("An error occurred in UserProfileHeaderView", e);
367 | }
368 |
369 | //----------RADIAL STATUS----------
370 |
371 | //if ((PluginManager.plugins.containsKey("SquareAvatars") && !PluginManager.isPluginEnabled("SquareAvatars")) || !(PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) || (PluginManager.plugins.containsKey("AlwaysAnimate") && !PluginManager.isPluginEnabled("AlwaysAnimate")) || !(PluginManager.plugins.containsKey("AlwaysAnimate") && PluginManager.isPluginEnabled("AlwaysAnimate"))) {
372 | if (settings.getBool("radial_status_up", true) && (PluginManager.plugins.containsKey("SquareAvatars") && !PluginManager.isPluginEnabled("SquareAvatars")) || settings.getBool("radial_status_up", true) && !(PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) ) {
373 | //-----------Radial Status on UserProfileHeaderView--------------
374 |
375 | patcher.patch(UserAvatarPresenceView.class.getDeclaredMethod("a", UserAvatarPresenceView.a.class), new Hook(callFrame -> {
376 | UserAvatarPresenceView.a data = (UserAvatarPresenceView.a) callFrame.args[0];
377 |
378 | View avatar = (View) ((UserAvatarPresenceView) callFrame.thisObject).getParent();
379 | ImageView avatar2 = avatar.findViewById(Utils.getResId("avatar_cutout", "id"));
380 |
381 |
382 | if(data.a.getAvatar() == null && data.a.getId() == StoreStream.getUsers().getMe().getId()) return;
383 | if (data.b == null || data.a.getId() == StoreStream.getUsers().getMe().getId() && data.a.getAvatar() == null && !data.a.getAvatar().equals(StoreStream.getUsers().getMe().getAvatar())) {
384 | avatar2.setPadding(0, 0, 0, 0);
385 | avatar2.setBackground(null);
386 | }
387 |
388 | ClientStatuses clientStatuses = null;
389 | if(data.b != null) {
390 | clientStatuses = data.b.getClientStatuses();
391 | }
392 |
393 | if (clientStatuses != null) {
394 | setRadialStatus(clientStatuses, avatar2);
395 | }
396 | }));
397 | }
398 | //}
399 |
400 | //if ((PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) || (PluginManager.plugins.containsKey("AlwaysAnimate") && PluginManager.isPluginEnabled("AlwaysAnimate"))) {
401 | if (settings.getBool("radial_status_up", true) && PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) {
402 | //-----------Radial Status on UserProfileHeaderView--------------
403 |
404 | patcher.patch(UserAvatarPresenceView.class.getDeclaredMethod("a", UserAvatarPresenceView.a.class), new Hook(callFrame -> {
405 | UserAvatarPresenceView.a data = (UserAvatarPresenceView.a) callFrame.args[0];
406 |
407 | ClientStatuses clientStatuses = null;
408 | if(data.b != null) {
409 | clientStatuses = data.b.getClientStatuses();
410 | }
411 |
412 | if (clientStatuses != null) {
413 |
414 | View avatar = (View) ((UserAvatarPresenceView) callFrame.thisObject).getParent();
415 | ImageView avatar2 = avatar.findViewById(Utils.getResId("avatar", "id"));
416 |
417 | if(data.a.getAvatar() == null && data.a.getId() == StoreStream.getUsers().getMe().getId()) return;
418 | if (data.b == null || data.a.getId() == StoreStream.getUsers().getMe().getId() && data.a.getAvatar() == null && !data.a.getAvatar().equals(StoreStream.getUsers().getMe().getAvatar())) {
419 | avatar2.setPadding(0, 0, 0, 0);
420 | avatar2.setBackground(null);
421 | }
422 |
423 | ImageView avatar2_cut = avatar.findViewById(Utils.getResId("avatar_cutout", "id"));
424 |
425 | setSquareStatus(clientStatuses, avatar2, "profile");
426 |
427 | avatar2_cut.setVisibility(View.INVISIBLE);
428 |
429 | }
430 | }));
431 | }
432 | //}
433 |
434 | //if ((PluginManager.plugins.containsKey("SquareAvatars")) && !PluginManager.isPluginEnabled("SquareAvatars") || !(PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) || (PluginManager.plugins.containsKey("AlwaysAnimate") && !PluginManager.isPluginEnabled("AlwaysAnimate")) || !(PluginManager.plugins.containsKey("AlwaysAnimate") && PluginManager.isPluginEnabled("AlwaysAnimate"))) {
435 | if (settings.getBool("radial_status_cml", true) && (PluginManager.plugins.containsKey("SquareAvatars") && !PluginManager.isPluginEnabled("SquareAvatars")) || settings.getBool("radial_status_cml", true) && !(PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars"))) {
436 | //-----ChannelMemberList--------
437 | patcher.patch(ChannelMembersListViewHolderMember.class.getDeclaredMethod("bind", ChannelMembersListAdapter.Item.Member.class, Function0.class), new Hook(callFrame -> {
438 |
439 | Field bindingField1 = null;
440 | try {
441 | bindingField1 = ChannelMembersListViewHolderMember.class.getDeclaredField("binding");
442 | bindingField1.setAccessible(true);
443 | } catch (NoSuchFieldException e) {
444 | e.printStackTrace();
445 | }
446 |
447 | WidgetChannelMembersListItemUserBinding binding = null;
448 | try {
449 | binding = (WidgetChannelMembersListItemUserBinding) bindingField1.get(callFrame.thisObject);
450 | } catch (IllegalAccessException e) {
451 | e.printStackTrace();
452 | }
453 | ConstraintLayout layout = (ConstraintLayout) binding.getRoot();
454 |
455 | ChannelMembersListAdapter.Item.Member member = (ChannelMembersListAdapter.Item.Member) callFrame.args[0];
456 |
457 | Presence presence = null;
458 | if(member.getUserId() != StoreStream.getUsers().getMe().getId()) {
459 | presence = member.getPresence();
460 | }
461 |
462 | SimpleDraweeView avatar = layout.findViewById(Utils.getResId("channel_members_list_item_avatar", "id"));
463 |
464 | if (presence == null) {
465 | if (avatar != null) {
466 | avatar.setPadding(0, 0, 0, 0);
467 | avatar.setBackground(null);
468 | }
469 | }
470 |
471 | ClientStatuses clientStatuses = null;
472 | if(presence != null) {
473 | clientStatuses = presence.getClientStatuses();
474 | }
475 |
476 | if (clientStatuses != null && avatar!=null) {
477 | setRadialStatus(clientStatuses, avatar);
478 | }
479 | }));
480 |
481 | }
482 | //}
483 |
484 | //if ((PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) || (PluginManager.plugins.containsKey("AlwaysAnimate") && PluginManager.isPluginEnabled("AlwaysAnimate"))) {
485 | if (settings.getBool("radial_status_cml", true) && PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) {
486 | //-----ChannelMemberList--------
487 | patcher.patch(ChannelMembersListViewHolderMember.class.getDeclaredMethod("bind", ChannelMembersListAdapter.Item.Member.class, Function0.class), new Hook(callFrame -> {
488 |
489 | Field bindingField1 = null;
490 | try {
491 | bindingField1 = ChannelMembersListViewHolderMember.class.getDeclaredField("binding");
492 | bindingField1.setAccessible(true);
493 | } catch (NoSuchFieldException e) {
494 | e.printStackTrace();
495 | }
496 |
497 | WidgetChannelMembersListItemUserBinding binding = null;
498 | try {
499 | binding = (WidgetChannelMembersListItemUserBinding) bindingField1.get(callFrame.thisObject);
500 | } catch (IllegalAccessException e) {
501 | e.printStackTrace();
502 | }
503 | ConstraintLayout layout = (ConstraintLayout) binding.getRoot();
504 |
505 | ChannelMembersListAdapter.Item.Member member = (ChannelMembersListAdapter.Item.Member) callFrame.args[0];
506 |
507 | Presence presence = null;
508 | if(member.getUserId() != StoreStream.getUsers().getMe().getId()) {
509 | presence = member.getPresence();
510 | }
511 |
512 | SimpleDraweeView avatar = layout.findViewById(Utils.getResId("channel_members_list_item_avatar", "id"));
513 |
514 | if (presence == null) {
515 | if (avatar != null) {
516 | avatar.setPadding(0, 0, 0, 0);
517 | avatar.setBackground(null);
518 | }
519 | }
520 |
521 | ClientStatuses clientStatuses = null;
522 | if(presence != null) {
523 | clientStatuses = presence.getClientStatuses();
524 | }
525 |
526 | if (clientStatuses != null && avatar!=null) {
527 | setSquareStatus(clientStatuses, avatar, "non-profile");
528 | }
529 | }));
530 | }
531 | //}
532 |
533 | //-------------DM List--------
534 |
535 | //if ((PluginManager.plugins.containsKey("SquareAvatars") || !PluginManager.isPluginEnabled("SquareAvatars")) || !(PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) || (PluginManager.plugins.containsKey("AlwaysAnimate") && !PluginManager.isPluginEnabled("AlwaysAnimate")) || !(PluginManager.plugins.containsKey("AlwaysAnimate") && PluginManager.isPluginEnabled("AlwaysAnimate"))) {
536 | if (settings.getBool("radial_status_dm", true) && (PluginManager.plugins.containsKey("SquareAvatars") && !PluginManager.isPluginEnabled("SquareAvatars")) || settings.getBool("radial_status_dm", true) && !(PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars"))) {
537 |
538 | patcher.patch(WidgetChannelsListAdapter.ItemChannelPrivate.class.getDeclaredMethod("onConfigure", int.class, ChannelListItem.class), new Hook(callFrame -> {
539 |
540 | Field bindingField = null;
541 | try {
542 | bindingField = WidgetChannelsListAdapter.ItemChannelPrivate.class.getDeclaredField("binding");
543 | bindingField.setAccessible(true);
544 | } catch (NoSuchFieldException e) {
545 | e.printStackTrace();
546 | }
547 | WidgetChannelsListItemChannelPrivateBinding binding = null;
548 |
549 | try {
550 | binding = (WidgetChannelsListItemChannelPrivateBinding) bindingField.get(callFrame.thisObject);
551 | } catch (IllegalAccessException e) {
552 | e.printStackTrace();
553 | }
554 |
555 | RelativeLayout layout = (RelativeLayout) binding.getRoot();
556 |
557 | ChannelListItemPrivate data = (ChannelListItemPrivate) callFrame.args[1];
558 | Presence presence = data.getPresence();
559 | ImageView avatar2 = layout.findViewById(Utils.getResId("channels_list_item_private_avatar", "id"));
560 | Drawable radial_status = ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_radial_status", "drawable", "com.aliucord.plugins"), null);
561 |
562 | if (presence == null) {
563 | avatar2.setPadding(0, 0, 0, 0);
564 | avatar2.setBackground(null);
565 | }
566 |
567 | ClientStatuses clientStatuses = null;
568 | if(presence != null) {
569 | clientStatuses = presence.getClientStatuses();
570 | }
571 |
572 | if (clientStatuses != null) setRadialStatus(clientStatuses, avatar2);
573 | }));
574 | }
575 | //}
576 |
577 | //if ((PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) || (PluginManager.plugins.containsKey("AlwaysAnimate") && PluginManager.isPluginEnabled("AlwaysAnimate"))) {
578 | if (settings.getBool("radial_status_dm", true) && PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) {
579 | patcher.patch(WidgetChannelsListAdapter.ItemChannelPrivate.class.getDeclaredMethod("onConfigure", int.class, ChannelListItem.class), new Hook(callFrame -> {
580 |
581 | Field bindingField = null;
582 | try {
583 | bindingField = WidgetChannelsListAdapter.ItemChannelPrivate.class.getDeclaredField("binding");
584 | bindingField.setAccessible(true);
585 | } catch (NoSuchFieldException e) {
586 | e.printStackTrace();
587 | }
588 |
589 | WidgetChannelsListItemChannelPrivateBinding binding = null;
590 | try {
591 | binding = (WidgetChannelsListItemChannelPrivateBinding) bindingField.get(callFrame.thisObject);
592 | } catch (IllegalAccessException e) {
593 | e.printStackTrace();
594 | }
595 |
596 | RelativeLayout layout = (RelativeLayout) binding.getRoot();
597 | ChannelListItemPrivate data = (ChannelListItemPrivate) callFrame.args[1];
598 | Presence presence = data.getPresence();
599 |
600 | ImageView avatar2 = layout.findViewById(Utils.getResId("channels_list_item_private_avatar", "id"));
601 |
602 | if (presence == null) {
603 | avatar2.setPadding(0, 0, 0, 0);
604 | avatar2.setBackground(null);
605 | }
606 |
607 | ClientStatuses clientStatuses = null;
608 | if(presence != null) {
609 | clientStatuses = presence.getClientStatuses();
610 | }
611 |
612 | if (clientStatuses != null) {
613 | setSquareStatus(clientStatuses, avatar2, "non-profile");
614 | }
615 | }));
616 |
617 | }
618 |
619 | //}
620 |
621 | //----------WidgetChatListAdapterItemMessage---------
622 |
623 | //if ((PluginManager.plugins.containsKey("SquareAvatars") || !PluginManager.isPluginEnabled("SquareAvatars")) || !(PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) || (PluginManager.plugins.containsKey("AlwaysAnimate") && !PluginManager.isPluginEnabled("AlwaysAnimate")) || !(PluginManager.plugins.containsKey("AlwaysAnimate") && PluginManager.isPluginEnabled("AlwaysAnimate"))) {
624 | if (settings.getBool("radial_status_chat", true) && (PluginManager.plugins.containsKey("SquareAvatars") && !PluginManager.isPluginEnabled("SquareAvatars")) || settings.getBool("radial_status_chat", true) && !(PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars"))) {
625 |
626 | patcher.patch(WidgetChatListAdapterItemMessage.class.getDeclaredMethod("onConfigure", int.class, ChatListEntry.class), new Hook(callFrame -> {
627 | ChatListEntry chatListEntry = (ChatListEntry) callFrame.args[1];
628 | MessageEntry messageEntry = (MessageEntry) chatListEntry;
629 | Message message = messageEntry.getMessage();
630 | long userId = message.getAuthor().i();
631 |
632 | ImageView chat_list_avatar = ((WidgetChatListItem) callFrame.thisObject).itemView.findViewById(Utils.getResId("chat_list_adapter_item_text_avatar", "id"));
633 | TextView chat_list_username = ((WidgetChatListItem) callFrame.thisObject).itemView.findViewById(Utils.getResId("chat_list_adapter_item_text_name", "id"));
634 |
635 | SnowflakePartitionMap.CopiablePartitionMap presences = StoreStream.getPresences().getPresences();
636 |
637 | Presence presence = null;
638 | if(userId != StoreStream.getUsers().getMe().getId()) {
639 | presence = (Presence) presences.get(userId);
640 | }
641 | //Presence local_presence = StoreStream.getPresences().getLocalPresence$app_productionCanaryRelease();
642 |
643 | ClientStatuses clientStatuses = null;
644 | if(presence != null) {
645 | clientStatuses = presence.getClientStatuses();
646 | }
647 |
648 | Drawable radial_status = ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_radial_status", "drawable", "com.aliucord.plugins"), null);
649 |
650 | if (presence == null) {
651 | if(chat_list_avatar != null) {
652 | chat_list_avatar.setPadding(0, 0, 0, 0);
653 | chat_list_avatar.setBackground(null);
654 | }
655 | }
656 |
657 |
658 | if (clientStatuses != null) setRadialStatus(clientStatuses, chat_list_avatar);
659 | }));
660 | //-------
661 | patcher.patch(WidgetChatListAdapterItemMessage.class.getDeclaredMethod("processMessageText", com.discord.utilities.view.text.SimpleDraweeSpanTextView.class, MessageEntry.class), new Hook(callFrame -> {
662 | //ChatListEntry chatListEntry = (ChatListEntry) callFrame.args[1];
663 | MessageEntry messageEntry = (MessageEntry) callFrame.args[1];
664 | Message message = messageEntry.getMessage();
665 | long userId = message.getAuthor().i();
666 |
667 | ImageView chat_list_avatar = ((WidgetChatListItem) callFrame.thisObject).itemView.findViewById(Utils.getResId("chat_list_adapter_item_text_avatar", "id"));
668 | TextView chat_list_username = ((WidgetChatListItem) callFrame.thisObject).itemView.findViewById(Utils.getResId("chat_list_adapter_item_text_name", "id"));
669 |
670 | SnowflakePartitionMap.CopiablePartitionMap presences = StoreStream.getPresences().getPresences();
671 |
672 | Presence presence = null;
673 | if(userId != StoreStream.getUsers().getMe().getId()) {
674 | presence = (Presence) presences.get(userId);
675 | }
676 | //Presence local_presence = StoreStream.getPresences().getLocalPresence$app_productionCanaryRelease();
677 |
678 | ClientStatuses clientStatuses = null;
679 | if(presence != null) {
680 | clientStatuses = presence.getClientStatuses();
681 | }
682 |
683 | Drawable radial_status = ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_radial_status", "drawable", "com.aliucord.plugins"), null);
684 |
685 | if (presence == null) {
686 | if(chat_list_avatar != null) {
687 | chat_list_avatar.setPadding(0, 0, 0, 0);
688 | chat_list_avatar.setBackground(null);
689 | }
690 | }
691 |
692 |
693 | if (clientStatuses != null) setRadialStatus(clientStatuses, chat_list_avatar);
694 | }));
695 | }
696 | //}
697 |
698 | //if ((PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) || (PluginManager.plugins.containsKey("AlwaysAnimate") && PluginManager.isPluginEnabled("AlwaysAnimate"))) {
699 | if (settings.getBool("radial_status_chat", true) && PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) {
700 | patcher.patch(WidgetChatListAdapterItemMessage.class.getDeclaredMethod("onConfigure", int.class, ChatListEntry.class), new Hook(callFrame -> {
701 | ChatListEntry chatListEntry = (ChatListEntry) callFrame.args[1];
702 | MessageEntry messageEntry = (MessageEntry) chatListEntry;
703 | Message message = messageEntry.getMessage();
704 | long userId = message.getAuthor().i();
705 |
706 | SnowflakePartitionMap.CopiablePartitionMap presences = StoreStream.getPresences().getPresences();
707 |
708 | Presence presence = null;
709 | if(userId != StoreStream.getUsers().getMe().getId()) {
710 | presence = (Presence) presences.get(userId);
711 | }
712 |
713 | ClientStatuses clientStatuses = null;
714 | if(presence != null) {
715 | clientStatuses = presence.getClientStatuses();
716 | }
717 |
718 | ImageView chat_list_avatar = ((WidgetChatListItem) callFrame.thisObject).itemView.findViewById(Utils.getResId("chat_list_adapter_item_text_avatar", "id"));
719 | TextView chat_list_username = ((WidgetChatListItem) callFrame.thisObject).itemView.findViewById(Utils.getResId("chat_list_adapter_item_text_name", "id"));
720 |
721 | Drawable radial_status = ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_radial_status", "drawable", "com.aliucord.plugins"), null);
722 |
723 | if (presence == null) {
724 | if(chat_list_avatar != null) {
725 | chat_list_avatar.setPadding(0, 0, 0, 0);
726 | chat_list_avatar.setBackground(null);
727 | }
728 | }
729 |
730 |
731 | if (clientStatuses != null) setSquareStatus(clientStatuses, chat_list_avatar, "non-profile");
732 | }));
733 | //------
734 | patcher.patch(WidgetChatListAdapterItemMessage.class.getDeclaredMethod("processMessageText", com.discord.utilities.view.text.SimpleDraweeSpanTextView.class, MessageEntry.class), new Hook(callFrame -> {
735 | //ChatListEntry chatListEntry = (ChatListEntry) callFrame.args[1];
736 | MessageEntry messageEntry = (MessageEntry) callFrame.args[1];
737 | Message message = messageEntry.getMessage();
738 | long userId = message.getAuthor().i();
739 |
740 | SnowflakePartitionMap.CopiablePartitionMap presences = StoreStream.getPresences().getPresences();
741 |
742 | Presence presence = null;
743 | if(userId != StoreStream.getUsers().getMe().getId()) {
744 | presence = (Presence) presences.get(userId);
745 | }
746 |
747 | ClientStatuses clientStatuses = null;
748 | if(presence != null) {
749 | clientStatuses = presence.getClientStatuses();
750 | }
751 |
752 | ImageView chat_list_avatar = ((WidgetChatListItem) callFrame.thisObject).itemView.findViewById(Utils.getResId("chat_list_adapter_item_text_avatar", "id"));
753 | TextView chat_list_username = ((WidgetChatListItem) callFrame.thisObject).itemView.findViewById(Utils.getResId("chat_list_adapter_item_text_name", "id"));
754 |
755 | Drawable radial_status = ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_radial_status", "drawable", "com.aliucord.plugins"), null);
756 |
757 | if (presence == null) {
758 | if(chat_list_avatar != null) {
759 | chat_list_avatar.setPadding(0, 0, 0, 0);
760 | chat_list_avatar.setBackground(null);
761 | }
762 | }
763 |
764 |
765 | if (clientStatuses != null) setSquareStatus(clientStatuses, chat_list_avatar, "non-profile");
766 | }));
767 | }
768 | //}
769 |
770 | //------------Author status in chat--------------
771 |
772 | if (settings.getBool("status_chat", true)) {
773 |
774 | patcher.patch(WidgetChatListAdapterItemMessage.class.getDeclaredMethod("onConfigure", int.class, ChatListEntry.class), new Hook(callFrame -> {
775 | ChatListEntry chatListEntry = (ChatListEntry) callFrame.args[1];
776 | MessageEntry messageEntry = (MessageEntry) chatListEntry;
777 | Message message = messageEntry.getMessage();
778 | long userId = message.getAuthor().i();
779 |
780 | TextView chat_list_username = ((WidgetChatListItem) callFrame.thisObject).itemView.findViewById(Utils.getResId("chat_list_adapter_item_text_name", "id"));
781 |
782 | SnowflakePartitionMap.CopiablePartitionMap presences = StoreStream.getPresences().getPresences();
783 |
784 | Presence presence = null;
785 | if(userId != StoreStream.getUsers().getMe().getId()) {
786 | presence = (Presence) presences.get(userId);
787 | }
788 |
789 | ClientStatuses clientStatuses = null;
790 |
791 | if(presence != null) {
792 | clientStatuses = presence.getClientStatuses();
793 |
794 | var desktopStatus = clientStatuses.a();
795 | var mobileStatus = clientStatuses.b();
796 | var webStatus = clientStatuses.c();
797 |
798 | if(chat_list_username != null) {
799 |
800 | switch (webStatus) {
801 | case ONLINE:
802 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_online"), null);
803 | chat_list_username.setCompoundDrawablePadding(8);
804 | break;
805 | case DND:
806 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_dnd"), null);
807 | chat_list_username.setCompoundDrawablePadding(8);
808 | break;
809 | case IDLE:
810 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_idle"), null);
811 | chat_list_username.setCompoundDrawablePadding(8);
812 | break;
813 | }
814 |
815 | switch (desktopStatus) {
816 | case ONLINE:
817 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_online"), null);
818 | chat_list_username.setCompoundDrawablePadding(8);
819 | break;
820 | case DND:
821 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_dnd"), null);
822 | chat_list_username.setCompoundDrawablePadding(8);
823 | break;
824 | case IDLE:
825 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_idle"), null);
826 | chat_list_username.setCompoundDrawablePadding(8);
827 | break;
828 | }
829 |
830 | switch (mobileStatus) {
831 | case ONLINE:
832 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_online"), null);
833 | chat_list_username.setCompoundDrawablePadding(8);
834 | break;
835 | case DND:
836 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_dnd"), null);
837 | chat_list_username.setCompoundDrawablePadding(8);
838 | break;
839 | case IDLE:
840 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_idle"), null);
841 | chat_list_username.setCompoundDrawablePadding(8);
842 | break;
843 | }
844 | }
845 | }
846 |
847 | if (presence == null) {
848 | if(chat_list_username != null) {
849 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
850 | chat_list_username.setCompoundDrawablePadding(0);
851 | }
852 | }
853 | }));
854 | //------
855 | patcher.patch(WidgetChatListAdapterItemMessage.class.getDeclaredMethod("processMessageText", com.discord.utilities.view.text.SimpleDraweeSpanTextView.class, MessageEntry.class), new Hook(callFrame -> {
856 | //ChatListEntry chatListEntry = (ChatListEntry) callFrame.args[1];
857 | MessageEntry messageEntry = (MessageEntry) callFrame.args[1];
858 | Message message = messageEntry.getMessage();
859 | long userId = message.getAuthor().i();
860 |
861 | TextView chat_list_username = ((WidgetChatListItem) callFrame.thisObject).itemView.findViewById(Utils.getResId("chat_list_adapter_item_text_name", "id"));
862 |
863 | SnowflakePartitionMap.CopiablePartitionMap presences = StoreStream.getPresences().getPresences();
864 |
865 | Presence presence = null;
866 | if(userId != StoreStream.getUsers().getMe().getId()) {
867 | presence = (Presence) presences.get(userId);
868 | }
869 |
870 | ClientStatuses clientStatuses = null;
871 |
872 | if(presence != null) {
873 | clientStatuses = presence.getClientStatuses();
874 |
875 | var desktopStatus = clientStatuses.a();
876 | var mobileStatus = clientStatuses.b();
877 | var webStatus = clientStatuses.c();
878 |
879 | if(chat_list_username != null) {
880 |
881 | switch (webStatus) {
882 | case ONLINE:
883 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_online"), null);
884 | chat_list_username.setCompoundDrawablePadding(8);
885 | break;
886 | case DND:
887 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_dnd"), null);
888 | chat_list_username.setCompoundDrawablePadding(8);
889 | break;
890 | case IDLE:
891 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_idle"), null);
892 | chat_list_username.setCompoundDrawablePadding(8);
893 | break;
894 | }
895 |
896 | switch (desktopStatus) {
897 | case ONLINE:
898 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_online"), null);
899 | chat_list_username.setCompoundDrawablePadding(8);
900 | break;
901 | case DND:
902 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_dnd"), null);
903 | chat_list_username.setCompoundDrawablePadding(8);
904 | break;
905 | case IDLE:
906 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_idle"), null);
907 | chat_list_username.setCompoundDrawablePadding(8);
908 | break;
909 | }
910 |
911 | switch (mobileStatus) {
912 | case ONLINE:
913 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_online"), null);
914 | chat_list_username.setCompoundDrawablePadding(8);
915 | break;
916 | case DND:
917 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_dnd"), null);
918 | chat_list_username.setCompoundDrawablePadding(8);
919 | break;
920 | case IDLE:
921 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, getDrawable("ic_idle"), null);
922 | chat_list_username.setCompoundDrawablePadding(8);
923 | break;
924 | }
925 | }
926 | }
927 |
928 | if (presence == null) {
929 | if(chat_list_username != null) {
930 | chat_list_username.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
931 | chat_list_username.setCompoundDrawablePadding(0);
932 | }
933 | }
934 | }));
935 | }
936 |
937 | //-------------VoiceChannel user speaking status----------------
938 |
939 | if (settings.getBool("status_voice", true)) {
940 | final StoreVoiceParticipants.VoiceUser[] voiceUser = new StoreVoiceParticipants.VoiceUser[1];
941 |
942 | patcher.patch(VoiceUserView.class.getDeclaredMethod("a", StoreVoiceParticipants.VoiceUser.class, int.class), new Hook(callFrame -> {
943 | voiceUser[0] = (StoreVoiceParticipants.VoiceUser) callFrame.args[0];
944 | }));
945 |
946 | patcher.patch(VoiceUserView.class.getDeclaredMethod("setVoiceState", VoiceUserView.a.class), new Hook(callFrame -> {
947 | VoiceUserView.a aVar = (VoiceUserView.a) callFrame.args[0];
948 | FrameLayout status_ring = (FrameLayout) callFrame.thisObject;
949 | Drawable radial_status = null;
950 |
951 | if (PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) {
952 | radial_status = ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_rectangle_status", "drawable", "com.aliucord.plugins"), null);
953 | } else if((PluginManager.plugins.containsKey("SquareAvatars") && !PluginManager.isPluginEnabled("SquareAvatars")) || !(PluginManager.plugins.containsKey("SquareAvatars") && PluginManager.isPluginEnabled("SquareAvatars")) ){
954 | radial_status = ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_radial_status", "drawable", "com.aliucord.plugins"), null);
955 | }
956 |
957 | User user = null;
958 | StoreVoiceParticipants.VoiceUser voiceUser1 = voiceUser[0];
959 | if (voiceUser1 != null) {
960 | user = voiceUser1.getUser();
961 | }
962 |
963 | long userId = user.getId();
964 |
965 | SnowflakePartitionMap.CopiablePartitionMap presences = StoreStream.getPresences().getPresences();
966 |
967 | Presence presence = (Presence) presences.get(userId);
968 |
969 | ClientStatus clientStatus = null;
970 | if (presence != null) {
971 | clientStatus = presence.getStatus();
972 | }
973 |
974 | if (aVar.ordinal() != 1) {
975 | status_ring.setBackgroundResource(0x0106000d);
976 | } else {
977 | if (clientStatus == ClientStatus.ONLINE) {
978 | Objects.requireNonNull(radial_status).setTint(0xFF3BA55C - 1); //0xFFED4245 - 1 DND || 0xFFFAA61A - 1 IDLE
979 | status_ring.setBackground(radial_status);
980 | } else if (clientStatus == ClientStatus.DND) {
981 | Objects.requireNonNull(radial_status).setTint(0xFFED4245 - 1);
982 | status_ring.setBackground(radial_status);
983 | } else if (clientStatus == ClientStatus.IDLE) {
984 | Objects.requireNonNull(radial_status).setTint(0xFFFAA61A - 1);
985 | status_ring.setBackground(radial_status);
986 | }
987 | }
988 | }));
989 | }
990 |
991 | //---------END--------
992 | } else {
993 | patcher.patch(StatusView.class.getDeclaredMethod("setPresence", Presence.class), new Hook(callFrame -> {
994 | Presence presence = (Presence) callFrame.args[0];
995 | if (presence == null) return;
996 |
997 | ClientStatuses clientStatuses = presence.getClientStatuses();
998 |
999 | if (clientStatuses != null) {
1000 | var desktopStatus = clientStatuses.a();
1001 | var mobileStatus = clientStatuses.b();
1002 | var webStatus = clientStatuses.c();
1003 | switch (webStatus) {
1004 | case ONLINE: setImageDrawable((AppCompatImageView) callFrame.thisObject, getDrawable("ic_online"));break;
1005 | case DND: setImageDrawable((AppCompatImageView) callFrame.thisObject, getDrawable("ic_dnd"));break;
1006 | case IDLE: setImageDrawable((AppCompatImageView) callFrame.thisObject, getDrawable("ic_idle"));break;
1007 | }
1008 | switch (mobileStatus) {
1009 | case ONLINE: setImageDrawable((AppCompatImageView) callFrame.thisObject, getDrawable("ic_mobile"));break;
1010 | case DND: setImageDrawable((AppCompatImageView) callFrame.thisObject, getDrawable("ic_dnd"));break;
1011 | case IDLE: setImageDrawable((AppCompatImageView) callFrame.thisObject, getDrawable("ic_idle"));break;
1012 | }
1013 | switch (desktopStatus) {
1014 | case ONLINE: setImageDrawable((AppCompatImageView) callFrame.thisObject, getDrawable("ic_online"));break;
1015 | case DND: setImageDrawable((AppCompatImageView) callFrame.thisObject, getDrawable("ic_dnd"));break;
1016 | case IDLE: setImageDrawable((AppCompatImageView) callFrame.thisObject, getDrawable("ic_idle"));break;
1017 | }
1018 |
1019 | }
1020 | }));
1021 | }
1022 | }
1023 |
1024 | public Drawable getDrawable(String name) {
1025 | return ResourcesCompat.getDrawable(resources, resources.getIdentifier(name, "drawable", "com.aliucord.plugins"), null).mutate();
1026 |
1027 | }
1028 |
1029 | public void setSquareStatus(ClientStatuses clientStatuses, View avatar, String mode) {
1030 | Drawable square_status = null;
1031 | if(mode.equals("profile")) {
1032 | square_status = ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_profile_rectangle_status", "drawable", "com.aliucord.plugins"), null).mutate();
1033 | } else if(mode.equals("non-profile")) {
1034 | square_status = ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_rectangle_status_cml", "drawable", "com.aliucord.plugins"), null).mutate();
1035 | }
1036 | setStatus(clientStatuses, avatar, square_status);
1037 | }
1038 |
1039 | public void setRadialStatus(ClientStatuses clientStatuses, View avatar) {
1040 | Drawable radial_status = ResourcesCompat.getDrawable(resources, resources.getIdentifier("ic_radial_status", "drawable", "com.aliucord.plugins"), null).mutate();
1041 | setStatus(clientStatuses, avatar, radial_status);
1042 | }
1043 |
1044 | public void setStatus(ClientStatuses clientStatuses, View avatar, Drawable background /* (UserAvatarPresenceView) */) {
1045 |
1046 | var desktopStatus = clientStatuses.a();
1047 | var mobileStatus = clientStatuses.b();
1048 | var webStatus = clientStatuses.c();
1049 |
1050 | if(avatar != null) {
1051 | avatar.setPadding(8, 8, 8, 8);
1052 | avatar.setBackground(background);
1053 | }
1054 |
1055 | switch (webStatus) {
1056 | case ONLINE:
1057 | Objects.requireNonNull(background).setTint(0xFF3BA55C - 1);
1058 | break;
1059 | case DND:
1060 | Objects.requireNonNull(background).setTint(0xFFED4245 - 1);
1061 | break;
1062 | case IDLE:
1063 | Objects.requireNonNull(background).setTint(0xFFFAA61A - 1);
1064 | break;
1065 | }
1066 |
1067 | switch (desktopStatus) {
1068 | case ONLINE:
1069 | Objects.requireNonNull(background).setTint(0xFF3BA55C - 1);
1070 | break;
1071 | case DND:
1072 | Objects.requireNonNull(background).setTint(0xFFED4245 - 1);
1073 | break;
1074 | case IDLE:
1075 | Objects.requireNonNull(background).setTint(0xFFFAA61A - 1);
1076 | break;
1077 | }
1078 |
1079 | switch (mobileStatus) {
1080 | case ONLINE:
1081 | Objects.requireNonNull(background).setTint(0xFF3BA55C - 1);
1082 | break;
1083 | case DND:
1084 | Objects.requireNonNull(background).setTint(0xFFED4245 - 1);
1085 | break;
1086 | case IDLE:
1087 | Objects.requireNonNull(background).setTint(0xFFFAA61A - 1);
1088 | break;
1089 | }
1090 | }
1091 |
1092 | @Override
1093 | public void stop(Context context) {
1094 | patcher.unpatchAll();
1095 | }
1096 |
1097 | public static class BetterStatusSettings extends BottomSheet {
1098 | private final SettingsAPI settings;
1099 | public BetterStatusSettings(SettingsAPI settings) {
1100 | this.settings = settings;
1101 | }
1102 | public void onViewCreated(View view, Bundle bundle) {
1103 | super.onViewCreated(view, bundle);
1104 | CheckedSetting filled_status = Utils.createCheckedSetting(requireContext(), CheckedSetting.ViewType.SWITCH, "Filled Colors", "Uses filled colors for status.");
1105 |
1106 | filled_status.setChecked(settings.getBool("filled_colors", false));
1107 | filled_status.setOnCheckedListener(checked -> {
1108 | settings.setBool("filled_colors", checked);
1109 | Utils.showToast("Please restart Aliucord to apply");
1110 | });
1111 | addView(filled_status);
1112 |
1113 | CheckedSetting status_chat = Utils.createCheckedSetting(requireContext(), CheckedSetting.ViewType.SWITCH, "Chat Status", "Show little status circles in chat next to the username.");
1114 | status_chat.setChecked(settings.getBool("status_chat", true));
1115 | status_chat.setOnCheckedListener(checked -> {
1116 | settings.setBool("status_chat", checked);
1117 | Utils.showToast("Please restart Aliucord to apply");
1118 | });
1119 | addView(status_chat);
1120 |
1121 | CheckedSetting status_voice = Utils.createCheckedSetting(requireContext(), CheckedSetting.ViewType.SWITCH, "Voice Status", "Shows the status ring around the speaking user based on their status instead of only green.");
1122 | status_voice.setChecked(settings.getBool("status_voice", true));
1123 | status_voice.setOnCheckedListener(checked -> {
1124 | settings.setBool("status_voice", checked);
1125 | Utils.showToast("Please restart Aliucord to apply");
1126 | });
1127 | addView(status_voice);
1128 |
1129 | //------------------------------
1130 |
1131 | CheckedSetting radial_status_cml = Utils.createCheckedSetting(requireContext(), CheckedSetting.ViewType.SWITCH, "Radial Status (ChannelsMemberList)", "Shows a status ring around the user avatar in the ChannelsMembersList.");
1132 | radial_status_cml.setChecked(settings.getBool("radial_status_cml", true));
1133 | radial_status_cml.setOnCheckedListener(checked -> {
1134 | settings.setBool("radial_status_cml", checked);
1135 | Utils.showToast("Please restart Aliucord to apply");
1136 | });
1137 | addView(radial_status_cml);
1138 |
1139 | CheckedSetting radial_status_dm = Utils.createCheckedSetting(requireContext(), CheckedSetting.ViewType.SWITCH, "Radial Status (DM's)", "Shows a status ring around the user avatar in the DM List.");
1140 | radial_status_dm.setChecked(settings.getBool("radial_status_dm", true));
1141 | radial_status_dm.setOnCheckedListener(checked -> {
1142 | settings.setBool("radial_status_dm", checked);
1143 | Utils.showToast("Please restart Aliucord to apply");
1144 | });
1145 | addView(radial_status_dm);
1146 |
1147 | CheckedSetting radial_status_up = Utils.createCheckedSetting(requireContext(), CheckedSetting.ViewType.SWITCH, "Radial Status (UserProfile)", "Shows a status ring around the user avatar in the UserProfile.");
1148 | radial_status_up.setChecked(settings.getBool("radial_status_up", true));
1149 | radial_status_up.setOnCheckedListener(checked -> {
1150 | settings.setBool("radial_status_up", checked);
1151 | Utils.showToast("Please restart Aliucord to apply");
1152 | });
1153 | addView(radial_status_up);
1154 |
1155 | CheckedSetting radial_status_chat = Utils.createCheckedSetting(requireContext(), CheckedSetting.ViewType.SWITCH, "Radial Status (Chat)", "Shows a status ring around the user avatar in the Chat.");
1156 | radial_status_chat.setChecked(settings.getBool("radial_status_chat", true));
1157 | radial_status_chat.setOnCheckedListener(checked -> {
1158 | settings.setBool("radial_status_chat", checked);
1159 | Utils.showToast("Please restart Aliucord to apply");
1160 | });
1161 | addView(radial_status_chat);
1162 |
1163 | }
1164 | }
1165 | }
1166 |
--------------------------------------------------------------------------------