Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYi0526 committed Aug 5, 2024
2 parents 7f590fa + d5128c2 commit ed04970
Show file tree
Hide file tree
Showing 254 changed files with 21,618 additions and 3,770 deletions.
8 changes: 4 additions & 4 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ repositories {
}
}

def verName = "10.13.1"
def verCode = 1181
def verName = "10.14.5"
def verCode = 1187


def officialVer = "10.13.1"
def officialCode = 4845
def officialVer = "10.14.5"
def officialCode = 4945

def serviceAccountCredentialsFile = rootProject.file("service_account_credentials.json")

Expand Down
8 changes: 5 additions & 3 deletions TMessagesProj/jni/TgNetWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,11 @@ class Delegate : public ConnectiosManagerDelegate {
jniEnv[instanceNum]->CallStaticVoidMethod(jclass_ConnectionsManager, jclass_ConnectionsManager_onPremiumFloodWait, instanceNum, requestToken, isUpload);
}

void onIntegrityCheckClassic(int32_t instanceNum, int32_t requestToken, std::string nonce) {
void onIntegrityCheckClassic(int32_t instanceNum, int32_t requestToken, std::string project, std::string nonce) {
jstring projectStr = jniEnv[instanceNum]->NewStringUTF(project.c_str());
jstring nonceStr = jniEnv[instanceNum]->NewStringUTF(nonce.c_str());
jniEnv[instanceNum]->CallStaticVoidMethod(jclass_ConnectionsManager, jclass_ConnectionsManager_onIntegrityCheckClassic, instanceNum, requestToken, nonceStr);
jniEnv[instanceNum]->CallStaticVoidMethod(jclass_ConnectionsManager, jclass_ConnectionsManager_onIntegrityCheckClassic, instanceNum, requestToken, projectStr, nonceStr);
jniEnv[instanceNum]->DeleteLocalRef(projectStr);
jniEnv[instanceNum]->DeleteLocalRef(nonceStr);
}

Expand Down Expand Up @@ -719,7 +721,7 @@ extern "C" int registerNativeTgNetFunctions(JavaVM *vm, JNIEnv *env) {
if (jclass_ConnectionsManager_onPremiumFloodWait == 0) {
return JNI_FALSE;
}
jclass_ConnectionsManager_onIntegrityCheckClassic = env->GetStaticMethodID(jclass_ConnectionsManager, "onIntegrityCheckClassic", "(IILjava/lang/String;)V");
jclass_ConnectionsManager_onIntegrityCheckClassic = env->GetStaticMethodID(jclass_ConnectionsManager, "onIntegrityCheckClassic", "(IILjava/lang/String;Ljava/lang/String;)V");
if (jclass_ConnectionsManager_onIntegrityCheckClassic == 0) {
return JNI_FALSE;
}
Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/jni/gifvideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ enum PARAM_NUM {
PARAM_NUM_COUNT = 11,
};

extern "C" JNIEXPORT void JNICALL Java_org_telegram_ui_Components_AnimatedFileDrawable_getVideoInfo(JNIEnv *env, jclass clazz,jint sdkVersion, jstring src, jintArray data) {
extern "C" JNIEXPORT void JNICALL Java_org_telegram_ui_Components_AnimatedFileDrawable_getVideoInfo(JNIEnv *env, jclass clazz, jint sdkVersion, jstring src, jintArray data) {
VideoInfo *info = new VideoInfo();

char const *srcString = env->GetStringUTFChars(src, 0);
Expand Down
7 changes: 5 additions & 2 deletions TMessagesProj/jni/tgnet/ConnectionsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1305,12 +1305,15 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
}
} else if (error->error_code == 403 && error->error_message.find(integrityCheckClassic) != std::string::npos) {
discardResponse = true;
std::string nonce = error->error_message.substr(integrityCheckClassic.size(), error->error_message.size() - integrityCheckClassic.size());
std::string err = error->error_message;
int index = err.find('_', integrityCheckClassic.size());
std::string project = err.substr(integrityCheckClassic.size(), index - integrityCheckClassic.size());
std::string nonce = err.substr(integrityCheckClassic.size() + project.size() + 1, err.size() - (integrityCheckClassic.size() + project.size() + 1));
request->awaitingIntegrityCheck = true;
request->startTime = 0;
request->startTimeMillis = 0;
if (delegate != nullptr) {
delegate->onIntegrityCheckClassic(instanceNum, request->requestToken, nonce);
delegate->onIntegrityCheckClassic(instanceNum, request->requestToken, project, nonce);
}
} else {
bool failServerErrors = (request->requestFlags & RequestFlagFailOnServerErrors) == 0 || processEvenFailed;
Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/jni/tgnet/Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ typedef struct ConnectiosManagerDelegate {
virtual void getHostByName(std::string domain, int32_t instanceNum, ConnectionSocket *socket) = 0;
virtual int32_t getInitFlags(int32_t instanceNum) = 0;
virtual void onPremiumFloodWait(int32_t instanceNum, int32_t requestToken, bool isUpload) = 0;
virtual void onIntegrityCheckClassic(int32_t instanceNum, int32_t requestToken, std::string nonce) = 0;
virtual void onIntegrityCheckClassic(int32_t instanceNum, int32_t requestToken, std::string project, std::string nonce) = 0;
} ConnectiosManagerDelegate;

typedef struct HandshakeDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@
import androidx.recyclerview.widget.RecyclerView.ViewHolder;

import org.telegram.messenger.AndroidUtilities;
import org.telegram.ui.Cells.DialogCell;

import java.util.ArrayList;
import java.util.List;

import tw.nekomimi.nekogram.NekoConfig;
import xyz.nextalone.nagram.NaConfig;

/**
* This is a utility class to add swipe to dismiss and drag & drop support to RecyclerView.
Expand Down Expand Up @@ -1257,6 +1259,11 @@ public boolean isIdle() {
}

public int checkHorizontalSwipe(ViewHolder viewHolder, int flags) {
if (viewHolder != null && viewHolder.itemView instanceof DialogCell) {
if (((DialogCell) viewHolder.itemView).getCurrentDialogFolderId() == 0 && NaConfig.INSTANCE.getDoNotUnarchiveBySwipe().Bool()) {
return 0;
}
}
if ((flags & (LEFT | RIGHT)) != 0) {
final int dirFlag = mDx > 0 ? RIGHT : LEFT;
if (mVelocityTracker != null && mActivePointerId > -1) {
Expand Down
Loading

0 comments on commit ed04970

Please sign in to comment.