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 Nov 25, 2024
2 parents 494412b + abfc8e2 commit 4d1b97e
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 66 deletions.
75 changes: 75 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
container:
image: teampgm/android-ndk:34-jdk17.0.10_7-ndk21.4.7075529-cmake3.18.1-ci
cpu: 4
memory: 12G

release_build_task:
skip: "changesInclude('.gitea/**', '.github/**', '**.md')"
checkout_script:
- cat /proc/cpuinfo
- git submodule init TMessagesProj/jni/dav1d TMessagesProj/jni/libvpx TMessagesProj/jni/ffmpeg TMessagesProj/jni/boringssl
- git submodule update TMessagesProj/jni/dav1d TMessagesProj/jni/libvpx TMessagesProj/jni/ffmpeg TMessagesProj/jni/boringssl
- echo "sdk.dir=${ANDROID_HOME}" > local.properties
- echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
ffmpeg_cache:
folders:
- TMessagesProj/jni/ffmpeg/build
- TMessagesProj/jni/libvpx/build
- TMessagesProj/jni/dav1d/build
fingerprint_script:
- git submodule status TMessagesProj/jni/ffmpeg
- git submodule status TMessagesProj/jni/libvpx
- git submodule status TMessagesProj/jni/dav1d
- cat TMessagesProj/jni/*ffmpeg*.sh
- cat TMessagesProj/jni/*libvpx*.sh
- cat TMessagesProj/jni/*dav1d*.sh
- cat TMessagesProj/jni/patches/ffmpeg/*
populate_script:
- cd /tmp/cirrus-ci-build
- ./run init libs libvpx
- ./run init libs dav1d
- ./run init libs ffmpeg
boringssl_cache:
folder: TMessagesProj/jni/boringssl/build
fingerprint_script:
- git submodule status TMessagesProj/jni/boringssl
- cat TMessagesProj/jni/*boringssl*.sh
- cat TMessagesProj/jni/patches/boringssl/*
populate_script:
- cd /tmp/cirrus-ci-build
- ./run init libs boringssl
gradle_cache:
folder: ~/.gradle/caches
native_cache:
folder: TMessagesProj/src/main/libs
fingerprint_script:
- cat TMessagesProj/jni/CMakeLists.txt
- git submodule status TMessagesProj/jni/ffmpeg
- git submodule status TMessagesProj/jni/boringssl
populate_script:
- cd /tmp/cirrus-ci-build/TMessagesProj/jni
- cd boringssl && git reset --hard && cd ..
- ./patch_boringssl.sh || true
- cd /tmp/cirrus-ci-build
- export NATIVE_TARGET="arm64-v8a"
- ./run libs native
environment:
LOCAL_PROPERTIES: ENCRYPTED[!453b03d8eefd2fe66111ab213ff55391f052d9585e98d071200ddcd4e2c34ca8631e28c2e493c20048ece5d5f2c0d0eb!]
HELPER_BOT_TOKEN: ENCRYPTED[!430d29eb9960a4382a29b077abfff1df00a48c7a05d39056d78e22bf77d3dc0ff6e284da9d55be9cfc56677cc99a5b68!]
HELPER_BOT_TARGET: ENCRYPTED[!e97d467b7a98fa9f48d571fefceb210fa9d825efc9a5f0318389ce1e71bb78bc1336865f1badc78524a740939e505a57!]
build_script:
- cd /tmp/cirrus-ci-build
- ./gradlew TMessagesProj:assembleRelease
binaries_artifacts:
path: "TMessagesProj/build/outputs/apk/release/*"
upload_script:
- python -m pip install -r bin/scripts/requirements.txt
- mkdir artifacts && cp -r TMessagesProj/build/outputs/apk/* artifacts/
- git log -1 --pretty=format:"%s%n%n%b" > artifacts/caption.txt
- python bin/scripts/upload.py $HELPER_BOT_TOKEN $HELPER_BOT_TARGET test
cleanup_before_cache_script:
- rm -rf ~/.gradle/caches/$GRADLE_VERSION/
- rm -rf ~/.gradle/caches/transforms-1
- rm -rf ~/.gradle/caches/journal-1
- rm -rf ~/.gradle/caches/jars-3/*/buildSrc.jar
- find ~/.gradle/caches/ -name "*.lock" -type f -delete || true
28 changes: 14 additions & 14 deletions TMessagesProj/jni/patch_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@ cp ffmpeg/libavformat/dv.h ffmpeg/build/arm64-v8a/include/libavformat/dv.h
cp ffmpeg/libavformat/isom.h ffmpeg/build/arm64-v8a/include/libavformat/isom.h
cp ffmpeg/libavformat/dv.h ffmpeg/build/armeabi-v7a/include/libavformat/dv.h
cp ffmpeg/libavformat/isom.h ffmpeg/build/armeabi-v7a/include/libavformat/isom.h
cp ffmpeg/libavformat/dv.h ffmpeg/build/x86/include/libavformat/dv.h
cp ffmpeg/libavformat/isom.h ffmpeg/build/x86/include/libavformat/isom.h
cp ffmpeg/libavformat/dv.h ffmpeg/build/x86_64/include/libavformat/dv.h
cp ffmpeg/libavformat/isom.h ffmpeg/build/x86_64/include/libavformat/isom.h
#cp ffmpeg/libavformat/dv.h ffmpeg/build/x86/include/libavformat/dv.h
#cp ffmpeg/libavformat/isom.h ffmpeg/build/x86/include/libavformat/isom.h
#cp ffmpeg/libavformat/dv.h ffmpeg/build/x86_64/include/libavformat/dv.h
#cp ffmpeg/libavformat/isom.h ffmpeg/build/x86_64/include/libavformat/isom.h

cp ffmpeg/libavcodec/bytestream.h ffmpeg/build/arm64-v8a/include/libavcodec/bytestream.h
cp ffmpeg/libavcodec/bytestream.h ffmpeg/build/armeabi-v7a/include/libavcodec/bytestream.h
cp ffmpeg/libavcodec/bytestream.h ffmpeg/build/x86/include/libavcodec/bytestream.h
cp ffmpeg/libavcodec/bytestream.h ffmpeg/build/x86_64/include/libavcodec/bytestream.h
#cp ffmpeg/libavcodec/bytestream.h ffmpeg/build/x86/include/libavcodec/bytestream.h
#cp ffmpeg/libavcodec/bytestream.h ffmpeg/build/x86_64/include/libavcodec/bytestream.h

cp ffmpeg/libavcodec/get_bits.h ffmpeg/build/arm64-v8a/include/libavcodec/get_bits.h
cp ffmpeg/libavcodec/get_bits.h ffmpeg/build/armeabi-v7a/include/libavcodec/get_bits.h
cp ffmpeg/libavcodec/get_bits.h ffmpeg/build/x86/include/libavcodec/get_bits.h
cp ffmpeg/libavcodec/get_bits.h ffmpeg/build/x86_64/include/libavcodec/get_bits.h
#cp ffmpeg/libavcodec/get_bits.h ffmpeg/build/x86/include/libavcodec/get_bits.h
#cp ffmpeg/libavcodec/get_bits.h ffmpeg/build/x86_64/include/libavcodec/get_bits.h

cp ffmpeg/libavcodec/golomb.h ffmpeg/build/arm64-v8a/include/libavcodec/golomb.h
cp ffmpeg/libavcodec/golomb.h ffmpeg/build/armeabi-v7a/include/libavcodec/golomb.h
cp ffmpeg/libavcodec/golomb.h ffmpeg/build/x86/include/libavcodec/golomb.h
cp ffmpeg/libavcodec/golomb.h ffmpeg/build/x86_64/include/libavcodec/golomb.h
#cp ffmpeg/libavcodec/golomb.h ffmpeg/build/x86/include/libavcodec/golomb.h
#cp ffmpeg/libavcodec/golomb.h ffmpeg/build/x86_64/include/libavcodec/golomb.h

cp ffmpeg/libavcodec/vlc.h ffmpeg/build/arm64-v8a/include/libavcodec/vlc.h
cp ffmpeg/libavcodec/vlc.h ffmpeg/build/armeabi-v7a/include/libavcodec/vlc.h
cp ffmpeg/libavcodec/vlc.h ffmpeg/build/x86/include/libavcodec/vlc.h
cp ffmpeg/libavcodec/vlc.h ffmpeg/build/x86_64/include/libavcodec/vlc.h
#cp ffmpeg/libavcodec/vlc.h ffmpeg/build/x86/include/libavcodec/vlc.h
#cp ffmpeg/libavcodec/vlc.h ffmpeg/build/x86_64/include/libavcodec/vlc.h

cp ffmpeg/libavutil/intmath.h ffmpeg/build/arm64-v8a/include/libavutil/intmath.h
cp ffmpeg/libavutil/intmath.h ffmpeg/build/armeabi-v7a/include/libavutil/intmath.h
cp ffmpeg/libavutil/intmath.h ffmpeg/build/x86/include/libavutil/intmath.h
cp ffmpeg/libavutil/intmath.h ffmpeg/build/x86_64/include/libavutil/intmath.h
#cp ffmpeg/libavutil/intmath.h ffmpeg/build/x86/include/libavutil/intmath.h
#cp ffmpeg/libavutil/intmath.h ffmpeg/build/x86_64/include/libavutil/intmath.h
Original file line number Diff line number Diff line change
Expand Up @@ -7470,7 +7470,7 @@ private TLRPC.ChatFull loadChatInfoInternal(long chatId, boolean isChannel, bool
user.status.expires = cursor.intValue(1);
}
loadedUsers.add(user);
participant.date = cursor.intValue(3);
//participant.date = cursor.intValue(3);
TLRPC.TL_chatChannelParticipant chatChannelParticipant = new TLRPC.TL_chatChannelParticipant();
chatChannelParticipant.user_id = MessageObject.getPeerId(participant.peer);
chatChannelParticipant.date = participant.date;
Expand Down
16 changes: 12 additions & 4 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatUsersActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,7 @@ private boolean createMenuForParticipant(final TLObject participant, boolean res
TLRPC.TL_chatBannedRights bannedRights;
TLRPC.TL_chatAdminRights adminRights;
String rank;
int joined;
if (participant instanceof TLRPC.ChannelParticipant) {
TLRPC.ChannelParticipant channelParticipant = (TLRPC.ChannelParticipant) participant;
peerId = MessageObject.getPeerId(channelParticipant.peer);
Expand All @@ -1801,6 +1802,7 @@ private boolean createMenuForParticipant(final TLObject participant, boolean res
adminRights = channelParticipant.admin_rights;
date = channelParticipant.date;
rank = channelParticipant.rank;
joined = channelParticipant.date;
} else if (participant instanceof TLRPC.ChatParticipant) {
TLRPC.ChatParticipant chatParticipant = (TLRPC.ChatParticipant) participant;
peerId = chatParticipant.user_id;
Expand All @@ -1809,13 +1811,15 @@ private boolean createMenuForParticipant(final TLObject participant, boolean res
bannedRights = null;
adminRights = null;
rank = "";
joined = chatParticipant.date;
} else {
peerId = 0;
canEdit = false;
bannedRights = null;
adminRights = null;
date = 0;
rank = null;
joined = 0;
}
if (peerId == 0 || peerId == getUserConfig().getClientUserId()) {
return false;
Expand All @@ -1832,14 +1836,14 @@ private boolean createMenuForParticipant(final TLObject participant, boolean res
}

boolean result = allowSetAdmin || (ChatObject.canBlockUsers(currentChat) && canEditAdmin);
if (resultOnly || !result) {
if (resultOnly || !result && joined == 0) {
return result;
}

Utilities.Callback<Integer> openRightsFor = action ->
openRightsEdit2(peerId, date, participant, adminRights, bannedRights, rank, canEditAdmin, action, false);

ItemOptions.makeOptions(this, view)
var options = ItemOptions.makeOptions(this, view)
.setScrimViewBackground(new ColorDrawable(Theme.getColor(Theme.key_windowBackgroundWhite)))
.addIf(allowSetAdmin, R.drawable.msg_admins, editingAdmin ? getString("EditAdminRights", R.string.EditAdminRights) : getString("SetAsAdmin", R.string.SetAsAdmin), () -> openRightsFor.run(0))
.addIf(canChangePermission, R.drawable.msg_permissions, getString("ChangePermissions", R.string.ChangePermissions), () -> {
Expand All @@ -1863,8 +1867,12 @@ private boolean createMenuForParticipant(final TLObject participant, boolean res
BulletinFactory.createRemoveFromChatBulletin(this, user, currentChat.title).show();
}
})
.setMinWidth(190)
.show();
.setMinWidth(190);
if (joined != 0) {
if (result) options.addGap();
options.addText(LocaleController.formatJoined(joined), 13);
}
options.show();
} else {

ItemOptions options = ItemOptions.makeOptions(this, view);
Expand Down
27 changes: 13 additions & 14 deletions TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -734,19 +734,18 @@ public void getOutline(View view, Outline outline) {
menu.setSubMenuOpenSide(1);
menu.setBackground(Theme.createSelectorDrawable(Theme.getColor(Theme.key_listSelector)));

menu.addSubItem(menu_proxy, R.drawable.msg2_proxy_on, LocaleController.getString("Proxy", R.string.Proxy))
.setContentDescription(LocaleController.getString("Proxy", R.string.Proxy));
menu.addSubItem(menu_language, R.drawable.ic_translate, LocaleController.getString("Language", R.string.Language))
.setContentDescription(LocaleController.getString("Language", R.string.Language));
menu.addSubItem(menu_bot_login, R.drawable.list_bot, LocaleController.getString("BotLogin", R.string.BotLogin))
.setContentDescription(LocaleController.getString("BotLogin", R.string.BotLogin));
menu.addSubItem(menu_qr_login, R.drawable.msg_qrcode, LocaleController.getString("ImportLogin", R.string.ImportLogin))
.setContentDescription(LocaleController.getString("ImportLogin", R.string.ImportLogin));
menu.addSubItem(menu_custom_api, R.drawable.baseline_vpn_key_24, LocaleController.getString("CustomApi", R.string.CustomApi))
.setContentDescription(LocaleController.getString("CustomApi", R.string.CustomApi));
menu.addSubItem(menu_custom_dc, R.drawable.msg_retry, LocaleController.getString("CustomBackend",
R.string.CustomBackend))
.setContentDescription(LocaleController.getString("CustomBackend", R.string.CustomBackend));
menu.addSubItem(menu_proxy, R.drawable.msg2_proxy_on, LocaleController.getString(R.string.Proxy))
.setContentDescription(LocaleController.getString(R.string.Proxy));
menu.addSubItem(menu_language, R.drawable.ic_translate, LocaleController.getString(R.string.Language))
.setContentDescription(LocaleController.getString(R.string.Language));
menu.addSubItem(menu_bot_login, R.drawable.list_bot, LocaleController.getString(R.string.BotLogin))
.setContentDescription(LocaleController.getString(R.string.BotLogin));
menu.addSubItem(menu_qr_login, R.drawable.msg_qrcode, LocaleController.getString(R.string.ImportLogin))
.setContentDescription(LocaleController.getString(R.string.ImportLogin));
menu.addSubItem(menu_custom_api, R.drawable.baseline_vpn_key_24, LocaleController.getString(R.string.CustomApi))
.setContentDescription(LocaleController.getString(R.string.CustomApi));
menu.addSubItem(menu_custom_dc, R.drawable.msg_retry, LocaleController.getString(R.string.CustomBackend))
.setContentDescription(LocaleController.getString(R.string.CustomBackend));

menu.setOnClickListener(v -> {
menu.toggleSubMenu();
Expand Down Expand Up @@ -2486,7 +2485,7 @@ public void afterTextChanged(Editable s) {
});
}

final boolean allowTestBackend = BuildVars.DEBUG_VERSION;
final boolean allowTestBackend = true;
if (allowTestBackend && activityMode == MODE_LOGIN) {
testBackendCheckBox = new CheckBoxCell(context, 2);
testBackendCheckBox.setText(getString(R.string.DebugTestBackend), "", testBackend = getConnectionsManager().isTestBackend(), false);
Expand Down
15 changes: 11 additions & 4 deletions TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -6452,6 +6452,7 @@ public boolean onMemberClick(TLRPC.ChatParticipant participant, boolean isLong,
boolean canEditAdmin;
boolean canRestrict;
boolean editingAdmin;
int joined;
final TLRPC.ChannelParticipant channelParticipant;

if (ChatObject.isChannel(currentChat)) {
Expand All @@ -6466,16 +6467,18 @@ public boolean onMemberClick(TLRPC.ChatParticipant participant, boolean isLong,
canRestrict = false;
}
editingAdmin = channelParticipant instanceof TLRPC.TL_channelParticipantAdmin;
joined = channelParticipant.date;
} else {
channelParticipant = null;
allowKick = currentChat.creator || participant instanceof TLRPC.TL_chatParticipant && (ChatObject.canBlockUsers(currentChat) || participant.inviter_id == getUserConfig().getClientUserId());
canEditAdmin = currentChat.creator;
canRestrict = currentChat.creator;
editingAdmin = participant instanceof TLRPC.TL_chatParticipantAdmin;
joined = participant.date;
}

boolean result = (canEditAdmin || canRestrict || allowKick);
if (resultOnly || !result) {
if (resultOnly || !result && joined == 0) {
return result;
}

Expand All @@ -6487,7 +6490,7 @@ public boolean onMemberClick(TLRPC.ChatParticipant participant, boolean isLong,
}
};

ItemOptions.makeOptions(this, view)
var options = ItemOptions.makeOptions(this, view)
.setScrimViewBackground(new ColorDrawable(Theme.getColor(Theme.key_windowBackgroundWhite)))
.addIf(canEditAdmin, R.drawable.msg_admins, editingAdmin ? LocaleController.getString(R.string.EditAdminRights) : LocaleController.getString(R.string.SetAsAdmin), () -> openRightsEdit.run(0))
.addIf(canRestrict, R.drawable.msg_permissions, LocaleController.getString(R.string.ChangePermissions), () -> {
Expand All @@ -6507,8 +6510,12 @@ public boolean onMemberClick(TLRPC.ChatParticipant participant, boolean isLong,
.addIf(allowKick, R.drawable.msg_remove, LocaleController.getString(R.string.KickFromGroup), true, () -> {
kickUser(selectedUser, participant);
})
.setMinWidth(190)
.show();
.setMinWidth(190);
if (joined != 0) {
if (result) options.addGap();
options.addText(LocaleController.formatJoined(joined), 13);
}
options.show();
} else {
if (participant.user_id == getUserConfig().getClientUserId()) {
return false;
Expand Down
Loading

0 comments on commit 4d1b97e

Please sign in to comment.