Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegraher 9.33.31 #156

Merged
merged 6 commits into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/Dockerfile_bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
asset_name: ${{ env.ANAME }}${{ env.AARCH }}.apk
asset_content_type: application/gzip
env:
RNAME: Telegraher 9.33.30
TNAME: graher_9.33.30_
ANAME: Telegraher.9.33.30.
RNAME: Telegraher 9.33.31
TNAME: graher_9.33.31_
ANAME: Telegraher.9.33.31.
AARCH: bundle
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ different)
* Realeases are
here: [https://github.com/nikitasius/Telegraher/releases](https://github.com/nikitasius/Telegraher/releases)
* if it contain `beta` it mean it's BETA
* Last release `9.33.30`: [bundle](https://github.com/nikitasius/Telegraher/releases/tag/graher_9.33.30_bundle)
* Last release `9.33.31`: [bundle](https://github.com/nikitasius/Telegraher/releases/tag/graher_9.33.31_bundle)
* Last beta: write `!beta` in chat

### Issues/Wishlist
Expand Down
6 changes: 6 additions & 0 deletions README_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changes

* 9.33.31
* fix from tg 9.4.0 for C-part tgnet
* disable premoji small & large
* option to hide video stickets in chats
* option to hide animated stickers in chats
* remove premoji from reactions also
* 9.33.30
* catch exception to avoid that function crash in theory in one function call after removing closequetly
* disable premium emojis in emoji header list
Expand Down
4 changes: 2 additions & 2 deletions TMessagesProj/jni/tgnet/ConnectionsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,8 @@ void ConnectionsManager::onConnectionDataReceived(Connection *connection, Native
if (datacenter->isHandshaking(connection->isMediaConnection)) {
datacenter->processHandshakeResponse(connection->isMediaConnection, object, messageId);
} else {
processServerResponse(object, messageId, 0, 0, connection, 0, 0);
connection->addProcessedMessageId(messageId);
connection->reconnect();
return;
}
lastProtocolUsefullData = true;
connection->setHasUsefullData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ public class TelegraherSettingsActivity extends BaseFragment implements Notifica
private int chatHideAllInSpoilersRow;
private int chatRealForwardedMessageTimeRow;
private int chatHideStickersRow;
private int chatHideAnimatedStickersRow;
private int chatHideVideoStickersRow;

private int videoLabelRoundBitrateRow;
private int videoRoundBitrateMultRow;
Expand Down Expand Up @@ -203,6 +205,8 @@ public boolean onFragmentCreate() {
chatHideAllInSpoilersRow = rowCount++;
chatRealForwardedMessageTimeRow = rowCount++;
chatHideStickersRow = rowCount++;
chatHideAnimatedStickersRow = rowCount++;
chatHideVideoStickersRow = rowCount++;

accountLabelRow = rowCount++;
accountSessionManagerRow = rowCount++;
Expand Down Expand Up @@ -399,6 +403,18 @@ public boolean supportsPredictiveItemAnimations() {
enabled = preferences.getBoolean("HideStickers", false);
editor.putBoolean("HideStickers", !enabled);
editor.apply();
} else if (position == chatHideAnimatedStickersRow) {
SharedPreferences preferences = MessagesController.getGlobalTelegraherSettings();
SharedPreferences.Editor editor = preferences.edit();
enabled = preferences.getBoolean("HideAnimatedStickers", false);
editor.putBoolean("HideAnimatedStickers", !enabled);
editor.apply();
} else if (position == chatHideVideoStickersRow) {
SharedPreferences preferences = MessagesController.getGlobalTelegraherSettings();
SharedPreferences.Editor editor = preferences.edit();
enabled = preferences.getBoolean("HideVideoStickers", false);
editor.putBoolean("HideVideoStickers", !enabled);
editor.apply();
} else if (position == accountExtendVanillaRow) {
SharedPreferences preferences = MessagesController.getGlobalTelegraherSettings();
SharedPreferences.Editor editor = preferences.edit();
Expand Down Expand Up @@ -702,6 +718,10 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
checkCell.setTextAndCheck(LocaleController.getString(R.string.THChatRealForwardedMessageTime), globalPreps.getBoolean("RealForwardedMessageTime", true), true);
} else if (position == chatHideStickersRow) {
checkCell.setTextAndCheck(LocaleController.getString(R.string.THChatHideStickers), globalPreps.getBoolean("HideStickers", false), true);
} else if (position == chatHideAnimatedStickersRow) {
checkCell.setTextAndCheck(LocaleController.getString(R.string.THChatHideAnimatedStickers), globalPreps.getBoolean("HideAnimatedStickers", false), true);
} else if (position == chatHideVideoStickersRow) {
checkCell.setTextAndCheck(LocaleController.getString(R.string.THChatHideVideoStickers), globalPreps.getBoolean("HideVideoStickers", false), true);
} else if (position == gifHDRow) {
checkCell.setTextAndCheck(LocaleController.getString(R.string.THEnableGifHD), globalPreps.getBoolean("EnableGifHD", false), true);
} else if (position == videoRoundUseMainCameraRow) {
Expand Down Expand Up @@ -961,7 +981,7 @@ public int getItemViewType(int position) {
|| position == hardwareDisableVibroRow
|| position == chatDeleteMarkRow || position == chatEnableMessageHistoryRow || position == accountExtendVanillaRow || position == chatSBFullRow
|| position == chatSwapToNextChannelRow || position == chatTabsOnForwardRow || position == chatDisableSpoilersRow || position == chatHideAllInSpoilersRow || position == chatRealForwardedMessageTimeRow
|| position == chatHideStickersRow
|| position == chatHideStickersRow || position == chatHideAnimatedStickersRow || position == chatHideVideoStickersRow
|| position == graheriumSpeedUpUpload || position == graheriumSpeedUpDownload || position == graheriumAnimateEveryAvatar || position == graheriumAnimatedStickerOverlays || position == graheriumVanillaStickerFlow || position == graheriumDisableEmojiStatus || position == graheriumDisablePremiumEmojis
|| position == gifHDRow || position == videoRoundUseMainCameraRow
|| position == uiAppHidePhoneNumberOnLeftPanelRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3717,6 +3717,7 @@ private ArrayList<TLRPC.Peer> getRecentRepliers() {
}

public void updateAnimatedEmojis() {
if (MessagesController.getGlobalTelegraherSettings().getBoolean("GraheriumDisablePremiumEmojis", false)) return;
if (!imageReceiversAttachState) {
return;
}
Expand Down Expand Up @@ -4009,6 +4010,7 @@ private void checkImageReceiversAttachState() {
if (currentMessageObject != null && !currentMessageObject.mediaExists) {
int canDownload = DownloadController.getInstance(currentAccount).canDownloadMedia(currentMessageObject.messageOwner);
TLRPC.Document document = currentMessageObject.getDocument();
if (MessageObject.isAnimatedStickerDocument(document, true)) return;
boolean loadDocumentFromImageReceiver = MessageObject.isStickerDocument(document) || MessageObject.isAnimatedStickerDocument(document, true) || MessageObject.isGifDocument(document) || MessageObject.isRoundVideoDocument(document);
if (!loadDocumentFromImageReceiver) {
TLRPC.PhotoSize photo = document == null ? FileLoader.getClosestPhotoSizeWithSize(currentMessageObject.photoThumbs, AndroidUtilities.getPhotoSize()) : null;
Expand All @@ -4026,9 +4028,11 @@ private void checkImageReceiversAttachState() {
updateButtonState(false, false, false);
}
}
animatedEmojiReplyStack = AnimatedEmojiSpan.update(AnimatedEmojiDrawable.CACHE_TYPE_MESSAGES, this, false, animatedEmojiReplyStack, replyTextLayout);
animatedEmojiDescriptionStack = AnimatedEmojiSpan.update(AnimatedEmojiDrawable.CACHE_TYPE_MESSAGES, this, false, animatedEmojiDescriptionStack, descriptionLayout);
updateAnimatedEmojis();
if(!MessagesController.getGlobalTelegraherSettings().getBoolean("GraheriumDisablePremiumEmojis", false)){
animatedEmojiReplyStack = AnimatedEmojiSpan.update(AnimatedEmojiDrawable.CACHE_TYPE_MESSAGES, this, false, animatedEmojiReplyStack, replyTextLayout);
animatedEmojiDescriptionStack = AnimatedEmojiSpan.update(AnimatedEmojiDrawable.CACHE_TYPE_MESSAGES, this, false, animatedEmojiDescriptionStack, descriptionLayout);
updateAnimatedEmojis();
}
} else {
radialProgress.onDetachedFromWindow();
videoRadialProgress.onDetachedFromWindow();
Expand All @@ -4049,6 +4053,7 @@ private void checkImageReceiversAttachState() {

if (currentMessageObject != null && !currentMessageObject.mediaExists && !currentMessageObject.putInDownloadsStore && !DownloadController.getInstance(currentAccount).isDownloading(currentMessageObject.messageOwner.id)) {
TLRPC.Document document = currentMessageObject.getDocument();
if (MessageObject.isAnimatedStickerDocument(document, true)) return;
boolean loadDocumentFromImageReceiver = MessageObject.isStickerDocument(document) || MessageObject.isAnimatedStickerDocument(document, true) || MessageObject.isGifDocument(document) || MessageObject.isRoundVideoDocument(document);
if (!loadDocumentFromImageReceiver) {
if (document != null) {
Expand All @@ -4061,9 +4066,11 @@ private void checkImageReceiversAttachState() {
}
}
}
AnimatedEmojiSpan.release(this, animatedEmojiDescriptionStack);
AnimatedEmojiSpan.release(this, animatedEmojiReplyStack);
AnimatedEmojiSpan.release(this, animatedEmojiStack);
if(!MessagesController.getGlobalTelegraherSettings().getBoolean("GraheriumDisablePremiumEmojis", false)) {
AnimatedEmojiSpan.release(this, animatedEmojiDescriptionStack);
AnimatedEmojiSpan.release(this, animatedEmojiReplyStack);
AnimatedEmojiSpan.release(this, animatedEmojiStack);
}
}
}

Expand Down Expand Up @@ -6419,7 +6426,21 @@ private void setMessageContent(MessageObject messageObject, MessageObject.Groupe
if (!(drawTopic && (currentMessageObject != null && currentMessageObject.replyMessageObject != null || forwardedNameLayout != null && forwardedNameLayout[0] != null))) {
additionHeight -= AndroidUtilities.dp(17);
}
} else if (!MessagesController.getGlobalTelegraherSettings().getBoolean("HideStickers", false) && messageObject.isAnyKindOfSticker()) {
} else if (
!MessagesController.getGlobalTelegraherSettings().getBoolean("HideStickers", false) && messageObject.isAnyKindOfSticker()
&& !(
MessagesController.getGlobalTelegraherSettings().getBoolean("GraheriumDisablePremiumEmojis", false)
&& messageObject.isAnimatedAnimatedEmoji()
)
&& !(
MessagesController.getGlobalTelegraherSettings().getBoolean("HideVideoStickers", false)
&& messageObject.isVideoSticker()
)
&& !(
MessagesController.getGlobalTelegraherSettings().getBoolean("HideAnimatedStickers", false)
&& messageObject.isAnimatedSticker()
)
) {

drawBackground = false;
boolean isWebpSticker = messageObject.type == MessageObject.TYPE_STICKER;
Expand Down
4 changes: 2 additions & 2 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23882,7 +23882,7 @@ public void onSwipeBackProgress(PopupSwipeBackLayout layout, float toProgress, f
}
}

if (stickerSets.size() > 0 && !getMessagesController().premiumLocked) {
if (!MessagesController.getGlobalTelegraherSettings().getBoolean("GraheriumDisablePremiumEmojis", false) && stickerSets.size() > 0 && !getMessagesController().premiumLocked) {
View gap = new FrameLayout(contentView.getContext());
gap.setBackgroundColor(getThemedColor(Theme.key_actionBarDefaultSubmenuSeparator));
popupLayout.addView(gap, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 8));
Expand Down Expand Up @@ -27338,7 +27338,7 @@ public void didPressUrl(ChatMessageCell cell, final CharacterStyle url, boolean

@Override
public boolean didPressAnimatedEmoji(ChatMessageCell cell, AnimatedEmojiSpan span) {
if (getMessagesController().premiumLocked || span == null || span.standard) {
if (MessagesController.getGlobalTelegraherSettings().getBoolean("GraheriumDisablePremiumEmojis", false) || getMessagesController().premiumLocked || span == null || span.standard) {
return false;
}
long documentId = span.getDocumentId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ public Bulletin createEmojiLoadingBulletin(TLRPC.Document document, CharSequence
}

public Bulletin createContainsEmojiBulletin(TLRPC.Document document, boolean inTopic, Utilities.Callback<TLRPC.InputStickerSet> openSet) {
if (MessagesController.getGlobalTelegraherSettings().getBoolean("GraheriumDisablePremiumEmojis", false)) return null;
TLRPC.InputStickerSet inputStickerSet = MessageObject.getInputStickerSet(document);
if (inputStickerSet == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.LocaleController;
import org.telegram.messenger.MediaDataController;
import org.telegram.messenger.MessageObject;
import org.telegram.messenger.NotificationCenter;
import org.telegram.messenger.R;
import org.telegram.messenger.*;
import org.telegram.tgnet.TLRPC;
import org.telegram.ui.ActionBar.Theme;

Expand Down Expand Up @@ -369,4 +364,4 @@ protected void onAttachedToWindow() {
}
NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.groupStickersDidLoad);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ private void updateCustomReactionsButton() {
customEmojiStickerSets.clear();
ArrayList<TLRPC.InputStickerSet> sets = new ArrayList<>();
HashSet<Long> setIds = new HashSet<>();
if (MessagesController.getGlobalTelegraherSettings().getBoolean("GraheriumDisablePremiumEmojis", false)) {
customReactionsEmoji.clear();
return;
}
for (int i = 0; i < customReactionsEmoji.size(); i++) {
TLRPC.InputStickerSet stickerSet = MessageObject.getInputStickerSet(AnimatedEmojiDrawable.findDocument(currentAccount, customReactionsEmoji.get(i).documentId));
if (stickerSet != null && !setIds.contains(stickerSet.id)) {
Expand Down Expand Up @@ -541,4 +545,4 @@ public ReactedUsersListView setOnCustomEmojiSelectedListener(OnCustomEmojiSelect
this.onCustomEmojiSelectedListener = onCustomEmojiSelectedListener;
return this;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
}

boolean showSettings = baseFragment != null && type != TYPE_TOPIC_ICON;
emojiTabs = new EmojiTabsStrip(context, null, false, true, type, showSettings ? () -> {
emojiTabs = new EmojiTabsStrip(context, null, false, !(MessagesController.getGlobalTelegraherSettings().getBoolean("GraheriumDisablePremiumEmojis", false)), type, showSettings ? () -> {
onSettings();
baseFragment.presentFragment(new StickersActivity(MediaDataController.TYPE_EMOJIPACKS, frozenEmojiPacks));
if (dismiss != null) {
Expand Down Expand Up @@ -2522,6 +2522,7 @@ private void updateRows(boolean updateEmojipacks, boolean diff) {
}
ArrayList<TLRPC.TL_messages_stickerSet> installedEmojipacks = frozenEmojiPacks;
ArrayList<TLRPC.StickerSetCovered> featuredEmojiPacks = new ArrayList<>(mediaDataController.getFeaturedEmojiSets());
if ((MessagesController.getGlobalTelegraherSettings().getBoolean("GraheriumDisablePremiumEmojis", false))) featuredEmojiPacks.clear();

ArrayList<Integer> prevRowHashCodes = new ArrayList<>(rowHashCodes);
totalCount = 0;
Expand Down
2 changes: 2 additions & 0 deletions TMessagesProj/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,6 @@
<string name="THUserRestrictionsSendGames">Отправка Игр</string>
<string name="THUserRestrictionsUseInlineBots">Использование Инлайн-Ботов</string>
<string name="THGraheriumDisablePremiumEmojis">Отключить премиум emoji</string>
<string name="THChatHideVideoStickers">Скрывать видео стикеры в чатах</string>
<string name="THChatHideAnimatedStickers">Скрывать анимированные стикеры в чатах</string>
</resources>
2 changes: 2 additions & 0 deletions TMessagesProj/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6164,4 +6164,6 @@
<string name="THUserRestrictionsSendGames">Send Games</string>
<string name="THUserRestrictionsUseInlineBots">Use Inline Bots</string>
<string name="THGraheriumDisablePremiumEmojis">Disable premium emojis</string>
<string name="THChatHideVideoStickers">Hide video stickers in chats</string>
<string name="THChatHideAnimatedStickers">Hide animated stickers in chats</string>
</resources>
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Sat Mar 12 05:53:50 MSK 2016
APP_VERSION_NAME=9.33.30
APP_VERSION_CODE=3026030
APP_VERSION_NAME=9.33.31
APP_VERSION_CODE=3026031
APP_PACKAGE=com.evildayz.code.telegraher2
RELEASE_KEY_PASSWORD=android
RELEASE_KEY_ALIAS=androidkey
Expand Down