diff --git a/TMessagesProj/jni/TgNetWrapper.cpp b/TMessagesProj/jni/TgNetWrapper.cpp index 5f9215579..737dfe9c4 100644 --- a/TMessagesProj/jni/TgNetWrapper.cpp +++ b/TMessagesProj/jni/TgNetWrapper.cpp @@ -349,7 +349,7 @@ class Delegate : public ConnectiosManagerDelegate { } void onProxyError(int32_t instanceNum) { - jniEnv[instanceNum]->CallStaticVoidMethod(jclass_ConnectionsManager, jclass_ConnectionsManager_onProxyError); + jniEnv[instanceNum]->CallStaticVoidMethod(jclass_ConnectionsManager, jclass_ConnectionsManager_onProxyError, instanceNum); } void getHostByName(std::string domain, int32_t instanceNum, ConnectionSocket *socket) { @@ -600,7 +600,7 @@ extern "C" int registerNativeTgNetFunctions(JavaVM *vm, JNIEnv *env) { if (jclass_ConnectionsManager_onRequestNewServerIpAndPort == 0) { return JNI_FALSE; } - jclass_ConnectionsManager_onProxyError = env->GetStaticMethodID(jclass_ConnectionsManager, "onProxyError", "()V"); + jclass_ConnectionsManager_onProxyError = env->GetStaticMethodID(jclass_ConnectionsManager, "onProxyError", "(I)V"); if (jclass_ConnectionsManager_onProxyError == 0) { return JNI_FALSE; } diff --git a/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java b/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java index b4ae2da0c..df2e20c63 100644 --- a/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java +++ b/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java @@ -565,7 +565,9 @@ public class ConnectionsManager extends BaseController { }); } - public static void onProxyError() { + public static void onProxyError(int instanceNum) { + if (UserConfig.selectedAccount != instanceNum) return; + AndroidUtilities.runOnUIThread(() -> { NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needShowAlert, 3); });