Skip to content

Commit 928146c

Browse files
committed
update to 10.6.1 (4275)
1 parent a746a07 commit 928146c

File tree

178 files changed

+12558
-2961
lines changed

Some content is hidden

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

178 files changed

+12558
-2961
lines changed

TMessagesProj/jni/tgnet/ApiScheme.cpp

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,21 +1210,30 @@ UserStatus *UserStatus::TLdeserialize(NativeByteBuffer *stream, uint32_t constru
12101210
case 0x8c703f:
12111211
result = new TL_userStatusOffline();
12121212
break;
1213-
case 0x7bf09fc:
1214-
result = new TL_userStatusLastWeek();
1215-
break;
12161213
case 0x9d05049:
12171214
result = new TL_userStatusEmpty();
12181215
break;
1219-
case 0x77ebc742:
1220-
result = new TL_userStatusLastMonth();
1221-
break;
12221216
case 0xedb93949:
12231217
result = new TL_userStatusOnline();
12241218
break;
1225-
case 0xe26f42f1:
1219+
case 0x7b197dc8:
12261220
result = new TL_userStatusRecently();
12271221
break;
1222+
case 0x541a1d1a:
1223+
result = new TL_userStatusLastWeek();
1224+
break;
1225+
case 0x65899777:
1226+
result = new TL_userStatusLastMonth();
1227+
break;
1228+
case 0xe26f42f1:
1229+
result = new TL_userStatusRecently_layer171();
1230+
break;
1231+
case 0x7bf09fc:
1232+
result = new TL_userStatusLastWeek_layer171();
1233+
break;
1234+
case 0x77ebc742:
1235+
result = new TL_userStatusLastMonth_layer171();
1236+
break;
12281237
default:
12291238
error = true;
12301239
if (LOGS_ENABLED) DEBUG_FATAL("can't parse magic %x in UserStatus", constructor);
@@ -1243,8 +1252,19 @@ void TL_userStatusOffline::serializeToStream(NativeByteBuffer *stream) {
12431252
stream->writeInt32(expires);
12441253
}
12451254

1255+
void TL_userStatusLastWeek_layer171::serializeToStream(NativeByteBuffer *stream) {
1256+
stream->writeInt32(constructor);
1257+
}
1258+
12461259
void TL_userStatusLastWeek::serializeToStream(NativeByteBuffer *stream) {
12471260
stream->writeInt32(constructor);
1261+
flags = by_me ? flags | 1 : flags &~ 1;
1262+
stream->writeInt32(flags);
1263+
}
1264+
1265+
void TL_userStatusLastWeek::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
1266+
flags = stream->readInt32(&error);
1267+
by_me = (flags & 1) != 0;
12481268
}
12491269

12501270
void TL_userStatusEmpty::serializeToStream(NativeByteBuffer *stream) {
@@ -1253,6 +1273,17 @@ void TL_userStatusEmpty::serializeToStream(NativeByteBuffer *stream) {
12531273

12541274
void TL_userStatusLastMonth::serializeToStream(NativeByteBuffer *stream) {
12551275
stream->writeInt32(constructor);
1276+
flags = by_me ? flags | 1 : flags &~ 1;
1277+
stream->writeInt32(flags);
1278+
}
1279+
1280+
void TL_userStatusLastMonth::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
1281+
flags = stream->readInt32(&error);
1282+
by_me = (flags & 1) != 0;
1283+
}
1284+
1285+
void TL_userStatusLastMonth_layer171::serializeToStream(NativeByteBuffer *stream) {
1286+
stream->writeInt32(constructor);
12561287
}
12571288

12581289
void TL_userStatusOnline::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
@@ -1266,6 +1297,21 @@ void TL_userStatusOnline::serializeToStream(NativeByteBuffer *stream) {
12661297

12671298
void TL_userStatusRecently::serializeToStream(NativeByteBuffer *stream) {
12681299
stream->writeInt32(constructor);
1300+
flags = by_me ? flags | 1 : flags &~ 1;
1301+
stream->writeInt32(flags);
1302+
}
1303+
1304+
void TL_userStatusRecently::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
1305+
flags = stream->readInt32(&error);
1306+
by_me = (flags & 1) != 0;
1307+
}
1308+
1309+
void TL_userStatusRecently_layer171::serializeToStream(NativeByteBuffer *stream) {
1310+
stream->writeInt32(constructor);
1311+
}
1312+
1313+
void TL_userStatusHidden::serializeToStream(NativeByteBuffer *stream) {
1314+
stream->writeInt32(constructor);
12691315
}
12701316

12711317
FileLocation *FileLocation::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {

TMessagesProj/jni/tgnet/ApiScheme.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,18 @@ class TL_userStatusOffline : public UserStatus {
203203

204204
class TL_userStatusLastWeek : public UserStatus {
205205

206+
public:
207+
static const uint32_t constructor = 0x7bf09fc;
208+
209+
uint32_t flags;
210+
bool by_me;
211+
212+
void serializeToStream(NativeByteBuffer *stream);
213+
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
214+
};
215+
216+
class TL_userStatusLastWeek_layer171 : public UserStatus {
217+
206218
public:
207219
static const uint32_t constructor = 0x7bf09fc;
208220

@@ -219,6 +231,19 @@ class TL_userStatusEmpty : public UserStatus {
219231

220232
class TL_userStatusLastMonth : public UserStatus {
221233

234+
public:
235+
static const uint32_t constructor = 0x65899777;
236+
237+
uint32_t flags;
238+
bool by_me;
239+
240+
void serializeToStream(NativeByteBuffer *stream);
241+
242+
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
243+
};
244+
245+
class TL_userStatusLastMonth_layer171 : public UserStatus {
246+
222247
public:
223248
static const uint32_t constructor = 0x77ebc742;
224249

@@ -236,12 +261,32 @@ class TL_userStatusOnline : public UserStatus {
236261

237262
class TL_userStatusRecently : public UserStatus {
238263

264+
public:
265+
static const uint32_t constructor = 0x7b197dc8;
266+
267+
uint32_t flags;
268+
bool by_me;
269+
270+
void serializeToStream(NativeByteBuffer *stream);
271+
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
272+
};
273+
274+
class TL_userStatusRecently_layer171 : public UserStatus {
275+
239276
public:
240277
static const uint32_t constructor = 0xe26f42f1;
241278

242279
void serializeToStream(NativeByteBuffer *stream);
243280
};
244281

282+
class TL_userStatusHidden : public UserStatus {
283+
284+
public:
285+
static const uint32_t constructor = 0xcf7d64b1;
286+
287+
void serializeToStream(NativeByteBuffer *stream);
288+
};
289+
245290
class FileLocation : public TLObject {
246291

247292
public:

TMessagesProj/src/main/AndroidManifest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,15 +569,13 @@
569569

570570
<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" />
571571

572-
<!-- <meta-data android:name="com.google.android.gms.car.notification.SmallIcon" android:resource="@drawable/ic_player" />-->
573-
<!-- <meta-data android:name="com.google.android.gms.car.application" android:resource="@xml/automotive_app_desc" />-->
572+
<meta-data android:name="com.google.android.gms.car.notification.SmallIcon" android:resource="@drawable/ic_player" />
573+
<meta-data android:name="com.google.android.gms.car.application" android:resource="@xml/automotive_app_desc" />
574574

575575
<meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="face,barcode" />
576576

577577
<meta-data android:name="android.max_aspect" android:value="2.5" />
578578

579-
<meta-data android:name="com.google.android.actions" android:resource="@xml/actions" />
580-
581579
</application>
582580

583581
</manifest>

TMessagesProj/src/main/java/androidx/recyclerview/widget/ChatListItemAnimator.java

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.animation.AnimatorSet;
66
import android.animation.ObjectAnimator;
77
import android.animation.ValueAnimator;
8+
import android.util.Log;
89
import android.util.LongSparseArray;
910
import android.view.View;
1011
import android.view.ViewPropertyAnimator;
@@ -51,6 +52,7 @@ public class ChatListItemAnimator extends DefaultItemAnimator {
5152
private ArrayList<MessageObject.GroupedMessages> willChangedGroups = new ArrayList<>();
5253

5354
HashMap<RecyclerView.ViewHolder,Animator> animators = new HashMap<>();
55+
ArrayList<View> thanosViews = new ArrayList<>();
5456

5557
ArrayList<Runnable> runOnAnimationsEnd = new ArrayList<>();
5658
HashMap<Long, Long> groupIdToEnterDelay = new HashMap<>();
@@ -925,7 +927,12 @@ public void onAnimationEnd(Animator animator) {
925927
animator.removeAllListeners();
926928
restoreTransitionParams(holder.itemView);
927929
if (holder.itemView instanceof ChatMessageCell) {
928-
MessageObject.GroupedMessages group = ((ChatMessageCell) view).getCurrentMessagesGroup();
930+
ChatMessageCell cell = (ChatMessageCell) holder.itemView;
931+
if (cell.makeVisibleAfterChange) {
932+
cell.makeVisibleAfterChange = false;
933+
cell.setVisibility(View.VISIBLE);
934+
}
935+
MessageObject.GroupedMessages group = cell.getCurrentMessagesGroup();
929936
if (group != null) {
930937
group.transitionParams.reset();
931938
}
@@ -1092,6 +1099,12 @@ private void cancelAnimators() {
10921099
animator.cancel();
10931100
}
10941101
}
1102+
if (!thanosViews.isEmpty()) {
1103+
ThanosEffect thanosEffect = getThanosEffectContainer.run();
1104+
if (thanosEffect != null) {
1105+
thanosEffect.kill();
1106+
}
1107+
}
10951108
}
10961109

10971110
@Override
@@ -1100,6 +1113,12 @@ public void endAnimation(RecyclerView.ViewHolder item) {
11001113
if (animator != null) {
11011114
animator.cancel();
11021115
}
1116+
if (thanosViews.contains(item.itemView)) {
1117+
ThanosEffect thanosEffect = getThanosEffectContainer.run();
1118+
if (thanosEffect != null) {
1119+
thanosEffect.cancel(item.itemView);
1120+
}
1121+
}
11031122
super.endAnimation(item);
11041123
restoreTransitionParams(item.itemView);
11051124
}
@@ -1230,6 +1249,12 @@ protected boolean endChangeAnimationIfNecessary(ChangeInfo changeInfo, RecyclerV
12301249
if (a != null) {
12311250
a.cancel();
12321251
}
1252+
if (thanosViews.contains(item.itemView)) {
1253+
ThanosEffect thanosEffect = getThanosEffectContainer.run();
1254+
if (thanosEffect != null) {
1255+
thanosEffect.cancel(item.itemView);
1256+
}
1257+
}
12331258

12341259
boolean oldItem = false;
12351260
if (changeInfo.newHolder == item) {
@@ -1447,7 +1472,9 @@ protected void animateRemoveImpl(final RecyclerView.ViewHolder holder, boolean t
14471472
dispatchRemoveFinished(holder);
14481473
dispatchFinishedWhenDone();
14491474
}
1475+
thanosViews.remove(view);
14501476
});
1477+
thanosViews.add(view);
14511478
} else {
14521479
ObjectAnimator animator = ObjectAnimator.ofFloat(view, View.ALPHA, view.getAlpha(), 0f);
14531480
dispatchRemoveStarting(holder);
@@ -1497,7 +1524,9 @@ private void animateRemoveGroupImpl(final ArrayList<RecyclerView.ViewHolder> hol
14971524
}
14981525
dispatchFinishedWhenDone();
14991526
}
1527+
thanosViews.removeAll(views);
15001528
});
1529+
thanosViews.add(views.get(0));
15011530
recyclerListView.stopScroll();
15021531
}
15031532

TMessagesProj/src/main/java/androidx/recyclerview/widget/GridLayoutManagerFixed.java

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
import android.graphics.Rect;
1212
import android.view.View;
1313

14+
import com.google.android.exoplayer2.util.Log;
15+
16+
import org.telegram.ui.Cells.ChatMessageCell;
17+
1418
import java.util.ArrayList;
1519
import java.util.Arrays;
1620

@@ -68,8 +72,9 @@ protected void recycleViewsFromStart(RecyclerView.Recycler recycler, int scrolli
6872
} else {
6973
for (int i = 0; i < childCount; i++) {
7074
View child = getChildAt(i);
71-
if (mOrientationHelper.getDecoratedEnd(child) > scrollingOffset
72-
|| mOrientationHelper.getTransformedEndWithDecoration(child) > scrollingOffset) {
75+
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
76+
if (child.getBottom() + params.bottomMargin > scrollingOffset
77+
|| child.getTop() + child.getHeight() > scrollingOffset) {
7378
// stop here
7479
recycleChildren(recycler, 0, i);
7580
return;
@@ -115,12 +120,15 @@ void layoutChunk(RecyclerView.Recycler recycler, RecyclerView.State state, Layou
115120
final int otherDirSpecMode = mOrientationHelper.getModeInOther();
116121

117122
final boolean layingOutInPrimaryDirection = layoutState.mItemDirection == LayoutState.ITEM_DIRECTION_TAIL;
118-
boolean working = true;
119123
result.mConsumed = 0;
120-
int yOffset = 0;
121124

122125
int startPosition = layoutState.mCurrentPosition;
123-
if (layoutState.mLayoutDirection != LayoutState.LAYOUT_START && hasSiblingChild(layoutState.mCurrentPosition) && findViewByPosition(layoutState.mCurrentPosition + 1) == null) {
126+
if (
127+
mShouldReverseLayout &&
128+
layoutState.mLayoutDirection != LayoutState.LAYOUT_START &&
129+
hasSiblingChild(layoutState.mCurrentPosition) &&
130+
findViewByPosition(layoutState.mCurrentPosition + 1) == null
131+
) {
124132
if (hasSiblingChild(layoutState.mCurrentPosition + 1)) {
125133
layoutState.mCurrentPosition += 3;
126134
} else {
@@ -144,18 +152,14 @@ void layoutChunk(RecyclerView.Recycler recycler, RecyclerView.State state, Layou
144152
layoutState.mCurrentPosition = backupPosition;
145153
}
146154

155+
boolean working = true;
147156
while (working) {
148157
int count = 0;
149-
int consumedSpanCount = 0;
150158
int remainingSpan = mSpanCount;
151-
152159
working = !additionalViews.isEmpty();
153-
int firstPositionStart = layoutState.mCurrentPosition;
154-
155160
while (count < mSpanCount && layoutState.hasMore(state) && remainingSpan > 0) {
156161
int pos = layoutState.mCurrentPosition;
157162
final int spanSize = getSpanSize(recycler, state, pos);
158-
159163
remainingSpan -= spanSize;
160164
if (remainingSpan < 0) {
161165
break;
@@ -171,7 +175,6 @@ void layoutChunk(RecyclerView.Recycler recycler, RecyclerView.State state, Layou
171175
if (view == null) {
172176
break;
173177
}
174-
consumedSpanCount += spanSize;
175178
mSet[count] = view;
176179
count++;
177180
if (layoutState.mLayoutDirection == LayoutState.LAYOUT_START && remainingSpan <= 0 && hasSiblingChild(pos)) {
@@ -236,9 +239,11 @@ void layoutChunk(RecyclerView.Recycler recycler, RecyclerView.State state, Layou
236239
}
237240

238241
int left, right, top, bottom;
239-
240-
boolean fromOpositeSide = shouldLayoutChildFromOpositeSide(mSet[0]);
241-
if (fromOpositeSide && layoutState.mLayoutDirection == LayoutState.LAYOUT_START || !fromOpositeSide && layoutState.mLayoutDirection == LayoutState.LAYOUT_END) {
242+
boolean fromOppositeSide = shouldLayoutChildFromOpositeSide(mSet[0]);
243+
if (
244+
fromOppositeSide && layoutState.mLayoutDirection == LayoutState.LAYOUT_START ||
245+
!fromOppositeSide && layoutState.mLayoutDirection == LayoutState.LAYOUT_END
246+
) {
242247
if (layoutState.mLayoutDirection == LayoutState.LAYOUT_START) {
243248
bottom = layoutState.mOffset - result.mConsumed;
244249
top = bottom - maxSize;
@@ -284,7 +289,7 @@ void layoutChunk(RecyclerView.Recycler recycler, RecyclerView.State state, Layou
284289
left -= right;
285290
}
286291
layoutDecoratedWithMargins(view, left, top, left + right, bottom);
287-
if (layoutState.mLayoutDirection != LayoutState.LAYOUT_START) {
292+
if (layoutState.mLayoutDirection == LayoutState.LAYOUT_END) {
288293
left += right;
289294
}
290295
if (params.isItemRemoved() || params.isItemChanged()) {

TMessagesProj/src/main/java/org/telegram/SQLite/SQLitePreparedStatement.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import android.os.SystemClock;
1212

13+
import com.google.android.exoplayer2.util.Log;
14+
1315
import org.telegram.messenger.BuildVars;
1416
import org.telegram.messenger.FileLog;
1517
import org.telegram.tgnet.NativeByteBuffer;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@
153153
import org.telegram.ui.Components.LayoutHelper;
154154
import org.telegram.ui.Components.MotionBackgroundDrawable;
155155
import org.telegram.ui.Components.PickerBottomLayout;
156+
import org.telegram.ui.Components.PipRoundVideoView;
157+
import org.telegram.ui.Components.PipVideoOverlay;
156158
import org.telegram.ui.Components.RecyclerListView;
157159
import org.telegram.ui.Components.ShareAlert;
158160
import org.telegram.ui.Components.TypefaceSpan;
@@ -5225,6 +5227,9 @@ public static void makeGlobalBlurBitmap(Utilities.Callback<Bitmap> onBitmapDone,
52255227
int[] location = new int[2];
52265228
for (int i = 0; i < finalViews.size(); ++i) {
52275229
View view = finalViews.get(i);
5230+
if (view instanceof PipRoundVideoView.PipFrameLayout || view instanceof PipRoundVideoView.PipFrameLayout) {
5231+
continue;
5232+
}
52285233

52295234
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
52305235
if (layoutParams instanceof WindowManager.LayoutParams) {

0 commit comments

Comments
 (0)