Skip to content

Instantly share code, notes, and snippets.

@7aitsev
Last active November 10, 2019 11:53
Show Gist options
  • Save 7aitsev/b07116c4522beb09c131e360ea4f1d8b to your computer and use it in GitHub Desktop.
Save 7aitsev/b07116c4522beb09c131e360ea4f1d8b to your computer and use it in GitHub Desktop.
Remove Voice Call Button from Telegram Desktop 1.6.3 (and above) on Arch Linux

The steps below are outdated, but the next section could still be helpful.

Using patch file

  1. Get familar with AES.

  2. Run asp checkout telegram-desktop

  3. cd to a directory with PKGBUILD in it

  4. Place no_call_btn.patch in the current directory

  5. Run the script

    old_hash=$(sha512sum tdesktop.patch | cut -f1 -d ' ')
    cat no_call_btn.patch >> tdesktop.patch
    new_hash=$(sha512sum tdesktop.patch | cut -f1 -d ' ')
    sed -i "s/$old_hash/$new_hash/" PKGBUILD
  6. Execute makepkg -si and wait for about an hour. You can speed up the build process by passing -j4 parameter in make and cmake arguments list or by configuring your /etc/makepkg.conf (see MAKEFLAGS option).

  7. If you are satisfied with the result, remove leftovers using makepkg -e --clean.

In order to preserve custom build of the client, add telegram-desktop to the section IgnorePkg in /etc/pacman.conf.

Manual editing

To keep Telegram Desktop up to date, one need to perform steps like the following:

  1. cd to the ABS directory tree and execute asp update.
  2. cd to a telegram-desktop directory with PKGBUILD in it.
  3. Run git clean -fd . to remove all unstaged changes and execute git pull.
  4. cd to trunk, download all the prerequisites, and remove all files related to the previouse build with makepkg -Co.
  5. Edit manually $srcdir/src/tdesktop/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp. ($srcdir == printf -- '%s/telegram-desktop/\n' $(fgrep BUILDDIR /etc/makepkg.conf | cut -d= -f2)).
  6. Build the package from modified sources with makepkg -e.
  7. If the build process complited without errors, install it: makepkg -i.
  8. If you are satisfied with the result, remove leftovers using rm -rf $srchdir.
diff --git a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp b/Telegram/SourceFiles/history/view/history_view_top_
bar_widget.cpp
index 92af82f9b..0880b42cd 100644
--- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp
+++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp
@@ -189,7 +189,7 @@ void TopBarWidget::onSearch() {
void TopBarWidget::onCall() {
if (const auto peer = _activeChat.peer()) {
if (const auto user = peer->asUser()) {
- user->session().calls().startOutgoingCall(user);
+ //user->session().calls().startOutgoingCall(user);
}
}
}
@@ -643,7 +643,8 @@ void TopBarWidget::updateControlsVisibility() {
}
return false;
}();
- _call->setVisible(historyMode && callsEnabled);
+ //_call->setVisible(historyMode && callsEnabled);
+ _call->setVisible(false);
if (_membersShowArea) {
_membersShowArea->show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment