Skip to content

Commit a906f12

Browse files
committed
update to 10.10.1 (4583)
1 parent 3a822b1 commit a906f12

File tree

66 files changed

+780
-298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+780
-298
lines changed

TMessagesProj/src/main/java/org/telegram/messenger/DatabaseMigrationHelper.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,6 +1490,13 @@ public static int migrate(MessagesStorage messagesStorage, int version) throws E
14901490
version = 151;
14911491
}
14921492

1493+
if (version == 151) {
1494+
database.executeFast("ALTER TABLE profile_stories ADD COLUMN seen INTEGER default 0;").stepThis().dispose();
1495+
1496+
database.executeFast("PRAGMA user_version = 152").stepThis().dispose();
1497+
version = 152;
1498+
}
1499+
14931500
return version;
14941501
}
14951502

TMessagesProj/src/main/java/org/telegram/messenger/FileUploadOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ private void startUploadRequest() {
673673
}
674674
}), forceSmallFile ? ConnectionsManager.RequestFlagCanCompress : 0, ConnectionsManager.DEFAULT_DATACENTER_ID, connectionType, true);
675675
if (BuildVars.LOGS_ENABLED) {
676-
FileLog.d("debug_uploading: " + " send reqId " + requestToken[0] + " " + uploadingFilePath);
676+
FileLog.d("debug_uploading: " + " send reqId " + requestToken[0] + " " + uploadingFilePath + " file_part=" + currentRequestPartNum + " isBig=" + isBigFile + " file_id=" + currentFileId);
677677
}
678678
requestTokens.put(requestNumFinal, requestToken[0]);
679679
}

TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3836,8 +3836,8 @@ public void requestAudioFocus(boolean request) {
38363836
}
38373837
}
38383838

3839-
public void prepareResumedRecording(int currentAccount, MediaDataController.DraftVoice draft, long dialogId, MessageObject replyToMsg, MessageObject replyToTopMsg, TL_stories.StoryItem replyStory, int guid, boolean manual, String query_shortcut, int query_shortcut_id) {
3840-
manualRecording = manual;
3839+
public void prepareResumedRecording(int currentAccount, MediaDataController.DraftVoice draft, long dialogId, MessageObject replyToMsg, MessageObject replyToTopMsg, TL_stories.StoryItem replyStory, int guid, String query_shortcut, int query_shortcut_id) {
3840+
manualRecording = false;
38413841
requestAudioFocus(true);
38423842
recordQueue.cancelRunnable(recordStartRunnable);
38433843
recordQueue.postRunnable(() -> {
@@ -4151,6 +4151,22 @@ public void generateWaveform(MessageObject messageObject) {
41514151
});
41524152
}
41534153

4154+
public void cleanRecording(boolean delete) {
4155+
recordingAudio = null;
4156+
AutoDeleteMediaTask.unlockFile(recordingAudioFile);
4157+
if (delete && recordingAudioFile != null) {
4158+
try {
4159+
recordingAudioFile.delete();
4160+
} catch (Exception e) {
4161+
FileLog.e(e);
4162+
}
4163+
}
4164+
recordingAudioFile = null;
4165+
manualRecording = false;
4166+
raiseToEarRecord = false;
4167+
ignoreOnPause = false;
4168+
}
4169+
41544170
private void stopRecordingInternal(final int send, boolean notify, int scheduleDate, boolean once) {
41554171
if (send != 0) {
41564172
final TLRPC.TL_document audioToSend = recordingAudio;

TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public ChatlistUpdatesStat(TL_chatlists.TL_chatlists_chatlistUpdates value) {
242242
public boolean dialogFiltersLoaded;
243243
public ArrayList<TLRPC.TL_dialogFilterSuggested> suggestedFilters = new ArrayList<>();
244244

245-
private LongSparseArray<ArrayList<TLRPC.Updates>> updatesQueueChannels = new LongSparseArray<>();
245+
private final LongSparseArray<ArrayList<TLRPC.Updates>> updatesQueueChannels = new LongSparseArray<>();
246246
private LongSparseLongArray updatesStartWaitTimeChannels = new LongSparseLongArray();
247247
private LongSparseIntArray channelsPts = new LongSparseIntArray();
248248
private LongSparseArray<Boolean> gettingDifferenceChannels = new LongSparseArray<>();
@@ -13485,9 +13485,11 @@ public void addUserToChat(
1348513485
});
1348613486
return;
1348713487
}
13488-
if (processInvitedUsers != null) {
13489-
processInvitedUsers.run(null);
13490-
}
13488+
AndroidUtilities.runOnUIThread(() -> {
13489+
if (processInvitedUsers != null) {
13490+
processInvitedUsers.run(null);
13491+
}
13492+
});
1349113493
if ("USER_ALREADY_PARTICIPANT".equals(error.text) && ignoreIfAlreadyExists) {
1349213494
if (onFinishRunnable != null) {
1349313495
AndroidUtilities.runOnUIThread(onFinishRunnable);
@@ -13523,9 +13525,11 @@ public void addUserToChat(
1352313525
updates = (TLRPC.Updates) response;
1352413526
} else {
1352513527
FileLog.e("unexpected " + response + " in addUserToChat");
13526-
if (processInvitedUsers != null) {
13527-
processInvitedUsers.run(null);
13528-
}
13528+
AndroidUtilities.runOnUIThread(() -> {
13529+
if (processInvitedUsers != null) {
13530+
processInvitedUsers.run(null);
13531+
}
13532+
});
1352913533
return;
1353013534
}
1353113535
for (int a = 0; a < updates.updates.size(); a++) {

TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public class MessagesStorage extends BaseController {
104104
}
105105
}
106106

107-
public final static int LAST_DB_VERSION = 151;
107+
public final static int LAST_DB_VERSION = 152;
108108
private boolean databaseMigrationInProgress;
109109
public boolean showClearDatabaseAlert;
110110
private LongSparseIntArray dialogIsForum = new LongSparseIntArray();
@@ -698,7 +698,7 @@ public static void createTables(SQLiteDatabase database) throws SQLiteException
698698
database.executeFast("CREATE TABLE stories (dialog_id INTEGER, story_id INTEGER, data BLOB, custom_params BLOB, PRIMARY KEY (dialog_id, story_id));").stepThis().dispose();
699699
database.executeFast("CREATE TABLE stories_counter (dialog_id INTEGER PRIMARY KEY, count INTEGER, max_read INTEGER);").stepThis().dispose();
700700

701-
database.executeFast("CREATE TABLE profile_stories (dialog_id INTEGER, story_id INTEGER, data BLOB, type INTEGER, PRIMARY KEY(dialog_id, story_id));").stepThis().dispose();
701+
database.executeFast("CREATE TABLE profile_stories (dialog_id INTEGER, story_id INTEGER, data BLOB, type INTEGER, seen INTEGER, PRIMARY KEY(dialog_id, story_id));").stepThis().dispose();
702702

703703
database.executeFast("CREATE TABLE story_drafts (id INTEGER PRIMARY KEY, date INTEGER, data BLOB, type INTEGER);").stepThis().dispose();
704704

TMessagesProj/src/main/java/org/telegram/messenger/SegmentTree.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
public class SegmentTree {
44

55
private Node[] heap;
6-
private int[] array;
6+
private long[] array;
77

8-
public SegmentTree(int[] array) {
8+
public SegmentTree(long[] array) {
99
this.array = array;
1010
if (array.length < 30) {
1111
return;
@@ -37,9 +37,9 @@ private void build(int v, int from, int size) {
3737
}
3838
}
3939

40-
public int rMaxQ(int from, int to) {
40+
public long rMaxQ(int from, int to) {
4141
if (array.length < 30) {
42-
int max = Integer.MIN_VALUE;
42+
long max = Long.MIN_VALUE;
4343
if (from < 0) from = 0;
4444
if (to > array.length - 1) to = array.length - 1;
4545
for (int i = from; i <= to; i++) {
@@ -50,7 +50,7 @@ public int rMaxQ(int from, int to) {
5050
return rMaxQ(1, from, to);
5151
}
5252

53-
private int rMaxQ(int v, int from, int to) {
53+
private long rMaxQ(int v, int from, int to) {
5454
Node n = heap[v];
5555
//If you did a range update that contained this node, you can infer the Min value without going down the tree
5656
if (n.pendingVal != null && contains(n.from, n.to, from, to)) {
@@ -63,18 +63,18 @@ private int rMaxQ(int v, int from, int to) {
6363

6464
if (intersects(from, to, n.from, n.to)) {
6565
propagate(v);
66-
int leftMin = rMaxQ(2 * v, from, to);
67-
int rightMin = rMaxQ(2 * v + 1, from, to);
66+
final long leftMin = rMaxQ(2 * v, from, to);
67+
final long rightMin = rMaxQ(2 * v + 1, from, to);
6868

6969
return Math.max(leftMin, rightMin);
7070
}
7171

7272
return 0;
7373
}
7474

75-
public int rMinQ(int from, int to) {
75+
public long rMinQ(int from, int to) {
7676
if (array.length < 30) {
77-
int min = Integer.MAX_VALUE;
77+
long min = Long.MAX_VALUE;
7878
if (from < 0) from = 0;
7979
if (to > array.length - 1) to = array.length - 1;
8080
for (int i = from; i <= to; i++) {
@@ -85,7 +85,7 @@ public int rMinQ(int from, int to) {
8585
return rMinQ(1, from, to);
8686
}
8787

88-
private int rMinQ(int v, int from, int to) {
88+
private long rMinQ(int v, int from, int to) {
8989
Node n = heap[v];
9090
//If you did a range update that contained this node, you can infer the Min value without going down the tree
9191
if (n.pendingVal != null && contains(n.from, n.to, from, to)) {
@@ -98,8 +98,8 @@ private int rMinQ(int v, int from, int to) {
9898

9999
if (intersects(from, to, n.from, n.to)) {
100100
propagate(v);
101-
int leftMin = rMinQ(2 * v, from, to);
102-
int rightMin = rMinQ(2 * v + 1, from, to);
101+
long leftMin = rMinQ(2 * v, from, to);
102+
long rightMin = rMinQ(2 * v + 1, from, to);
103103

104104
return Math.min(leftMin, rightMin);
105105
}
@@ -136,9 +136,9 @@ private boolean intersects(int from1, int to1, int from2, int to2) {
136136
}
137137

138138
static class Node {
139-
int sum;
140-
int max;
141-
int min;
139+
long sum;
140+
long max;
141+
long min;
142142

143143
Integer pendingVal = null;
144144
int from;

TMessagesProj/src/main/java/org/telegram/messenger/video/WebmEncoder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ private void setupMatrix(VideoEditedInfo.MediaEntity entity) {
445445
if (bitmap != null) {
446446
entity.matrix.postScale(1f / bitmap.getWidth(), 1f / bitmap.getHeight());
447447
}
448+
if ((entity.subType & 2) != 0) {
449+
entity.matrix.postScale(-1, 1, .5f, .5f);
450+
}
448451
entity.matrix.postScale(entity.width * W, entity.height * H);
449452
entity.matrix.postTranslate(entity.x * W, entity.y * H);
450453
entity.matrix.postRotate((float) (-entity.rotation / Math.PI * 180), (entity.x + entity.width) * W, (entity.x + entity.height) * H);

TMessagesProj/src/main/java/org/telegram/tgnet/tl/TL_stories.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,28 @@ public void serializeToStream(AbstractSerializedData stream) {
11281128
}
11291129
}
11301130

1131+
public static class TL_stories_incrementStoryViews extends TLObject {
1132+
public static final int constructor = 0xb2028afb;
1133+
1134+
public TLRPC.InputPeer peer;
1135+
public ArrayList<Integer> id = new ArrayList<>();
1136+
1137+
public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) {
1138+
return TLRPC.Bool.TLdeserialize(stream, constructor, exception);
1139+
}
1140+
1141+
public void serializeToStream(AbstractSerializedData stream) {
1142+
stream.writeInt32(constructor);
1143+
peer.serializeToStream(stream);
1144+
stream.writeInt32(0x1cb5c415);
1145+
int count = id.size();
1146+
stream.writeInt32(count);
1147+
for (int a = 0; a < count; a++) {
1148+
stream.writeInt32(id.get(a));
1149+
}
1150+
}
1151+
}
1152+
11311153
public static class TL_stories_getStoryViewsList extends TLObject {
11321154
public static final int constructor = 0x7ed23c57;
11331155

TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,6 +1945,13 @@ public void showSubItem(int id, boolean animated) {
19451945
}
19461946
}
19471947

1948+
public void setSubItemShown(int id, boolean show) {
1949+
if (show)
1950+
showSubItem(id);
1951+
else
1952+
hideSubItem(id);
1953+
}
1954+
19481955
public int getVisibleSubItemsCount() {
19491956
int count = 0;
19501957
for (int i = 0; i < popupLayout.getItemsCount(); ++i) {

TMessagesProj/src/main/java/org/telegram/ui/Cells/UnconfirmedAuthHintCell.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ public void set(final BaseFragment fragment, int currentAccount) {
167167
noButton.setOnClickListener(v -> {
168168
noButton.setLoading(true);
169169
MessagesController.getInstance(currentAccount).getUnconfirmedAuthController().deny(auths, success -> {
170-
showLoginPreventedSheet(success);
170+
if (LaunchActivity.isActive)
171+
showLoginPreventedSheet(success);
171172
noButton.setLoading(false);
172173
MessagesController.getInstance(currentAccount).getUnconfirmedAuthController().cleanup();
173174
});

0 commit comments

Comments
 (0)