2 Commits abd7fc05f4 ... 163ff7f210

Author SHA1 Message Date
  DESKTOP-JJ6HLMB 163ff7f210 评论链接代码提交 1 year ago
  DESKTOP-JJ6HLMB 9e15759961 评论链接代码提交 1 year ago

+ 4 - 0
TMessagesProj/src/main/java/org/telegram/cricdit/ui/NewsDetailCommentFragment.java

@@ -378,6 +378,8 @@ public class NewsDetailCommentFragment extends BaseActivity<CommentPresenter> im
         }
         if (multiItem == null) {
             MainCommendBean addMainCommendBean = new MainCommendBean(content);
+            addMainCommendBean.setFirst_name(UserConfig.getInstance(currentAccount).getCurrentUser().first_name);
+            addMainCommendBean.setLast_name(UserConfig.getInstance(currentAccount).getCurrentUser().last_name);
             addMainCommendBean.setUser_id(userID);
             addMainCommendBean.setUser_name(nickname);
             addMainCommendBean.setUser_avatar(faceURL);
@@ -391,6 +393,8 @@ public class NewsDetailCommentFragment extends BaseActivity<CommentPresenter> im
 //            if (multiItem instanceof MainCommendBean) {//表示点击主评论的回复
             int index = adapter.getData().indexOf(multiItem) + 1;
             ChildCommendBean childCommendBean = new ChildCommendBean(content);
+            childCommendBean.setFirst_name(UserConfig.getInstance(currentAccount).getCurrentUser().first_name);
+            childCommendBean.setLast_name(UserConfig.getInstance(currentAccount).getCurrentUser().last_name);
             childCommendBean.setUser_id(userID);
             childCommendBean.setUser_name(nickname);
             childCommendBean.setUser_avatar(faceURL);

+ 4 - 0
TMessagesProj/src/main/java/org/telegram/cricdit/ui/RankDetailCommentFragment.java

@@ -348,6 +348,8 @@ public class RankDetailCommentFragment extends BaseActivity<CommentPresenter> im
         }
         if (multiItem == null) {
             MainCommendBean addMainCommendBean = new MainCommendBean(content);
+            addMainCommendBean.setFirst_name(UserConfig.getInstance(currentAccount).getCurrentUser().first_name);
+            addMainCommendBean.setLast_name(UserConfig.getInstance(currentAccount).getCurrentUser().last_name);
             addMainCommendBean.setUser_id(userID);
             addMainCommendBean.setUser_name(nickname);
             addMainCommendBean.setUser_avatar(faceURL);
@@ -361,6 +363,8 @@ public class RankDetailCommentFragment extends BaseActivity<CommentPresenter> im
 //            if (multiItem instanceof MainCommendBean) {//表示点击主评论的回复
             int index = adapter.getData().indexOf(multiItem) + 1;
             ChildCommendBean childCommendBean = new ChildCommendBean(content);
+            childCommendBean.setFirst_name(UserConfig.getInstance(currentAccount).getCurrentUser().first_name);
+            childCommendBean.setLast_name(UserConfig.getInstance(currentAccount).getCurrentUser().last_name);
             childCommendBean.setUser_id(userID);
             childCommendBean.setUser_name(nickname);
             childCommendBean.setUser_avatar(faceURL);

+ 13 - 1
TMessagesProj/src/main/java/org/telegram/cricdit/view/ExpandTextView.java

@@ -101,6 +101,7 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
     private int mTipColor;
 
     private static final int TIP_COLOR = 0xFFFFFFFF;//默认颜色
+    private AlertDialog alertDialog;
 
     public ExpandTextView(Context context) {
         this(context, null);
@@ -125,6 +126,7 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
      * 使用前必须调用该方法
      */
     public void init(BaseFragment baseFragment, boolean toExpand, String text, @Nullable CreateAppenderListener createAppenderListener) {
+        alertDialog = new AlertDialog(baseFragment.getParentActivity(), 3);
         this.baseFragment = baseFragment;
         mMaxLines = getMaxLines();
         originText = ToDBC ? ToDBC(text) : toDBC(text);
@@ -290,6 +292,9 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
             ClickableSpan clickableSpan = new ClickableSpan() {
                 @Override
                 public void onClick(View widget) {
+                    if (alertDialog != null) {
+                        alertDialog.show();
+                    }
                     if (finalWorkingText.contains("https://t.me/")) {
                         int index = finalWorkingText.indexOf("https://t.me/");
                         int end = finalWorkingText.indexOf(" ", index);
@@ -323,6 +328,9 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
                                 }
                                 // TODO: 2022/11/16  群组跳转带+号的现在仍然跳转失败
                                 requestId[0] = ConnectionsManager.getInstance(intentAccount[0]).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
+                                    if (alertDialog != null) {
+                                        alertDialog.dismiss();
+                                    }
                                     TLRPC.TL_contacts_resolvedPeer res = (TLRPC.TL_contacts_resolvedPeer) response;
                                     if (error == null && res != null && res.users != null) {
                                         MessagesController.getInstance(intentAccount[0]).putUsers(res.users, false);
@@ -341,7 +349,7 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
                                         ChatActivity fragment = new ChatActivity(args);
                                         baseFragment.presentFragment(fragment);
                                     } else {
-                                        ToastUtil.show(baseFragment.getParentActivity(), "Username not found");
+                                        ToastUtil.show(baseFragment.getParentActivity(), LocaleController.getString("ExpiredLink", R.string.ExpiredLink));
 //                                    if (res != null && res.chats != null) {
 //                                        if (res.chats.isEmpty()) {
 //                                            ToastUtil.show(baseFragment.getParentActivity(), "Username not found");
@@ -354,6 +362,9 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
                             final TLRPC.TL_messages_checkChatInvite req = new TLRPC.TL_messages_checkChatInvite();
                             req.hash = group;
                             requestId[0] = ConnectionsManager.getInstance(intentAccount[0]).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
+                                if (alertDialog != null) {
+                                    alertDialog.dismiss();
+                                }
                                 if (error == null) {
                                     TLRPC.ChatInvite invite = (TLRPC.ChatInvite) response;
                                     if (invite.chat != null && (!ChatObject.isLeftFromChat(invite.chat) || !invite.chat.kicked && (!TextUtils.isEmpty(invite.chat.username) || invite instanceof TLRPC.TL_chatInvitePeek || invite.chat.has_geo))) {
@@ -367,6 +378,7 @@ public class ExpandTextView extends androidx.appcompat.widget.AppCompatTextView
                                         baseFragment.presentFragment(fragment);
                                     }
                                 } else {
+                                    ToastUtil.show(baseFragment.getParentActivity(), LocaleController.getString("ExpiredLink", R.string.ExpiredLink));
 //                                        AlertDialog.Builder builder = new AlertDialog.Builder(baseFragment.getParentActivity());
 //                                        builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
 //                                        if (error.text.startsWith("FLOOD_WAIT")) {