From 97ef5f33e23632d00e2869bd6a094ac09d06a0b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sat, 1 Aug 2020 10:33:54 +0800 Subject: [PATCH] Refinds --- .github/workflows/dev.yml | 63 ------------------- .../org/telegram/ui/ChatEditActivity.java | 6 +- .../java/org/telegram/ui/ProfileActivity.java | 41 ++++++++---- bin/upload_alaha.sh | 25 ++++++++ 4 files changed, 57 insertions(+), 78 deletions(-) delete mode 100644 .github/workflows/dev.yml create mode 100755 bin/upload_alaha.sh diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml deleted file mode 100644 index ef2b603cc..000000000 --- a/.github/workflows/dev.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Dev Branch Build - -on: - push: - paths-ignore: - - '**.md' - - '.github/**' - - '!.github/workflows/**' - branches: - - dev - -jobs: - canaryBuild: - name: Canary Build - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[s]')" - steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v1 - with: - path: ~/.gradle - key: gradle-${{ hashFiles('**/*.gradle') }} - - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Run Gradle Build - run: | - sudo bash < { + ChatEditTypeActivity fragment = new ChatEditTypeActivity(chat_id, chatInfo.can_set_location); + fragment.setInfo(chatInfo); + presentFragment(fragment); + return Unit.INSTANCE; + }); } + + builder.addItem(LocaleController.getString("Copy", R.string.Copy), R.drawable.baseline_content_copy_24, __ -> { + AlertUtil.copyAndAlert("@" + currentChat.username); + return Unit.INSTANCE; + }); + + builder.addItem(LocaleController.getString("CopyLink", R.string.CopyLink), R.drawable.baseline_link_24, __ -> { + AlertUtil.copyAndAlert("https://t.me/" + currentChat.username); + return Unit.INSTANCE; + }); + + builder.show(); } } else if (position == locationRow) { if (chatInfo.location instanceof TLRPC.TL_channelLocation) { @@ -6124,7 +6136,12 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. detailCell.setTextAndValue(text, LocaleController.getString("Username", R.string.Username), false); } else if (currentChat != null) { TLRPC.Chat chat = getMessagesController().getChat(chat_id); - detailCell.setTextAndValue(getMessagesController().linkPrefix + "/" + chat.username, LocaleController.getString("InviteLink", R.string.InviteLink), false); + if (chat != null && !TextUtils.isEmpty(chat.username)) { + text = "@" + chat.username; + } else { + text = "-"; + } + detailCell.setTextAndValue(text, LocaleController.getString("Username", R.string.Username), false); } } else if (position == locationRow) { if (chatInfo != null && chatInfo.location instanceof TLRPC.TL_channelLocation) { diff --git a/bin/upload_alaha.sh b/bin/upload_alaha.sh new file mode 100755 index 000000000..d6e5153b1 --- /dev/null +++ b/bin/upload_alaha.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +outPath="TMessagesProj/build/outputs/apk/full/release" + +#./gradlew TMessagesProj:assembleFullRelease || exit 1 + +rm -f $outPath/*universal* + +for apk in $outPath/*.apk; do + + echo ">> Uploading $apk" + + curl https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument \ + -X POST \ + -F chat_id="$TELEGRAM_CHANNEL" \ + -F document="@$apk" \ + --silent --show-error --fail > /dev/null & + +done + +trap 'kill $(jobs -p)' SIGINT + +for job in `jobs -p`; do + wait $job +done \ No newline at end of file