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

Reply Chat #1364

Merged
merged 156 commits into from
Aug 20, 2021
Merged
Changes from 1 commit
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
cd9d188
Merge branch 'dev'
Oct 23, 2014
8c50d4d
Merge branch 'dev'
Dec 1, 2014
2f87461
Merge branch 'dev'
Feb 19, 2015
9d113cc
Merge branch 'dev'
Apr 9, 2015
1634618
Merge branch 'dev'
Jun 24, 2015
a93d299
Update to 3.0.1
Jun 29, 2015
82f9be2
Update to 3.1.1
Jul 22, 2015
3e90177
Update to 3.1.2
Aug 13, 2015
906746d
Update to 3.1.3
Sep 1, 2015
6bb7547
Update to 3.2.2
Sep 24, 2015
3d165f1
Fixed restore key generation after network becomes available
Sep 25, 2015
16af1b0
Fixed release and debug AndroidManifest.xml
Sep 29, 2015
e0c9c4e
Using pipe instead of signal to interrupt epoll_wait
Sep 29, 2015
496c336
Update to 3.2.6
Oct 29, 2015
74def22
Update to 3.3.1
Nov 26, 2015
57ada21
Include missing unistd.h header.
Nov 27, 2015
62068e1
Merge pull request #1368 from Bubu/patch-1
Nov 28, 2015
512e404
Update to 3.3.2
Dec 9, 2015
6033ee2
Removing prebuilt libraries. The source code for all libraries is (an…
Dec 11, 2015
fd000ad
Edit korean SentSmsCode string:unnecessary br tag
kyeongmincho Dec 14, 2015
668fea4
Make phone numbers in media captions clickable
Jan 4, 2016
2391a60
Increase limit to linkify phone numbers from 100 to 200
MasterGroosha Jan 4, 2016
dcd7f75
Correct spelling. "Unsuppoted -> Unsupported"
spagy Jan 9, 2016
4b531f5
Merge pull request #1384 from astarcev/patch-1
Jan 11, 2016
3840a0c
Merge pull request #1387 from Spagy/spelling
Jan 11, 2016
f21bac9
Merge pull request #1385 from Kondra007/patch-1
Jan 11, 2016
9b16959
Merge pull request #1373 from drzix/ko_patch
Jan 11, 2016
2114024
Update to 3.4.2
Jan 11, 2016
6154c89
Update to 3.6.1
Mar 6, 2016
a7513b3
Update to 3.7.0
Mar 16, 2016
58a645b
Fix clearItemsMethod: now it clears all items
abcdeiko Apr 14, 2016
0647377
Update to 3.8.1
Apr 22, 2016
fe9e23e
Merge pull request #1406 from abcdeiko/actionmenu_clear_fix
Apr 25, 2016
1c74ed4
Bug fixes
Apr 25, 2016
85239ed
Update to 3.9.0
May 25, 2016
f563fbb
Bug fixes
May 25, 2016
55463a9
Update to 3.10.1
Jun 24, 2016
e313885
Update to 3.13.1
Oct 11, 2016
64e8ec3
compile fix
Oct 11, 2016
6a1cf64
Update to 3.18.0
Mar 30, 2017
dd679bd
Update to 4.1.1
Jul 8, 2017
bcc13a5
update submodules
Jul 8, 2017
56e22d4
Update to 4.2.0
Jul 23, 2017
1eb13d5
Update submodule
Jul 23, 2017
5faa453
Update locales, bug fixes
Jul 23, 2017
7fcd94d
Bug fixes
Jul 23, 2017
c92ecf9
Update to 4.2.1
Jul 23, 2017
9e4f549
Fixed build.gradle
Jul 24, 2017
4ebcbf6
Update to 4.6.0
Dec 8, 2017
5630ad8
Update readme
Dec 8, 2017
e9e40cb
bug fixes
Dec 9, 2017
d073b80
Update to 4.9.0
Jul 30, 2018
fe599cd
Update to 4.9.1
Aug 27, 2018
7e327c1
Bug fixes
Aug 27, 2018
5972d1d
Bug fixes
Aug 27, 2018
75d7821
Bug fixes
Aug 28, 2018
ea72d6c
Bugfix: correctly render vcard of a selected inline query result
acran Sep 25, 2018
e222fde
Merge pull request #1482 from acran/master
DrKLO Nov 7, 2018
ae90d60
Update to 5.2.1
Jan 23, 2019
a724d96
Merge branch 'master' of https://github.com/DrKLO/Telegram
Jan 23, 2019
f338a88
Update to 5.3.1
Feb 8, 2019
e397bd9
Update to 5.4.0
Mar 3, 2019
2cf2a45
Update to 5.6.1
May 14, 2019
96247ca
Removed submodule
Jun 4, 2019
9ffc778
Update to 5.7.1
Jun 4, 2019
a9966a0
Update README.md
Jun 14, 2019
ff57355
Update to 5.9.0
Jul 18, 2019
9f48ec7
Update README.md
Jul 19, 2019
53e04b5
Update to 5.10.0
Aug 21, 2019
28eb8df
Update to 5.11.0
DrKLO Sep 10, 2019
f41b228
Update to 5.13.0 (1818)
DrKLO Dec 31, 2019
471ed12
Update README.md
DrKLO Dec 31, 2019
cc1dc35
Update to 5.13.0 (1819)
DrKLO Dec 31, 2019
1eea3ab
Update to 5.13.0 (1820)
DrKLO Jan 1, 2020
4e55e97
Update to 5.13.0 (1821)
DrKLO Jan 1, 2020
12caa1e
Update to 5.13.0 (1823)
DrKLO Jan 2, 2020
44dadb1
Update to 5.13.1 (1824)
DrKLO Jan 3, 2020
76be9be
Update to 5.13.1 (1825)
DrKLO Jan 3, 2020
46be790
Update to 5.13.1 (1826)
DrKLO Jan 3, 2020
dd07a92
Update to 5.13.1 (1827)
DrKLO Jan 5, 2020
06f4895
Update to 5.13.1 (1828)
DrKLO Jan 5, 2020
3173696
Update to 5.13.1 (1829)
DrKLO Jan 6, 2020
7fb9f0b
Fix apkdiff not checking entire files
janka102 Jan 7, 2020
6a10354
Merge pull request #1545 from janka102/patch-1
DrKLO Jan 14, 2020
30d6037
Update to 5.14.0 (1846)
DrKLO Jan 23, 2020
29aa3ef
Update to 5.14.0 (1847)
DrKLO Jan 23, 2020
207ef50
Update to 5.14.0 (1848)
DrKLO Jan 23, 2020
c623952
Update to 5.14.0 (1849)
DrKLO Jan 23, 2020
049932d
Update to 5.14.0 (1850)
DrKLO Jan 23, 2020
7d6fa26
Update to 5.14.0 (1851)
DrKLO Jan 23, 2020
2eafc07
Update to 5.15.0 (1864)
DrKLO Feb 13, 2020
071d511
Update to 5.15.0 (1866)
DrKLO Feb 13, 2020
08a8e00
Update to 5.15.0 (1867)
DrKLO Feb 14, 2020
dae819b
Update to 5.15.0 (1868)
DrKLO Feb 14, 2020
df90efa
Update to 5.15.0 (1869)
DrKLO Feb 15, 2020
80c4acf
Update to 6.0.0 (1908)
DrKLO Mar 30, 2020
ce5e817
Update to 6.0.1 (1910)
DrKLO Mar 30, 2020
0b83be7
Update to 6.0.1 (1911)
DrKLO Mar 30, 2020
ae0d24e
Update to 6.1.0 (1938)
DrKLO Apr 24, 2020
ed9e38d
Update to 6.1.0 (1940)
DrKLO Apr 24, 2020
73e5ba4
Update to 6.1.0 (1941)
DrKLO Apr 24, 2020
dbf81a3
Update to 6.1.1 (1945)
Apr 30, 2020
5a2a813
Update to 6.1.1 (1946)
May 1, 2020
f120800
Update to 6.1.1 (1947)
May 1, 2020
dceccae
Update to 6.2.0 (1984)
Jun 4, 2020
e2f7baf
Update to 6.2.0 (1985)
Jun 5, 2020
f424ea1
Update to 6.2.0 (1986)
Jun 5, 2020
feba57c
Update to 6.2.0 (1988)
Jun 6, 2020
520592b
Update to 6.3.0 (2040)
Jul 26, 2020
3207103
Update to 6.3.0 (2042)
Jul 26, 2020
b8f17ea
Notification shortcut update
alabiaga Aug 9, 2020
c0125f2
Merge pull request #1569 from alabiaga/patch-2
DrKLO Aug 14, 2020
321b756
Update to 7.0.0 (2060)
DrKLO Aug 14, 2020
6e495f5
Update to 7.0.0 (2061)
DrKLO Aug 15, 2020
4c5f32b
Update to 7.0.0 (2064)
DrKLO Aug 15, 2020
e33a2fb
Update to 7.0.1 (2065)
DrKLO Aug 21, 2020
1139e12
Update to 7.1.0 (2090)
DrKLO Sep 30, 2020
2eeca37
Update to 7.1.0 (2092)
DrKLO Sep 30, 2020
4992f23
Update to 7.1.1 (2094)
DrKLO Oct 1, 2020
99f5637
Update to 7.1.1 (2096)
DrKLO Oct 2, 2020
75d0903
Update to 7.1.2 (2098)
DrKLO Oct 2, 2020
d3ad131
Update to 7.1.3 (2100)
DrKLO Oct 4, 2020
19599e6
Update to 7.1.3 (2103)
DrKLO Oct 15, 2020
aaa5dc0
Update to 7.2.0 (2128)
DrKLO Oct 30, 2020
002c01e
Update to 7.2.0 (2134)
DrKLO Oct 30, 2020
8726c6d
Update to 7.2.1 (2135)
DrKLO Oct 30, 2020
11fbfb1
Update to 7.2.1 (2136)
DrKLO Oct 30, 2020
00e58e8
Update to 7.2.1 (2137)
DrKLO Oct 30, 2020
5a47056
Update to 7.2.1 (2139)
DrKLO Oct 31, 2020
d52b2c9
Update to 7.3.0 (2195)
DrKLO Dec 23, 2020
4b588b9
Update to 7.3.0 (2196)
DrKLO Dec 24, 2020
d333b1f
Update to 7.3.0 (2197)
DrKLO Dec 24, 2020
d0e2266
Update to 7.3.1 (2199)
DrKLO Dec 26, 2020
d52de1a
Update to 7.3.1 (2206)
DrKLO Jan 1, 2021
77bbe5b
Update to 7.4.0 (2221)
DrKLO Jan 28, 2021
eb94e31
Update to 7.4.0 (2223)
DrKLO Jan 28, 2021
fed0c13
Update to 7.4.1 (2225)
DrKLO Jan 29, 2021
eb2bbd3
Update to 7.4.2 (2226)
DrKLO Jan 30, 2021
3480f19
Update to 7.4.2 (2227)
DrKLO Jan 30, 2021
92cfded
Update to 7.5.0 (2243)
DrKLO Feb 23, 2021
31b5801
Update to 7.5.0 (2244)
DrKLO Feb 23, 2021
c44841a
Update to 7.5.0 (2245)
DrKLO Feb 24, 2021
e1c101c
Update to 7.5.0 (2246)
DrKLO Feb 25, 2021
ca13bc9
Update to 7.6.0 (2264)
DrKLO Mar 19, 2021
7ba9838
Update to 7.6.1 (2274)
DrKLO Apr 9, 2021
8bf056e
Update to 7.7.0 (2284)
DrKLO Apr 14, 2021
c4ada53
Update to 7.7.1 (2291)
DrKLO Apr 16, 2021
a5939cc
Update to 7.7.2 (2293)
DrKLO Apr 17, 2021
e8d88e5
Update to 7.8.0 (2359)
DrKLO Jun 25, 2021
dd2b001
Update to 7.8.0 (2360)
DrKLO Jun 25, 2021
3ac3c37
Update to 7.8.1
DrKLO Jul 15, 2021
7a60f94
Update to 7.8.2 (2376)
DrKLO Jul 19, 2021
3e5d2ba
Update to 7.9.0 (2384)
DrKLO Jul 30, 2021
24c6968
Update to 7.9.1 (2387)
DrKLO Jul 30, 2021
fc12550
Update to 7.9.2 (2389)
DrKLO Aug 5, 2021
ab221da
Update to 7.9.3 (2390)
DrKLO Aug 6, 2021
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
Prev Previous commit
Next Next commit
Update to 7.4.2 (2226)
DrKLO committed Jan 30, 2021
commit eb2bbd32c17fa7f50009404f73b8a6a630f31bfb
4 changes: 2 additions & 2 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
@@ -290,7 +290,7 @@ android {
}
}

defaultConfig.versionCode = 2225
defaultConfig.versionCode = 2226

applicationVariants.all { variant ->
variant.outputs.all { output ->
@@ -309,7 +309,7 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 29
versionName "7.4.1"
versionName "7.4.2"

vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']

Original file line number Diff line number Diff line change
@@ -66,10 +66,6 @@
import android.text.method.LinkMovementMethod;
import android.text.style.URLSpan;
import android.text.util.Linkify;
import android.transition.ChangeBounds;
import android.transition.TransitionSet;
import android.transition.TransitionValues;
import android.transition.Visibility;
import android.util.DisplayMetrics;
import android.util.StateSet;
import android.util.TypedValue;
@@ -112,14 +108,12 @@
import org.telegram.tgnet.TLObject;
import org.telegram.tgnet.TLRPC;
import org.telegram.ui.ActionBar.ActionBarLayout;
import org.telegram.ui.ActionBar.ActionBarMenuItem;
import org.telegram.ui.ActionBar.AlertDialog;
import org.telegram.ui.ActionBar.BaseFragment;
import org.telegram.ui.ActionBar.BottomSheet;
import org.telegram.ui.ActionBar.Theme;
import org.telegram.ui.Cells.TextDetailSettingsCell;
import org.telegram.ui.Components.BackgroundGradientDrawable;
import org.telegram.ui.Components.CubicBezierInterpolator;
import org.telegram.ui.Components.ForegroundColorSpanThemable;
import org.telegram.ui.Components.ForegroundDetector;
import org.telegram.ui.Components.LayoutHelper;
@@ -2196,10 +2190,8 @@ public static void startAppCenter(Activity context) {
if (BuildVars.DEBUG_VERSION) {
Distribute.setEnabledForDebuggableBuild(true);
AppCenter.start(context.getApplication(), BuildVars.DEBUG_VERSION ? BuildVars.APPCENTER_HASH_DEBUG : BuildVars.APPCENTER_HASH, Distribute.class, Crashes.class);
} else {
AppCenter.start(context.getApplication(), BuildVars.DEBUG_VERSION ? BuildVars.APPCENTER_HASH_DEBUG : BuildVars.APPCENTER_HASH, Crashes.class);
AppCenter.setUserId("uid=" + UserConfig.getInstance(UserConfig.selectedAccount).clientUserId);
}
AppCenter.setUserId("uid=" + UserConfig.getInstance(UserConfig.selectedAccount).clientUserId);
} catch (Throwable e) {
FileLog.e(e);
}
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ public class BuildVars {
public static boolean LOGS_ENABLED = false;
public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = true;
public static int BUILD_VERSION = 2225;
public static int BUILD_VERSION = 2226;
public static String BUILD_VERSION_STRING = "7.4.0";
public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
Original file line number Diff line number Diff line change
@@ -436,10 +436,16 @@ public void processParticipantsUpdate(TLRPC.TL_updateGroupCallParticipants updat
invitedUsers.remove(id);
}
if (oldParticipant != null) {
oldParticipant.flags = participant.flags;
oldParticipant.muted = participant.muted;
oldParticipant.muted_by_you = participant.muted_by_you;
oldParticipant.volume = participant.volume;
if (!participant.min) {
oldParticipant.volume = participant.volume;
} else {
if ((participant.flags & 128) != 0 && (oldParticipant.flags & 128) == 0) {
participant.flags &=~ 128;
}
}
oldParticipant.flags = participant.flags;
oldParticipant.can_self_unmute = participant.can_self_unmute;
oldParticipant.date = participant.date;
oldParticipant.lastTypingDate = Math.max(oldParticipant.active_date, participant.active_date);
Original file line number Diff line number Diff line change
@@ -3031,7 +3031,7 @@ public void onStateChanged(boolean playWhenReady, int playbackState) {
} else {
cleanupPlayer(true, true, messageObject != null && messageObject.isVoice(), false);
}
} else if (seekToProgressPending != 0 && (playbackState == ExoPlayer.STATE_READY || playbackState == ExoPlayer.STATE_IDLE)) {
} else if (audioPlayer != null && seekToProgressPending != 0 && (playbackState == ExoPlayer.STATE_READY || playbackState == ExoPlayer.STATE_IDLE)) {
int seekTo = (int) (audioPlayer.getDuration() * seekToProgressPending);
audioPlayer.seekTo(seekTo);
lastProgress = seekTo;
Original file line number Diff line number Diff line change
@@ -1423,6 +1423,9 @@ public void loadStickersByEmojiOrName(String name, boolean isEmoji, boolean cach
req.stickerset = inputStickerSetShortName;
}
getConnectionsManager().sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
if (BuildConfig.DEBUG && error != null) { //supress test backend warning
return;
}
if (response instanceof TLRPC.TL_messages_stickerSet) {
processLoadedDiceStickers(name, isEmoji, (TLRPC.TL_messages_stickerSet) response, false, (int) (System.currentTimeMillis() / 1000));
} else {
Original file line number Diff line number Diff line change
@@ -12418,7 +12418,8 @@ public boolean processUpdateArray(ArrayList<TLRPC.Update> updates, final ArrayLi
}
if ((update.notify_settings.flags & 4) != 0) {
editor.putInt("EnableGroup2", update.notify_settings.mute_until);
getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_GROUP);
editor.putBoolean("overwrite_group", true);
AndroidUtilities.runOnUIThread(() -> getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_GROUP));
}
} else if (update.peer instanceof TLRPC.TL_notifyUsers) {
if ((update.notify_settings.flags & 1) != 0) {
@@ -12433,7 +12434,8 @@ public boolean processUpdateArray(ArrayList<TLRPC.Update> updates, final ArrayLi
}
if ((update.notify_settings.flags & 4) != 0) {
editor.putInt("EnableAll2", update.notify_settings.mute_until);
getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_PRIVATE);
editor.putBoolean("overwrite_private", true);
AndroidUtilities.runOnUIThread(() -> getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_PRIVATE));
}
} else if (update.peer instanceof TLRPC.TL_notifyBroadcasts) {
if ((update.notify_settings.flags & 1) != 0) {
@@ -12448,7 +12450,8 @@ public boolean processUpdateArray(ArrayList<TLRPC.Update> updates, final ArrayLi
}
if ((update.notify_settings.flags & 4) != 0) {
editor.putInt("EnableChannel2", update.notify_settings.mute_until);
getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_CHANNEL);
editor.putBoolean("overwrite_channel", true);
AndroidUtilities.runOnUIThread(() -> getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_CHANNEL));
}
}
getMessagesStorage().updateMutedDialogsFiltersCounters();
Original file line number Diff line number Diff line change
@@ -285,7 +285,14 @@ public void cleanup() {
NotificationChannel channel = list.get(a);
String id = channel.getId();
if (id.startsWith(keyStart)) {
systemNotificationManager.deleteNotificationChannel(id);
try {
systemNotificationManager.deleteNotificationChannel(id);
} catch (Exception e) {
FileLog.e(e);
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("delete channel cleanup " + id);
}
}
}
} catch (Throwable e) {
@@ -2575,15 +2582,29 @@ private void deleteNotificationChannelInternal(long dialogId, int what) {
String channelId = preferences.getString(key, null);
if (channelId != null) {
editor.remove(key).remove(key + "_s");
systemNotificationManager.deleteNotificationChannel(channelId);
try {
systemNotificationManager.deleteNotificationChannel(channelId);
} catch (Exception e) {
FileLog.e(e);
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("delete channel internal " + channelId);
}
}
}
if (what == 1 || what == -1) {
String key = "org.telegram.keyia" + dialogId;
String channelId = preferences.getString(key, null);
if (channelId != null) {
editor.remove(key).remove(key + "_s");
systemNotificationManager.deleteNotificationChannel(channelId);
try {
systemNotificationManager.deleteNotificationChannel(channelId);
} catch (Exception e) {
FileLog.e(e);
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("delete channel internal " + channelId);
}
}
}
editor.commit();
@@ -2622,7 +2643,14 @@ public void deleteNotificationChannelGlobalInternal(int type, int what) {
String channelId = preferences.getString(key, null);
if (channelId != null) {
editor.remove(key).remove(key + "_s");
systemNotificationManager.deleteNotificationChannel(channelId);
try {
systemNotificationManager.deleteNotificationChannel(channelId);
} catch (Exception e) {
FileLog.e(e);
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("delete channel global internal " + channelId);
}
}
}

@@ -2638,9 +2666,25 @@ public void deleteNotificationChannelGlobalInternal(int type, int what) {
String channelId = preferences.getString(key, null);
if (channelId != null) {
editor.remove(key).remove(key + "_s");
systemNotificationManager.deleteNotificationChannel(channelId);
try {
systemNotificationManager.deleteNotificationChannel(channelId);
} catch (Exception e) {
FileLog.e(e);
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("delete channel global internal " + channelId);
}
}
}
String overwriteKey;
if (type == TYPE_CHANNEL) {
overwriteKey = "overwrite_channel";
} else if (type == TYPE_GROUP) {
overwriteKey = "overwrite_group";
} else {
overwriteKey = "overwrite_private";
}
editor.remove(overwriteKey);
editor.commit();
} catch (Exception e) {
FileLog.e(e);
@@ -2667,7 +2711,11 @@ public void deleteAllNotificationChannels() {
String key = entry.getKey();
if (key.startsWith("org.telegram.key")) {
if (!key.endsWith("_s")) {
systemNotificationManager.deleteNotificationChannel((String) entry.getValue());
String id = (String) entry.getValue();
systemNotificationManager.deleteNotificationChannel(id);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("delete all channel " + id);
}
}
editor.remove(key);
}
@@ -2824,19 +2872,25 @@ private String validateChannelId(long dialogId, String name, long[] vibrationPat

String key;
String groupId;
String overwriteKey;
if (isSilent) {
groupId = "other" + currentAccount;
overwriteKey = null;
} else {
if (type == TYPE_CHANNEL) {
groupId = "channels" + currentAccount;
overwriteKey = "overwrite_channel";
} else if (type == TYPE_GROUP) {
groupId = "groups" + currentAccount;
overwriteKey = "overwrite_group";
} else {
groupId = "private" + currentAccount;
overwriteKey = "overwrite_private";
}
}

boolean secretChat = !isDefault && (int) dialogId == 0;
boolean shouldOverwrite = !isInApp && overwriteKey != null && preferences.getBoolean(overwriteKey, false);

if (isSilent) {
name = LocaleController.getString("NotificationsSilent", R.string.NotificationsSilent);
@@ -2864,8 +2918,11 @@ private String validateChannelId(long dialogId, String name, long[] vibrationPat

if (channelId != null) {
NotificationChannel existingChannel = systemNotificationManager.getNotificationChannel(channelId);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("current channel for " + channelId + " = " + existingChannel);
}
if (existingChannel != null) {
if (!isSilent) {
if (!isSilent && !shouldOverwrite) {
int channelImportance = existingChannel.getImportance();
Uri channelSound = existingChannel.getSound();
long[] channelVibrationPattern = existingChannel.getVibrationPattern();
@@ -2887,6 +2944,9 @@ private String validateChannelId(long dialogId, String name, long[] vibrationPat
if (!isDefault && secretChat) {
newSettings.append("secret");
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("current channel settings for " + channelId + " = " + newSettings + " old = " + settings);
}
newSettingsHash = Utilities.MD5(newSettings.toString());
newSettings.setLength(0);
if (!newSettingsHash.equals(settings)) {
@@ -3047,7 +3107,10 @@ private String validateChannelId(long dialogId, String name, long[] vibrationPat

if (edited && newSettingsHash != null) {
preferences.edit().putString(key, channelId).putString(key + "_s", newSettingsHash).commit();
} else if (newSettingsHash == null || !isInApp || !isDefault) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("change edited channel " + channelId);
}
} else if (shouldOverwrite || newSettingsHash == null || !isInApp || !isDefault) {
for (int a = 0; a < vibrationPattern.length; a++) {
newSettings.append(vibrationPattern[a]);
}
@@ -3061,8 +3124,15 @@ private String validateChannelId(long dialogId, String name, long[] vibrationPat
}
newSettingsHash = Utilities.MD5(newSettings.toString());

if (!isSilent && channelId != null && !settings.equals(newSettingsHash)) {
systemNotificationManager.deleteNotificationChannel(channelId);
if (!isSilent && channelId != null && (shouldOverwrite || !settings.equals(newSettingsHash))) {
try {
systemNotificationManager.deleteNotificationChannel(channelId);
} catch (Exception e) {
FileLog.e(e);
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("delete channel by settings change " + channelId);
}
channelId = null;
}
}
@@ -3096,6 +3166,9 @@ private String validateChannelId(long dialogId, String name, long[] vibrationPat
} else {
notificationChannel.setSound(null, builder.build());
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("create new channel " + channelId);
}
systemNotificationManager.createNotificationChannel(notificationChannel);
preferences.edit().putString(key, channelId).putString(key + "_s", newSettingsHash).commit();
}
Loading