From c156a8267573458bbf42ea7b31ce8c491cb48ba0 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Mon, 14 Nov 2016 16:52:10 +0100 Subject: [PATCH] Remove dead code. --- .../messenger/MessagesController.java | 26 +++++-------------- .../main/java/org/telegram/tgnet/TLRPC.java | 10 ------- .../java/org/telegram/ui/PhotoViewer.java | 10 +++---- .../java/org/telegram/ui/ProfileActivity.java | 22 ++++++---------- 4 files changed, 20 insertions(+), 48 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index 1c0f8f15b..86f5d3953 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -82,10 +82,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter private HashMap gettingUnknownChannels = new HashMap<>(); private HashMap checkingLastMessagesDialogs = new HashMap<>(); - private ArrayList updatesQueueSeq = new ArrayList<>(); - private ArrayList updatesQueuePts = new ArrayList<>(); - private ArrayList updatesQueueQts = new ArrayList<>(); - private HashMap fullUsersAbout = new HashMap<>(); private ArrayList loadingFullUsers = new ArrayList<>(); private ArrayList loadedFullUsers = new ArrayList<>(); private ArrayList loadingFullChats = new ArrayList<>(); @@ -361,9 +357,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter dialogs_read_inbox_max.clear(); dialogs_read_outbox_max.clear(); exportedChats.clear(); - fullUsersAbout.clear(); dialogs.clear(); - //joiningToChannels.clear(); channelViewsToSend.clear(); channelViewsToReload.clear(); dialogsServerOnly.clear(); @@ -384,9 +378,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter Utilities.stageQueue.postRunnable(new Runnable() { @Override public void run() { - updatesQueueSeq.clear(); - updatesQueuePts.clear(); - updatesQueueQts.clear(); gettingUnknownChannels.clear(); createdDialogIds.clear(); gettingDifference = false; @@ -634,19 +625,15 @@ public class MessagesController implements NotificationCenter.NotificationCenter } } - public String getUserAbout(int uid) { - return fullUsersAbout.get(uid); - } - - protected void clearFullUsers() { loadedFullUsers.clear(); loadedFullChats.clear(); } + /* public void loadDialogPhotos(final int did, final int offset, final int count, final long max_id, final boolean fromCache, final int classGuid) { if (fromCache) { - //MessagesStorage.getInstance().getDialogPhotos(did, offset, count, max_id, classGuid); + MessagesStorage.getInstance().getDialogPhotos(did, offset, count, max_id, classGuid); } else { if (did > 0) { TLRPC.User user = getUser(did); @@ -658,7 +645,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter req.offset = offset; req.max_id = (int) max_id; req.user_id = getInputUser(user); - int reqId = 0; /*ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() { + int reqId = ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() { @Override public void run(TLObject response, TLRPC.TL_error error) { if (error == null) { @@ -667,7 +654,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } } }); - ConnectionsManager.getInstance().bindRequestToGuid(reqId, classGuid);*/ + ConnectionsManager.getInstance().bindRequestToGuid(reqId, classGuid); } else if (did < 0) { TLRPC.TL_messages_search req = new TLRPC.TL_messages_search(); req.filter = new TLRPC.TL_inputMessagesFilterChatPhotos(); @@ -676,7 +663,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter req.max_id = (int) max_id; req.q = ""; req.peer = MessagesController.getInputPeer(did); - int reqId = 0;/*ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() { + int reqId = ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() { @Override public void run(TLObject response, TLRPC.TL_error error) { if (error == null) { @@ -695,10 +682,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter } } }); - ConnectionsManager.getInstance().bindRequestToGuid(reqId, classGuid);*/ + ConnectionsManager.getInstance().bindRequestToGuid(reqId, classGuid); } } } + */ public void blockUser(int user_id) { final TLRPC.User user = getUser(user_id); diff --git a/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java b/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java index 05b85edc8..a94ae4a3c 100644 --- a/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java +++ b/TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java @@ -729,9 +729,6 @@ public class TLRPC { public static class TL_inputMessagesFilterMusic extends MessagesFilter { } - public static class TL_inputMessagesFilterChatPhotos extends MessagesFilter { - } - public static class TL_inputMessagesFilterUrl extends MessagesFilter { } @@ -943,13 +940,6 @@ public class TLRPC { public InputPhotoCrop crop; } - public static class TL_photos_getUserPhotos extends TLObject { - public InputUser user_id; - public int offset; - public long max_id; - public int limit; - } - public static class TL_contacts_resolveUsername extends TLObject { public String username; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java index e3714313e..f483387ae 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java @@ -740,7 +740,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat int guid = (Integer) args[4]; int did = (Integer) args[0]; if (avatarsDialogId == did && classGuid == guid) { - boolean fromCache = (Boolean) args[3]; + //boolean fromCache = (Boolean) args[3]; int setToImage = -1; ArrayList photos = (ArrayList) args[5]; @@ -788,9 +788,9 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat imagesArrLocationsSizes.add(0, 0); setImageIndex(0, true); } - if (fromCache) { - MessagesController.getInstance().loadDialogPhotos(avatarsDialogId, 0, 80, 0, false, classGuid); - } + //if (fromCache) { + // MessagesController.getInstance().loadDialogPhotos(avatarsDialogId, 0, 80, 0, false, classGuid); + //} } } else if (id == NotificationCenter.mediaCountDidLoaded) { long uid = (Long) args[0]; @@ -2653,7 +2653,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat SharedMediaQuery.getMediaCount(mergeDialogId, SharedMediaQuery.MEDIA_PHOTOVIDEO, classGuid, true); } } else if (avatarsDialogId != 0) { - MessagesController.getInstance().loadDialogPhotos(avatarsDialogId, 0, 80, 0, true, classGuid); + //MessagesController.getInstance().loadDialogPhotos(avatarsDialogId, 0, 80, 0, true, classGuid); } } if (currentMessageObject != null && currentMessageObject.isVideo()) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java index e815b0b5d..246ec2b23 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java @@ -146,6 +146,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. private final static int convert_to_supergroup = 13; private final static int add_shortcut = 14; + private final static int typeAbout = 8; + private int emptyRow; private int emptyRowChat; private int emptyRowChat2; @@ -1916,11 +1918,11 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. if (user != null && user.username != null && user.username.length() > 0) { usernameRow = rowCount++; } - String about = MessagesController.getInstance().getUserAbout(user.id); + /*String about = MessagesController.getInstance().getUserAbout(user.id); if (about != null) { userSectionRow = rowCount++; userInfoRow = rowCount++; - } else { + } else*/ { userSectionRow = -1; userInfoRow = -1; } @@ -2514,18 +2516,10 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. userCell.setData(MessagesController.getInstance().getUser(part.user_id), null, null, i == emptyRowChat2 + 1 ? R.drawable.menu_newgroup : 0); } break; - case 8: + case typeAbout: AboutLinkCell aboutLinkCell = (AboutLinkCell) holder.itemView; - if (i == userInfoRow) { - String about = MessagesController.getInstance().getUserAbout(user_id); - aboutLinkCell.setTextAndIcon(about, R.drawable.bot_info); - } else if (i == channelInfoRow) { - String text = info.about; - while (text.contains("\n\n\n")) { - text = text.replace("\n\n\n", "\n\n"); - } - aboutLinkCell.setTextAndIcon(text, R.drawable.bot_info); - } + String about = "ErrAbout"; + aboutLinkCell.setTextAndIcon(about, R.drawable.bot_info); break; default: checkBackground = false; @@ -2576,7 +2570,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. } else if (i == loadMoreMembersRow) { return 7; } else if (i == userInfoRow || i == channelInfoRow) { - return 8; + return typeAbout; } return 0; }