[WIP] Patchset for Telegram Desktop, heavily inspired by inugram
Find a file
2026-05-04 14:18:46 +00:00
.claude/skills ru strings + dynamic fast messages slots + ui streaming mode fix 2026-05-04 18:16:56 +04:00
docs feat: initial commit 2026-04-28 20:47:02 +06:00
patches ru strings + dynamic fast messages slots + ui streaming mode fix 2026-05-04 18:16:56 +04:00
res ru strings + dynamic fast messages slots + ui streaming mode fix 2026-05-04 18:16:56 +04:00
scripts fix(export): preserve blob hashes in binary patch blocks 2026-05-03 03:55:41 +06:00
src/cpp/arcanegram ru strings + dynamic fast messages slots + ui streaming mode fix 2026-05-04 18:16:56 +04:00
.gitattributes feat: initial commit 2026-04-28 20:47:02 +06:00
.gitignore ru strings + dynamic fast messages slots + ui streaming mode fix 2026-05-04 18:16:56 +04:00
AGENTS.md feat: initial commit 2026-04-28 20:47:02 +06:00
build-telegram.bat fix(build): pin cmake generator to vs 2026 / v145 2026-04-29 04:14:36 +06:00
BUILD.md docs(build): drop manual Libraries/win64 wipe step 2026-04-29 02:21:38 +06:00
eslint.config.js feat: initial commit 2026-04-28 20:47:02 +06:00
LICENSE docs: switch to unlicense + no-support clause 2026-04-29 01:52:12 +06:00
package.json feat: initial commit 2026-04-28 20:47:02 +06:00
pnpm-lock.yaml feat: initial commit 2026-04-28 20:47:02 +06:00
pnpm-workspace.yaml feat: initial commit 2026-04-28 20:47:02 +06:00
prepare-deps.bat feat: initial commit 2026-04-28 20:47:02 +06:00
README.md docs: switch to unlicense + no-support clause 2026-04-29 01:52:12 +06:00
series ru strings + dynamic fast messages slots + ui streaming mode fix 2026-05-04 18:16:56 +04:00
setup-vcvars.bat feat: initial commit 2026-04-28 20:47:02 +06:00
tsconfig.json feat: initial commit 2026-04-28 20:47:02 +06:00
upstream-commit chore: bump upstream to 2cfdf1b32e 2026-04-28 21:24:34 +06:00

Arcanegram

Personal patchset for Telegram Desktop.

No support, no warranty, no promises. Issues, questions, and feature requests will not be answered. Use at your own risk. See LICENSE.

Inspired by inugram (Telegram Android patchset).

Layout

  • patches/ — exported .patch files, applied in order from series.
  • series — patch order; export target, do not hand-edit.
  • upstream-commit — pinned tdesktop SHA.
  • src/cpp/arcanegram/ — fork C++ code, junctioned into the worktree at setup.
  • res/ — fork-owned resources (lang strings, icons).
  • worktree/ — gitignored local tdesktop checkout managed by stgit.

Patch groups: bugfix | feature | debloat | hooks | misc.

Setup

Requirements:

  • Node 20+, pnpm
  • git, stgit (stg --version)
  • tdesktop build toolchain — see tdesktop build docs
pnpm install
pnpm run setup

Clones tdesktop into worktree/ (with submodules — first run is ~15 min, ~5 GB), applies patches, junctions fork code in. Open worktree/ in your IDE and build the Telegram target.

Adding / modifying patches

cd worktree
stg new feature__my-thing -m 'short description'
# ...edit worktree...
stg refresh
cd ..
pnpm run export
git add patches/ series
git commit -m "feat(patches): short description"

To edit an existing patch, push it to the top first:

cd worktree && stg float feature__my-thing
# ...edit...
stg refresh
cd .. && pnpm run export

Rebasing onto newer upstream

pnpm run rebase latest
# ...resolve any conflicts in worktree, then:
pnpm run export

Windows specifics

  • Directory junctions are used instead of symlinks for the fork-source dir, so no admin / dev mode required.
  • File-level "symlinks" fall back to copy + git update-index --skip-worktree on platforms that refuse fs.symlink for files.

Known issues

  • Windows debug binary crashes on launch (stack overflow, 0xc00000fd). libavif v1.3.0 and tg_owt (WebRTC) both statically bundle their own copies of libyuv. With AVIF_LIBYUV=OFF (what prepare.py sets), libavif's CMake explicitly compiles its bundled libyuv source files as a fallback (line ~441 of libavif's CMakeLists.txt). At Telegram's final link, both avif.lib and tg_owt.lib define the same libyuv symbols — LNK2005 for ~50 symbols including ScalePlane, CopyPlane, etc. misc/build-support.patch adds /FORCE:MULTIPLE so the link succeeds, but the resulting binary crashes early due to libyuv version/ABI mismatch.

    Stock tdesktop CI hides this on every successful run because libavif is loaded from the GitHub Actions cache (built fresh long before the conflict appeared). On any cache miss they would hit the same crash. So this is a real upstream issue, not something patches in this repo can solve cleanly. Real fix would require deduplicating libyuv at the dep-build level — modifying prepare.py to build libavif against an external libyuv binary, or refactoring tg_owt to not bundle its copy.

License

Unlicense (public domain) with an explicit no-support clause. Do whatever you want with the code; expect nothing in return.