Skip to content

Commit 72922d7

Browse files
committed
update to 11.14.1 (6108)
1 parent 48f5514 commit 72922d7

27 files changed

+1011
-227
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
@@ -1591,6 +1591,13 @@ public static int migrate(MessagesStorage messagesStorage, int version) throws E
15911591
version = 166;
15921592
}
15931593

1594+
if (version == 166) {
1595+
database.executeFast("DROP TABLE profile_stories").stepThis().dispose();
1596+
database.executeFast("CREATE TABLE profile_stories (dialog_id INTEGER, story_id INTEGER, data BLOB, type INTEGER, seen INTEGER, pin INTEGER, PRIMARY KEY(dialog_id, story_id, type));").stepThis().dispose();
1597+
database.executeFast("PRAGMA user_version = 167").stepThis().dispose();
1598+
version = 167;
1599+
}
1600+
15941601
return version;
15951602
}
15961603

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,10 @@ public static String formatPluralStringComma(String key, int plural, char symbol
15681568
}
15691569

15701570
public static String formatNumber(long count, char symbol) {
1571+
if (count < 0) {
1572+
return "-" + formatNumber(-count, symbol);
1573+
}
1574+
15711575
StringBuilder stringBuilder = new StringBuilder(String.format("%d", count));
15721576
for (int a = stringBuilder.length() - 3; a > 0; a -= 3) {
15731577
stringBuilder.insert(a, symbol);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public class MessagesStorage extends BaseController {
110110
}
111111
}
112112

113-
public final static int LAST_DB_VERSION = 166;
113+
public final static int LAST_DB_VERSION = 167;
114114
private boolean databaseMigrationInProgress;
115115
public boolean showClearDatabaseAlert;
116116
private final LongSparseIntArray dialogIsForum = new LongSparseIntArray();
@@ -708,7 +708,7 @@ public static void createTables(SQLiteDatabase database) throws SQLiteException
708708
database.executeFast("CREATE TABLE stories (dialog_id INTEGER, story_id INTEGER, data BLOB, custom_params BLOB, PRIMARY KEY (dialog_id, story_id));").stepThis().dispose();
709709
database.executeFast("CREATE TABLE stories_counter (dialog_id INTEGER PRIMARY KEY, count INTEGER, max_read INTEGER);").stepThis().dispose();
710710

711-
database.executeFast("CREATE TABLE profile_stories (dialog_id INTEGER, story_id INTEGER, data BLOB, type INTEGER, seen INTEGER, pin INTEGER, PRIMARY KEY(dialog_id, story_id));").stepThis().dispose();
711+
database.executeFast("CREATE TABLE profile_stories (dialog_id INTEGER, story_id INTEGER, data BLOB, type INTEGER, seen INTEGER, pin INTEGER, PRIMARY KEY(dialog_id, story_id, type));").stepThis().dispose();
712712
database.executeFast("CREATE TABLE profile_stories_albums (dialog_id INTEGER, album_id INTEGER, order_index INTEGER, data BLOB, PRIMARY KEY(dialog_id, album_id));").stepThis().dispose();
713713
database.executeFast("CREATE TABLE profile_stories_albums_links (dialog_id INTEGER, album_id INTEGER, story_id INTEGER, order_index INTEGER, PRIMARY KEY (dialog_id, album_id, story_id));").stepThis().dispose();
714714

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,10 +1632,6 @@ public static void updateStealthModeSendMessageConfirm(int count) {
16321632

16331633
@PerformanceClass
16341634
public static int getDevicePerformanceClass() {
1635-
if (BuildConfig.DEBUG_PRIVATE_VERSION) {
1636-
// return PERFORMANCE_CLASS_HIGH;
1637-
}
1638-
16391635
if (overrideDevicePerformanceClass != -1) {
16401636
return overrideDevicePerformanceClass;
16411637
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,7 @@ public static class StarsTransaction extends TLObject {
14641464
public boolean premium_gift;
14651465
public boolean business_transfer;
14661466
public boolean stargift_resale;
1467+
public boolean posts_search;
14671468
public String id;
14681469
public StarsAmount amount = StarsAmount.ofStars(0);
14691470
public int date;
@@ -1737,6 +1738,7 @@ public void readParams(InputSerializedData stream, boolean exception) {
17371738
premium_gift = (flags & 1048576) != 0;
17381739
business_transfer = (flags & 2097152) != 0;
17391740
stargift_resale = (flags & 4194304) != 0;
1741+
posts_search = (flags & 16777216) != 0;
17401742
id = stream.readString(exception);
17411743
amount = StarsAmount.TLdeserialize(stream, stream.readInt32(exception), exception);
17421744
date = stream.readInt32(exception);
@@ -1808,6 +1810,7 @@ public void serializeToStream(OutputSerializedData stream) {
18081810
flags = premium_gift ? flags | 1048576 : flags &~ 1048576;
18091811
flags = business_transfer ? flags | 2097152 : flags &~ 2097152;
18101812
flags = stargift_resale ? flags | 4194304 : flags &~ 4194304;
1813+
flags = posts_search ? flags | 16777216 : flags &~ 16777216;
18111814
stream.writeInt32(flags);
18121815
stream.writeString(id);
18131816
amount.serializeToStream(stream);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ public static CombinedDrawable createDrawable(int sz, TLRPC.TL_authorization ses
348348
iconId = R.drawable.fragment;
349349
colorKey = -1;
350350
colorKey2 = -1;
351+
} else if (platform.equalsIgnoreCase("search")) {
352+
iconId = R.drawable.msg_search;
353+
colorKey = Theme.key_avatar_backgroundBlue;
354+
colorKey2 = Theme.key_avatar_background2Blue;
351355
} else if (platform.contains("anonymous")) {
352356
iconId = R.drawable.large_hidden;
353357
colorKey = Theme.key_avatar_backgroundBlue;

TMessagesProj/src/main/java/org/telegram/ui/ChannelMonetizationLayout.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,17 +1559,17 @@ public static BottomSheet makeLearnSheet(Context context, boolean bots, Theme.Re
15591559

15601560
layout.addView(
15611561
new FeatureCell(context, R.drawable.msg_channel, getString(bots ? R.string.BotMonetizationInfoFeature1Name : R.string.MonetizationInfoFeature1Name), getString(bots ? R.string.BotMonetizationInfoFeature1Text : R.string.MonetizationInfoFeature1Text), resourcesProvider),
1562-
LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 0, 0, 16)
1562+
LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 8, 0, 8, 16)
15631563
);
15641564

15651565
layout.addView(
15661566
new FeatureCell(context, R.drawable.menu_feature_split, getString(bots ? R.string.BotMonetizationInfoFeature2Name : R.string.MonetizationInfoFeature2Name), getString(bots ? R.string.BotMonetizationInfoFeature2Text : R.string.MonetizationInfoFeature2Text), resourcesProvider),
1567-
LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 0, 0, 16)
1567+
LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 8, 0, 8, 16)
15681568
);
15691569

15701570
layout.addView(
15711571
new FeatureCell(context, R.drawable.menu_feature_withdrawals, getString(bots ? R.string.BotMonetizationInfoFeature3Name : R.string.MonetizationInfoFeature3Name), getString(bots ? R.string.BotMonetizationInfoFeature3Text : R.string.MonetizationInfoFeature3Text), resourcesProvider),
1572-
LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 0, 0, 16)
1572+
LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 8, 0, 8, 16)
15731573
);
15741574

15751575
View separator = new View(context);

TMessagesProj/src/main/java/org/telegram/ui/Components/AlertsCreator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ protected void dispatchDraw(Canvas canvas) {
900900
editText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
901901
editText.setTextColor(Theme.getColor(Theme.key_dialogTextBlack, resourcesProvider));
902902
editText.setHintColor(Theme.getColor(Theme.key_groupcreate_hintText, resourcesProvider));
903-
editText.setHintText("Title");
903+
editText.setHintText(hint);
904904
editText.setFocusable(true);
905905
editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
906906
editText.setLineColors(Theme.getColor(Theme.key_windowBackgroundWhiteInputField, resourcesProvider), Theme.getColor(Theme.key_windowBackgroundWhiteInputFieldActivated, resourcesProvider), Theme.getColor(Theme.key_text_RedRegular, resourcesProvider));

TMessagesProj/src/main/java/org/telegram/ui/Components/BadgeLevelDrawable.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public BadgeLevelDrawable(Context context) {
4848

4949
public void setBadgeLevel(int level, boolean animated) {
5050
if (this.level != level || inner == null || outer == null) {
51-
text.setText(Integer.toString(level), animated);
51+
text.setText(level >= 0 ? Integer.toString(level) : "!", animated);
5252
setLevelIndex(getIndexByLevel(this.level = level));
5353
invalidateSelf();
5454
}
@@ -196,11 +196,15 @@ private static void init() {
196196
R.drawable.profile_level60_inner, R.drawable.profile_level60_outer,
197197
R.drawable.profile_level70_inner, R.drawable.profile_level70_outer,
198198
R.drawable.profile_level80_inner, R.drawable.profile_level80_outer,
199-
R.drawable.profile_level90_inner, R.drawable.profile_level90_outer
199+
R.drawable.profile_level90_inner, R.drawable.profile_level90_outer,
200+
R.drawable.profile_level_minus_inner, R.drawable.profile_level_minus_outer
200201
};
201202
}
202203

203204
private static int getIndexByLevel(int level) {
205+
if (level < 0) {
206+
return 18;
207+
}
204208
return MathUtils.clamp(level <= 10 ? (level - 1) : (8 + level / 10), 0, 17);
205209
}
206210
}

TMessagesProj/src/main/java/org/telegram/ui/Components/LinkSpanDrawable.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,10 @@ public boolean hasLinks() {
768768
ClickableSpan[] spans = spanned.getSpans(0, spanned.length(), ClickableSpan.class);
769769
return spans != null && spans.length > 0;
770770
}
771+
772+
public void clear() {
773+
links.clear(false);
774+
}
771775
}
772776

773777
public static class LinksSimpleTextView extends SimpleTextView {

0 commit comments

Comments
 (0)