Skip to content

Commit

Permalink
Update 10.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
et-ness committed Feb 9, 2024
2 parents 433a54a + 5dd6491 commit fa04111
Show file tree
Hide file tree
Showing 182 changed files with 7,032 additions and 1,785 deletions.
2 changes: 1 addition & 1 deletion TMessagesProj/jni/tgnet/ConnectionsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2387,7 +2387,7 @@ void ConnectionsManager::processRequestQueue(uint32_t connectionTypes, uint32_t
}
}
if (request->retryCount >= retryMax) {
if (LOGS_ENABLED) DEBUG_E("timed out %s", typeInfo.name());
if (LOGS_ENABLED) DEBUG_E("timed out %s, message_id = 0x%" PRIx64, typeInfo.name(), request->messageId);
auto error = new TL_error();
error->code = -123;
error->text = "RETRY_LIMIT";
Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/src/main/assets/bluebubbles.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ chat_inReplyNameText=-14643754
chats_onlineCircle=-13192972
chat_outAudioSelectedProgress=-7484939
chat_inInstant=-14707230
avatar_backgroundSaved=-10438409
avatar_backgroundSaved=-9847303
chats_sentReadCheck=-15754010
chats_nameMessageArchived=-7237231
chat_outSentCheckSelected=-14968350
Expand Down
5 changes: 4 additions & 1 deletion TMessagesProj/src/main/assets/darkblue.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ windowBackgroundWhiteBlueIcon=-528890628
chat_goDownButtonCounterBackground=-11425042
actionBarActionModeDefault=-14273984
actionBarActionModeDefaultTop=-14536643
actionBarActionModeReaction=318767103
actionBarActionModeReactionText=-1
actionBarActionModeReactionDot=-13287865
statisticChartHintLine=452984831
chats_menuPhone=-1816080163
chat_outViews=-7357217
Expand Down Expand Up @@ -425,7 +428,7 @@ chats_attachMessage=-8548712
chat_topPanelBackground=-14602949
chat_outSentClock=-8213557
dialogBackgroundGray=-14932431
chat_searchPanelText=-8796932
chat_searchPanelText=-1
chat_inContactIcon=-1
code_comment=-2130706433
chat_outCodeBackground=857487708
Expand Down
5 changes: 4 additions & 1 deletion TMessagesProj/src/main/assets/night.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ chat_inSentClockSelected=-7490861
chat_goDownButtonCounterBackground=-11425042
actionBarActionModeDefault=-14211289
actionBarActionModeDefaultTop=-14277082
actionBarActionModeReaction=318767103
actionBarActionModeReactionText=-1
actionBarActionModeReactionDot=-13287865
statisticChartHintLine=452984831
chats_menuPhone=-1815557944
chat_outViews=-7357217
Expand Down Expand Up @@ -450,7 +453,7 @@ chats_attachMessage=-8224126
chat_topPanelBackground=-15066597
chat_outSentClock=-6698513
dialogBackgroundGray=-14013910
chat_searchPanelText=-10767620
chat_searchPanelText=-1
chat_inContactIcon=-1
code_comment=-2130706433
chat_outCodeBackground=859062986
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ public boolean animateChange(RecyclerView.ViewHolder oldHolder, RecyclerView.Vie
return true;
}

void animateChangeImpl(final ChangeInfo changeInfo) {
public void animateChangeImpl(final ChangeInfo changeInfo) {
final RecyclerView.ViewHolder holder = changeInfo.oldHolder;
final View view = holder == null ? null : holder.itemView;
final RecyclerView.ViewHolder newHolder = changeInfo.newHolder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ public boolean animateChange(RecyclerView.ViewHolder oldHolder, RecyclerView.Vie
return true;
}

void animateChangeImpl(final ChangeInfo changeInfo) {
public void animateChangeImpl(final ChangeInfo changeInfo) {
final RecyclerView.ViewHolder holder = changeInfo.oldHolder;
final View view = holder == null ? null : holder.itemView;
final RecyclerView.ViewHolder newHolder = changeInfo.newHolder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public class SQLitePreparedStatement {

private long startTime;
private String query;
//private static HashMap<SQLitePreparedStatement, String> hashMap;

public long getStatementHandle() {
return sqliteStatementHandle;
Expand Down Expand Up @@ -112,9 +111,6 @@ public void finalizeQuery() {
}
}
try {
/*if (BuildVars.DEBUG_PRIVATE_VERSION) {
hashMap.remove(this);
}*/
isFinalized = true;
finalize(sqliteStatementHandle);
} catch (SQLiteException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import android.text.style.URLSpan;
import android.text.util.Linkify;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.Pair;
import android.util.StateSet;
import android.util.TypedValue;
Expand Down Expand Up @@ -152,6 +153,7 @@
import org.telegram.ui.Components.PickerBottomLayout;
import org.telegram.ui.Components.PipRoundVideoView;
import org.telegram.ui.Components.PipVideoOverlay;
import org.telegram.ui.Components.RLottieImageView;
import org.telegram.ui.Components.RecyclerListView;
import org.telegram.ui.Components.ShareAlert;
import org.telegram.ui.Components.TypefaceSpan;
Expand Down Expand Up @@ -311,6 +313,7 @@ public class AndroidUtilities {
};

public static final String STICKERS_PLACEHOLDER_PACK_NAME = "tg_placeholders_android";
public static final String STICKERS_PLACEHOLDER_PACK_NAME_2 = "tg_superplaceholders_android_2";

private static boolean containsUnsupportedCharacters(String text) {
if (text.contains("\u202C")) {
Expand Down Expand Up @@ -4370,6 +4373,7 @@ public static float distanceInfluenceForSnapDuration(float f) {
}

public static void makeAccessibilityAnnouncement(CharSequence what) {
if (TextUtils.isEmpty(what)) return;
AccessibilityManager am = (AccessibilityManager) ApplicationLoader.applicationContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
if (am.isEnabled()) {
AccessibilityEvent ev = AccessibilityEvent.obtain();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,6 @@ public static boolean isConnectedToWiFi() {
return false;
}

public static boolean useLessData() {
ensureCurrentNetworkGet();
return BuildVars.DEBUG_PRIVATE_VERSION && (SharedConfig.forceLessData || isConnectionSlow());
}

public static boolean isConnectionSlow() {
try {
ensureCurrentNetworkGet(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ChatMessagesMetadataController(ChatActivity chatActivity) {
}

public void checkMessages(ChatActivity.ChatActivityAdapter chatAdapter, int maxAdapterPosition, int minAdapterPosition, long currentTime) {
ArrayList<MessageObject> messages = chatActivity.messages;
ArrayList<MessageObject> messages = chatAdapter.getMessages();
if (!chatActivity.isInScheduleMode() && maxAdapterPosition >= 0 && minAdapterPosition >= 0) {
int from = minAdapterPosition - chatAdapter.messagesStartRow - 10;
int to = maxAdapterPosition - chatAdapter.messagesStartRow + 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1409,10 +1409,22 @@ public static int migrate(MessagesStorage messagesStorage, int version) throws E
version = 138;
}

if (version == 138) {
database.executeFast("CREATE TABLE IF NOT EXISTS saved_reaction_tags (data BLOB);").stepThis().dispose();
database.executeFast("PRAGMA user_version = 139").stepThis().dispose();
version = 139;
if (version == 138 || version == 139 || version == 140 || version == 141) {
database.executeFast("DROP TABLE IF EXISTS tag_message_id;").stepThis().dispose();
database.executeFast("CREATE TABLE tag_message_id(mid INTEGER, topic_id INTEGER, tag INTEGER, text TEXT);").stepThis().dispose();
database.executeFast("CREATE INDEX IF NOT EXISTS tag_idx_tag_message_id ON tag_message_id(tag);").stepThis().dispose();
database.executeFast("CREATE INDEX IF NOT EXISTS tag_text_idx_tag_message_id ON tag_message_id(tag, text);").stepThis().dispose();
database.executeFast("CREATE INDEX IF NOT EXISTS tag_topic_idx_tag_message_id ON tag_message_id(topic_id, tag);").stepThis().dispose();
database.executeFast("CREATE INDEX IF NOT EXISTS tag_topic_text_idx_tag_message_id ON tag_message_id(topic_id, tag, text);").stepThis().dispose();
database.executeFast("PRAGMA user_version = 142").stepThis().dispose();
version = 142;
}

if (version == 142) {
database.executeFast("DROP TABLE IF EXISTS saved_reaction_tags;").stepThis().dispose();
database.executeFast("CREATE TABLE saved_reaction_tags (topic_id INTEGER PRIMARY KEY, data BLOB);").stepThis().dispose();
database.executeFast("PRAGMA user_version = 143").stepThis().dispose();
version = 143;
}

return version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static SvgHelper.SvgDrawable getSvgThumb(ArrayList<TLRPC.PhotoSize> sizes
TLRPC.PhotoSize photoSize = sizes.get(a);
if (photoSize instanceof TLRPC.TL_photoPathSize) {
photoPathSize = (TLRPC.TL_photoPathSize) photoSize;
} else {
} else if (photoSize instanceof TLRPC.TL_photoSize) {
w = photoSize.w;
h = photoSize.h;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,7 @@ protected void startDownloadRequest(int useConnectionType) {
}
}, null, null, flags, datacenterId, connectionType, isLast);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("debug_loading: " + cacheFileFinal.getName() + " dc=" + datacenterId + " send reqId " + requestInfo.requestToken + " offset=" + requestInfo.offset + " conType=" + connectionType + " priority=");
FileLog.d("debug_loading: " + cacheFileFinal.getName() + " dc=" + datacenterId + " send reqId " + requestInfo.requestToken + " offset=" + requestInfo.offset + " conType=" + connectionType + " priority=" + priority);
}
requestsCount++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ public boolean isLocallyCreatedFile(String path) {
loaderQueue.checkLoadingOperations(operation.isStory && priority >= PRIORITY_HIGH);

if (BuildVars.LOGS_ENABLED) {
FileLog.d("create load operation fileName=" + finalFileName + " documentName=" + getDocumentFileName(document) + " size=" + AndroidUtilities.formatFileSize(operation.totalBytesCount) + " position in queue " + operation.getPositionInQueue() + " account=" + currentAccount);
FileLog.d("create load operation fileName=" + finalFileName + " documentName=" + getDocumentFileName(document) + " size=" + AndroidUtilities.formatFileSize(operation.totalBytesCount) + " position in queue " + operation.getPositionInQueue() + " account=" + currentAccount + " cacheType=" + cacheType);
}
return operation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public FileLog() {
private static Gson gson;
private static HashSet<String> excludeRequests;

public static void dumpResponseAndRequest(TLObject request, TLObject response, TLRPC.TL_error error, long requestMsgId, long startRequestTimeInMillis, int requestToken) {
public static void dumpResponseAndRequest(int account, TLObject request, TLObject response, TLRPC.TL_error error, long requestMsgId, long startRequestTimeInMillis, int requestToken) {
if (!BuildVars.DEBUG_PRIVATE_VERSION || !BuildVars.LOGS_ENABLED || request == null) {
return;
}
Expand All @@ -97,7 +97,7 @@ public static void dumpResponseAndRequest(TLObject request, TLObject response, T
long time = System.currentTimeMillis();
FileLog.getInstance().logQueue.postRunnable(() -> {
try {
String metadata = "requestMsgId=" + requestMsgId + " requestingTime=" + (System.currentTimeMillis() - startRequestTimeInMillis) + " request_token=" + requestToken;
String metadata = "requestMsgId=" + requestMsgId + " requestingTime=" + (System.currentTimeMillis() - startRequestTimeInMillis) + " request_token=" + requestToken + " account=" + account;
FileLog.getInstance().tlStreamWriter.write(getInstance().dateFormat.format(time) + " " + metadata);
FileLog.getInstance().tlStreamWriter.write("\n");
FileLog.getInstance().tlStreamWriter.write(req);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.os.SystemClock;
import android.util.SparseArray;
import android.util.Log;

import org.telegram.tgnet.RequestDelegate;
import org.telegram.tgnet.TLObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,31 @@ public static String formatSeenDate(long date) {
return "LOC_ERR";
}

public static String formatPmSeenDate(long date) {
try {
date *= 1000;
Calendar rightNow = Calendar.getInstance();
int day = rightNow.get(Calendar.DAY_OF_YEAR);
int year = rightNow.get(Calendar.YEAR);
rightNow.setTimeInMillis(date);
int dateDay = rightNow.get(Calendar.DAY_OF_YEAR);
int dateYear = rightNow.get(Calendar.YEAR);

if (dateDay == day && year == dateYear) {
return LocaleController.formatString(R.string.PmReadTodayAt, getInstance().formatterDay.format(new Date(date)));
} else if (dateDay + 1 == day && year == dateYear) {
return LocaleController.formatString(R.string.PmReadYesterdayAt, getInstance().formatterDay.format(new Date(date)));
} else if (Math.abs(System.currentTimeMillis() - date) < 31536000000L) {
return LocaleController.formatString(R.string.PmReadDateTimeAt, getInstance().formatterDayMonth.format(new Date(date)), getInstance().formatterDay.format(new Date(date)));
} else {
return LocaleController.formatString(R.string.PmReadDateTimeAt, getInstance().formatterYear.format(new Date(date)), getInstance().formatterDay.format(new Date(date)));
}
} catch (Exception e) {
FileLog.e(e);
}
return "LOC_ERR";
}

public static String formatShortDate(long date) {
try {
date *= 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
import android.util.SparseArray;
import android.view.HapticFeedbackConstants;
Expand Down Expand Up @@ -84,6 +83,7 @@
import org.telegram.ui.Components.EmbedBottomSheet;
import org.telegram.ui.Components.PhotoFilterView;
import org.telegram.ui.Components.PipRoundVideoView;
import org.telegram.ui.Components.Reactions.ReactionsLayoutInBubble;
import org.telegram.ui.Components.VideoPlayer;
import org.telegram.ui.LaunchActivity;
import org.telegram.ui.PhotoViewer;
Expand Down Expand Up @@ -2403,10 +2403,10 @@ public void loadMoreMusic() {
//TODO topics
if (!playlistEndReached[0]) {
loadingPlaylist = true;
AccountInstance.getInstance(playingMessageObject.currentAccount).getMediaDataController().loadMedia(playingMessageObject.getDialogId(), 50, playlistMaxId[0], 0, MediaDataController.MEDIA_MUSIC, 0, 1, playlistClassGuid, 0);
AccountInstance.getInstance(playingMessageObject.currentAccount).getMediaDataController().loadMedia(playingMessageObject.getDialogId(), 50, playlistMaxId[0], 0, MediaDataController.MEDIA_MUSIC, 0, 1, playlistClassGuid, 0, null, null);
} else if (playlistMergeDialogId != 0 && !playlistEndReached[1]) {
loadingPlaylist = true;
AccountInstance.getInstance(playingMessageObject.currentAccount).getMediaDataController().loadMedia(playlistMergeDialogId, 50, playlistMaxId[0], 0, MediaDataController.MEDIA_MUSIC, 0, 1, playlistClassGuid, 0);
AccountInstance.getInstance(playingMessageObject.currentAccount).getMediaDataController().loadMedia(playlistMergeDialogId, 50, playlistMaxId[0], 0, MediaDataController.MEDIA_MUSIC, 0, 1, playlistClassGuid, 0, null, null);
}
}

Expand Down Expand Up @@ -5578,13 +5578,16 @@ public static class PlaylistGlobalSearchParams {
final String query;
final FiltersView.MediaFilterData filter;
final long dialogId;
public long topicId;
final long minDate;
final long maxDate;
public int totalCount;
public boolean endReached;
public int nextSearchRate;
public int folderId;

public ReactionsLayoutInBubble.VisibleReaction reaction;

public PlaylistGlobalSearchParams(String query, long dialogId, long minDate, long maxDate, FiltersView.MediaFilterData filter) {
this.filter = filter;
this.query = query;
Expand Down
Loading

0 comments on commit fa04111

Please sign in to comment.