Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
+118
View File
@@ -0,0 +1,118 @@
# Contributing
This document describes how you can contribute to Telegram-iOS. Please read it carefully.
**Table of Contents**
* [What contributions are accepted](#what-contributions-are-accepted)
* [Build instructions](#build-instructions)
* [Pull upstream changes into your fork regularly](#pull-upstream-changes-into-your-fork-regularly)
* [How to get your pull request accepted](#how-to-get-your-pull-request-accepted)
* [Keep your pull requests limited to a single issue](#keep-your-pull-requests-limited-to-a-single-issue)
* [Squash your commits to a single commit](#squash-your-commits-to-a-single-commit)
* [Don't mix code changes with whitespace cleanup](#dont-mix-code-changes-with-whitespace-cleanup)
* [Keep your code simple!](#keep-your-code-simple)
* [Test your changes!](#test-your-changes)
* [Write a good commit message](#write-a-good-commit-message)
## What contributions are accepted
We highly appreciate your contributions in the matter of fixing bugs and optimizing the Telegram-iOS source code and its documentation. In case of fixing the existing user experience please push to your fork and [submit a pull request][pr].
Wait for us. We try to review your pull requests as fast as possible.
If we find issues with your pull request, we may suggest some changes and improvements.
Unfortunately we **do not merge** any pull requests that have new feature implementations, translations to new languages and those which introduce any new user interface elements.
If you have a translations-related contribution, check out [Translations platform][translate].
Telegram-iOS is not a standalone application but a part of [Telegram project][telegram], so all the decisions about the features, languages, user experience, user interface and the design are made inside Telegram team, often according to some roadmap which is not public.
## Build instructions
See the [README.md][build_instructions] for details on the various build
environments.
## Pull upstream changes into your fork regularly
Telegram-iOS is advancing quickly. It is therefore critical that you pull upstream changes into your fork on a regular basis. Nothing is worse than putting in a days of hard work into a pull request only to have it rejected because it has diverged too far from upstream.
To pull in upstream changes:
git remote add upstream https://github.com/TelegramMessenger/Telegram-iOS.git
git fetch upstream master
Check the log to be sure that you actually want the changes, before merging:
git log upstream/master
Then rebase your changes on the latest commits in the `master` branch:
git rebase upstream/master
After that, you have to force push your commits:
git push --force
For more info, see [GitHub Help][help_fork_repo].
## How to get your pull request accepted
We want to improve Telegram-iOS with your contributions. But we also want to provide a stable experience for our users and the community. Follow these rules and you should succeed without a problem!
### Keep your pull requests limited to a single issue
Pull requests should be as small/atomic as possible. Large, wide-sweeping changes in a pull request will be **rejected**, with comments to isolate the specific code in your pull request. Some examples:
* If you are making spelling corrections in the docs, don't modify other files.
* If you are adding new functions don't '*cleanup*' unrelated functions. That cleanup belongs in another pull request.
#### Squash your commits to a single commit
To keep the history of the project clean, you should make one commit per pull request.
If you already have multiple commits, you can add the commits together (squash them) with the following commands in Git Bash:
1. Open `Git Bash` (or `Git Shell`)
2. Enter following command to squash the recent {N} commits: `git reset --soft HEAD~{N} && git commit` (replace `{N}` with the number of commits you want to squash)
3. Press <kbd>i</kbd> to get into Insert-mode
4. Enter the commit message of the new commit
5. After adding the message, press <kbd>ESC</kbd> to get out of the Insert-mode
6. Write `:wq` and press <kbd>Enter</kbd> to save the new message or write `:q!` to discard your changes
7. Enter `git push --force` to push the new commit to the remote repository
For example, if you want to squash the last 5 commits, use `git reset --soft HEAD~5 && git commit`
### Don't mix code changes with whitespace cleanup
If you change two lines of code and correct 200 lines of whitespace issues in a file the diff on that pull request is functionally unreadable and will be **rejected**. Whitespace cleanups need to be in their own pull request.
### Keep your code simple!
Please keep your code as clean and straightforward as possible.
Furthermore, the pixel shortage is over. We want to see:
* `opacity` instead of `o`
* `placeholder` instead of `ph`
* `myFunctionThatDoesThings()` instead of `mftdt()`
### Test your changes!
Before you submit a pull request, please test your changes. Verify that Telegram-iOS still works and your changes don't cause other issue or crashes.
### Write a good commit message
* Explain why you make the changes. [More infos about a good commit message.][commit_message]
* If you fix an issue with your commit, please close the issue by [adding one of the keywords and the issue number][closing-issues-via-commit-messages] to your commit message.
For example: `Fix #545`
[//]: # (LINKS)
[telegram]: https://telegram.org/
[help_fork_repo]: https://help.github.com/articles/fork-a-repo/
[help_change_commit_message]: https://help.github.com/articles/changing-a-commit-message/
[commit_message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[pr]: https://github.com/TelegramMessenger/Telegram-iOS/compare
[build_instructions]: https://github.com/TelegramMessenger/Telegram-iOS#quick-compilation-guide
[closing-issues-via-commit-messages]: https://help.github.com/articles/closing-issues-via-commit-messages/
[translate]: https://translations.telegram.org
+40
View File
@@ -0,0 +1,40 @@
---
name: "\U0001F41E Bug Report"
about: "Report a bug if something isn't working as expected in Telegram Messenger for iOS."
title: ""
labels: bug
assignees: ""
---
<!-- Thanks for reporting issues of Telegram Messenger for iOS!
This is a bug report template. Please, be as descriptive as possible. Issues lacking detail, or for any other reason than to report a bug, may be closed without action.
First, complete the checklist by replacing the empty checkboxes [] with checked ones [x]. -->
### Checklist
- [ ] I am reporting an issue in existing functionality that does not work as intended
- [ ] I've searched for existing [GitHub issues](https://github.com/telegrammessenger/Telegram-iOS/issues)
### Description
Describe the issue that you are experiencing
### Expected Behavior
Tell us what should happen
### Actual Behavior
Tell us what happens instead
### Steps to Reproduce
1.
2.
3.
### Screenshots and Videos
Remove, if not applicable
### Environment
**Device:** `iPhone/iPad X`
**iOS version**: `13.X`
**App version:** `7.X`
+109
View File
@@ -0,0 +1,109 @@
name: CI
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
fetch-depth: '0'
- name: Set active Xcode path
run: |
XCODE_VERSION=$(cat versions.json | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["xcode"]);')
sudo xcode-select -s /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer
- name: Create canonical source directory
run: |
set -x
sudo mkdir -p /Users/Shared
cp -R $GITHUB_WORKSPACE /Users/Shared/
mv /Users/Shared/$(basename $GITHUB_WORKSPACE) /Users/Shared/telegram-ios
- name: Build the App
run: |
set -x
# source code paths are included in the final binary, so we need to make them stable across builds
SOURCE_DIR=/Users/Shared/telegram-ios
# use canonical bazel root
BAZEL_USER_ROOT="/private/var/tmp/_bazel_containerhost"
cd $SOURCE_DIR
BUILD_NUMBER_OFFSET="$(cat build_number_offset)"
export APP_VERSION=$(cat versions.json | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["app"]);')
export COMMIT_COUNT=$(git rev-list --count HEAD)
export COMMIT_COUNT="$(($COMMIT_COUNT+$BUILD_NUMBER_OFFSET))"
export BUILD_NUMBER="$COMMIT_COUNT"
echo "BUILD_NUMBER=$(echo $BUILD_NUMBER)" >> $GITHUB_ENV
echo "APP_VERSION=$(echo $APP_VERSION)" >> $GITHUB_ENV
python3 build-system/Make/ImportCertificates.py --path build-system/fake-codesigning/certs
python3 -u build-system/Make/Make.py \
--bazelUserRoot="$BAZEL_USER_ROOT" \
build \
--configurationPath="build-system/appstore-configuration.json" \
--codesigningInformationPath=build-system/fake-codesigning \
--configuration=release_arm64 \
--buildNumber="$BUILD_NUMBER"
# collect ipa
OUTPUT_PATH="build/artifacts"
rm -rf "$OUTPUT_PATH"
mkdir -p "$OUTPUT_PATH"
for f in bazel-out/applebin_ios-ios_arm*-opt-ST-*/bin/Telegram/Telegram.ipa; do
cp "$f" $OUTPUT_PATH/
done
# collect dsym
mkdir -p build/DSYMs
for f in bazel-out/applebin_ios-ios_arm*-opt-ST-*/bin/Telegram/*.dSYM; do
cp -R "$f" build/DSYMs/
done
zip -r "./$OUTPUT_PATH/Telegram.DSYMs.zip" build/DSYMs 1>/dev/null
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: build-${{ env.BUILD_NUMBER }}
release_name: Telegram ${{ env.APP_VERSION }} (${{ env.BUILD_NUMBER }})
body: |
An unsigned build of Telegram for iOS ${{ env.APP_VERSION }} (${{ env.BUILD_NUMBER }})
draft: false
prerelease: false
- name: Upload Release IPA
id: upload-release-ipa
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /Users/Shared/telegram-ios/build/artifacts/Telegram.ipa
asset_name: Telegram.ipa
asset_content_type: application/zip
- name: Upload Release DSYM
id: upload-release-dsym
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /Users/Shared/telegram-ios/build/artifacts/Telegram.DSYMs.zip
asset_name: Telegram.DSYMs.zip
asset_content_type: application/zip