Fix some official client bugs

This commit is contained in:
NekoInverter 2021-12-08 18:41:43 +08:00 committed by arm64v8a
parent dee3203dfa
commit 4e91347163
4 changed files with 17 additions and 3 deletions

View File

@ -333,6 +333,7 @@ public class MessagesController extends BaseController implements NotificationCe
public Set<String> exportPrivateUri;
public boolean autoarchiveAvailable;
public int groipCallVideoMaxParticipants;
public int chatReadMarkSizeThreshold;
public boolean suggestStickersApiOnly;
public ArrayList<String> gifSearchEmojies = new ArrayList<>();
public HashSet<String> diceEmojies;
@ -880,6 +881,7 @@ public class MessagesController extends BaseController implements NotificationCe
showFiltersTooltip = mainPreferences.getBoolean("showFiltersTooltip", false);
autoarchiveAvailable = mainPreferences.getBoolean("autoarchiveAvailable", false);
groipCallVideoMaxParticipants = mainPreferences.getInt("groipCallVideoMaxParticipants", 30);
chatReadMarkSizeThreshold = mainPreferences.getInt("chatReadMarkSizeThreshold", 100);
suggestStickersApiOnly = mainPreferences.getBoolean("suggestStickersApiOnly", false);
roundVideoSize = mainPreferences.getInt("roundVideoSize", 384);
roundVideoBitrate = mainPreferences.getInt("roundVideoBitrate", 1000);
@ -1747,6 +1749,18 @@ public class MessagesController extends BaseController implements NotificationCe
}
break;
}
case "chat_read_mark_size_threshold": {
if (value.value instanceof TLRPC.TL_jsonNumber) {
TLRPC.TL_jsonNumber number = (TLRPC.TL_jsonNumber) value.value;
Log.e("test", chatReadMarkSizeThreshold + "");
if (number.value != chatReadMarkSizeThreshold) {
chatReadMarkSizeThreshold = (int) number.value;
editor.putInt("chatReadMarkSizeThreshold", chatReadMarkSizeThreshold);
changed = true;
}
}
break;
}
case "inapp_update_check_delay": {
if (value.value instanceof TLRPC.TL_jsonNumber) {
TLRPC.TL_jsonNumber number = (TLRPC.TL_jsonNumber) value.value;

View File

@ -378,7 +378,7 @@ public class ChatActionCell extends BaseCell implements DownloadController.FileD
} else if (url.startsWith("http")) {
Browser.openUrl(getContext(), url);
} else {
delegate.needOpenUserProfile(Integer.parseInt(url));
delegate.needOpenUserProfile(Long.parseLong(url));
}
}
result = true;

View File

@ -2158,7 +2158,7 @@ public class ChannelAdminLogActivity extends BaseFragment implements Notificatio
((URLSpanMono) url).copyToClipboard();
Toast.makeText(getParentActivity(), LocaleController.getString("TextCopied", R.string.TextCopied), Toast.LENGTH_SHORT).show();
} else if (url instanceof URLSpanUserMention) {
long peerId = Utilities.parseInt(((URLSpanUserMention) url).getURL());
long peerId = Utilities.parseLong(((URLSpanUserMention) url).getURL());
if (peerId > 0) {
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(peerId);
if (user != null) {

View File

@ -21274,7 +21274,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
});
scrimPopupContainerLayout.setOrientation(LinearLayout.VERTICAL);
boolean showMessageSeen = !isInScheduleMode() && currentChat != null && message.isOutOwner() && message.isSent() && !message.isEditing() && !message.isSending() && !message.isSendError() && !message.isContentUnread() && !message.isUnread() && (ConnectionsManager.getInstance(currentAccount).getCurrentTime() - message.messageOwner.date < 7 * 86400) && (ChatObject.isMegagroup(currentChat) || !ChatObject.isChannel(currentChat)) && chatInfo != null && chatInfo.participants_count < 50 && !(message.messageOwner.action instanceof TLRPC.TL_messageActionChatJoinedByRequest) && (v instanceof ChatMessageCell);
boolean showMessageSeen = !isInScheduleMode() && currentChat != null && message.isOutOwner() && message.isSent() && !message.isEditing() && !message.isSending() && !message.isSendError() && !message.isContentUnread() && !message.isUnread() && (ConnectionsManager.getInstance(currentAccount).getCurrentTime() - message.messageOwner.date < 7 * 86400) && (ChatObject.isMegagroup(currentChat) || !ChatObject.isChannel(currentChat)) && chatInfo != null && chatInfo.participants_count < getMessagesController().chatReadMarkSizeThreshold && !(message.messageOwner.action instanceof TLRPC.TL_messageActionChatJoinedByRequest) && (v instanceof ChatMessageCell);
boolean showNoForwards = getMessagesController().isChatNoForwards(currentChat) && message.messageOwner.action == null && message.isSent() && !message.isEditing() && chatMode != MODE_SCHEDULED;
MessageSeenView messageSeenView = null;
if (showMessageSeen) {