|
@@ -292,6 +292,13 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
} else {
|
|
} else {
|
|
gName = finalWorkingText.substring(index + "https://t.me/".length());
|
|
gName = finalWorkingText.substring(index + "https://t.me/".length());
|
|
}
|
|
}
|
|
|
|
+ if (gName.startsWith("+")) {
|
|
|
|
+ String tempName = gName.replace("+", "");
|
|
|
|
+ if (AndroidUtilities.isNumeric(tempName)) {
|
|
|
|
+ gName = tempName;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
final int[] requestId = new int[]{0};
|
|
final int[] requestId = new int[]{0};
|
|
final int[] intentAccount = new int[]{UserConfig.selectedAccount};
|
|
final int[] intentAccount = new int[]{UserConfig.selectedAccount};
|
|
if (gName != null) {
|
|
if (gName != null) {
|
|
@@ -308,24 +315,26 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
|
|
// TODO: 2022/11/16 群组跳转未实现
|
|
// TODO: 2022/11/16 群组跳转未实现
|
|
requestId[0] = ConnectionsManager.getInstance(intentAccount[0]).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
|
requestId[0] = ConnectionsManager.getInstance(intentAccount[0]).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
|
TLRPC.TL_contacts_resolvedPeer res = (TLRPC.TL_contacts_resolvedPeer) response;
|
|
TLRPC.TL_contacts_resolvedPeer res = (TLRPC.TL_contacts_resolvedPeer) response;
|
|
- if (res != null && res.users != null) {
|
|
|
|
|
|
+ if (error == null && res != null && res.users != null) {
|
|
MessagesController.getInstance(intentAccount[0]).putUsers(res.users, false);
|
|
MessagesController.getInstance(intentAccount[0]).putUsers(res.users, false);
|
|
MessagesController.getInstance(intentAccount[0]).putChats(res.chats, false);
|
|
MessagesController.getInstance(intentAccount[0]).putChats(res.chats, false);
|
|
MessagesStorage.getInstance(intentAccount[0]).putUsersAndChats(res.users, res.chats, false, true);
|
|
MessagesStorage.getInstance(intentAccount[0]).putUsersAndChats(res.users, res.chats, false, true);
|
|
-// long dialog_id;
|
|
|
|
-// boolean isBot = false;
|
|
|
|
|
|
+ long dialog_id;
|
|
|
|
+ boolean isBot = false;
|
|
Bundle args = new Bundle();
|
|
Bundle args = new Bundle();
|
|
-// if (!res.chats.isEmpty()) {
|
|
|
|
-// args.putLong("chat_id", res.chats.get(0).id);
|
|
|
|
-// dialog_id = -res.chats.get(0).id;
|
|
|
|
-// } else {
|
|
|
|
- args.putLong("user_id", res.users.get(0).id);
|
|
|
|
-// dialog_id = res.users.get(0).id;
|
|
|
|
-// }
|
|
|
|
|
|
+ if (!res.chats.isEmpty()) {
|
|
|
|
+ args.putLong("chat_id", res.chats.get(0).id);
|
|
|
|
+ dialog_id = -res.chats.get(0).id;
|
|
|
|
+ } else {
|
|
|
|
+ args.putLong("user_id", res.users.get(0).id);
|
|
|
|
+ dialog_id = res.users.get(0).id;
|
|
|
|
+ }
|
|
ChatActivity fragment = new ChatActivity(args);
|
|
ChatActivity fragment = new ChatActivity(args);
|
|
baseFragment.presentFragment(fragment);
|
|
baseFragment.presentFragment(fragment);
|
|
} else {
|
|
} else {
|
|
- ToastUtil.show(baseFragment.getParentActivity(), "Username not found");
|
|
|
|
|
|
+ if (res.chats.isEmpty()) {
|
|
|
|
+ ToastUtil.show(baseFragment.getParentActivity(), "Username not found");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}));
|
|
}));
|
|
}
|
|
}
|