feat:完成一键匹配入口进私聊:忽略限制功能
This commit is contained in:
@@ -82,7 +82,7 @@ class FriendsFragment : BaseBindingFragment<HomeFriendsFragmentBinding>() {
|
||||
dialogManager.dismissDialog()
|
||||
it?.let {
|
||||
if (it.isNotEmpty()) {
|
||||
NimP2PMessageActivity.start(context, it)
|
||||
NimP2PMessageActivity.startWithIgnoreChatLimit(context, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -159,6 +159,15 @@ public class NimP2PMessageActivity extends NewBaseMessageActivity {
|
||||
startReal(context, contactId, new Intent());
|
||||
}
|
||||
|
||||
/**
|
||||
* 忽略聊天限制
|
||||
*/
|
||||
public static void startWithIgnoreChatLimit(Context context, String contactId) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(Extras.EXTRA_IGNORE_CHAT_LIMIT, true);
|
||||
startReal(context, contactId, intent);
|
||||
}
|
||||
|
||||
public static void start(Context context, String contactId, boolean isFromVoiceMatch) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(Extras.EXTRA_ACCOUNT, contactId);
|
||||
|
@@ -12,6 +12,7 @@ import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -126,6 +127,7 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
|
||||
private RxPermissions rxPermissions;
|
||||
private boolean isChat;
|
||||
private String hintText;
|
||||
private boolean ignoreChatLimit;
|
||||
private Observer<List<MessageReceipt>> messageReceiptObserver = new Observer<List<MessageReceipt>>() {
|
||||
@Override
|
||||
public void onEvent(List<MessageReceipt> messageReceipts) {
|
||||
@@ -220,6 +222,7 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
|
||||
}
|
||||
|
||||
private void parseIntent() {
|
||||
ignoreChatLimit = getArguments().getBoolean(Extras.EXTRA_IGNORE_CHAT_LIMIT, false);
|
||||
sessionId = getArguments().getString(Extras.EXTRA_ACCOUNT);
|
||||
ChatterBoxHelper.reset();
|
||||
ChatterBoxHelper.sessionId = sessionId;
|
||||
@@ -238,6 +241,9 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
|
||||
if (inputPanel == null) {
|
||||
inputPanel = new InputPanel(container, rootView, getActionList());
|
||||
inputPanel.setCustomization(customization);
|
||||
if (ignoreChatLimit) {
|
||||
isChat = true;
|
||||
}
|
||||
inputPanel.setLimitLevel(isChat, hintText);
|
||||
} else {
|
||||
inputPanel.reload(container, customization);
|
||||
@@ -654,6 +660,10 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void loadChatLimit(boolean sessionIsEmpty) {
|
||||
if (ignoreChatLimit) {
|
||||
Log.d("MAAAX", "#ignore");
|
||||
return;
|
||||
}
|
||||
IMCustomModel.get().getPrivateChatLimit(sessionId).subscribe(((privateChatLimitInfo, throwable) -> {
|
||||
if (isDestroyed()) {
|
||||
return;
|
||||
|
@@ -27,6 +27,8 @@ public interface Extras {
|
||||
// 参数
|
||||
String EXTRA_ACCOUNT = "account";
|
||||
String EXTRA_TYPE = "type";
|
||||
// 忽略限制
|
||||
String EXTRA_IGNORE_CHAT_LIMIT = "ignore_chat_limit";
|
||||
String EXTRA_ANCHOR = "anchor";
|
||||
|
||||
String EXTRA_CUSTOMIZATION = "customization";
|
||||
|
Reference in New Issue
Block a user