chat count load inj + fixes

This commit is contained in:
gdlbo
2022-06-24 22:54:56 +03:00
parent d06396a51d
commit db6c23d511
4 changed files with 12 additions and 10 deletions
@@ -19,7 +19,6 @@ public class InterfaceFragment extends MaterialPreferenceToolbarFragment{
private void prefs(){
findPreference("newfeed").setOnPreferenceClickListener(new restart());
findPreference("dateformat").setOnPreferenceClickListener(new restart());
findPreference("stories").setOnPreferenceClickListener(new restart());
findPreference("swipe").setOnPreferenceClickListener(new restart());
findPreference("dockcounter").setOnPreferenceClickListener(new restart());
@@ -28,10 +28,8 @@ import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Debug;
import android.preference.PreferenceManager;
import android.util.Log;
import com.vk.core.util.Screen;
import com.vk.im.engine.models.users.UserSex;
import com.vtosters.lite.data.Users;
import com.vtosters.lite.fragments.SettingsListFragment;
@@ -215,7 +213,6 @@ public class Preferences{
return getBoolValue("feedcache", true);
}
public static boolean superapp(){
return getBoolValue("superapp", true);
}
@@ -228,7 +225,6 @@ public class Preferences{
return getBoolValue("returnnorifs", false);
}
public static boolean CommentsSort(){
return getBoolValue("commentssorting", false);
}
@@ -349,9 +345,9 @@ public class Preferences{
return false;
}
public static int getMsgCount(){
public static int getMsgCount(int orig){
String customvalue = getPrefsValue("msgcount");
return customvalue.isEmpty() ? 30 : Integer.parseInt(customvalue);
return customvalue.isEmpty() ? orig : Integer.parseInt(customvalue);
}
public static String MediacontentFix(){
@@ -468,15 +464,14 @@ public class Preferences{
return new SimpleDateFormat(getDateFormat());
}
public static String getFormattedDate(UserSex type, long time){
public static String getFormattedDate(boolean isFemale, long time){
SimpleDateFormat date = new SimpleDateFormat(getDateFormat(), Locale.getDefault());
if(!fulltime()) return null;
try {
return getStringDate(type == UserSex.FEMALE ? getIdentifier("last_seen_profile_f", "string") : getIdentifier("last_seen_profile_m", "string"), date.format(new Date(time)));
return getStringDate(isFemale ? getIdentifier("last_seen_profile_f", "string") : getIdentifier("last_seen_profile_m", "string"), date.format(new Date(time)));
} catch (Throwable th) {
Log.d("VTLite", "Format data error, type " + type + " , time " + time);
th.printStackTrace();
return null;
}
@@ -43,6 +43,10 @@
iput-object p2, p0, Lcom/vk/im/engine/internal/api_commands/messages/MessagesGetConversationsApiCmd;->b:Lcom/vk/im/engine/models/dialogs/DialogsFilter;
invoke-static {p3}, Lru/vtosters/lite/utils/Preferences;->getMsgCount(I)I
move-result p3
iput p3, p0, Lcom/vk/im/engine/internal/api_commands/messages/MessagesGetConversationsApiCmd;->c:I
iput-object p4, p0, Lcom/vk/im/engine/internal/api_commands/messages/MessagesGetConversationsApiCmd;->d:Ljava/lang/String;
@@ -158,6 +158,10 @@
move-result v0
invoke-static {v0}, Lru/vtosters/lite/utils/Preferences;->getMsgCount(I)I
move-result v0
iput v0, p0, Lcom/vk/im/engine/internal/api_commands/messages/MessagesGetHistoryApiCmd;->d:I
.line 9