feat:去掉本地一键匹配的忽略私聊限制:由后端处理

This commit is contained in:
Max
2023-12-27 15:04:40 +08:00
parent 6e7743960c
commit 0b339136cc
4 changed files with 4 additions and 21 deletions

View File

@@ -104,7 +104,7 @@ class FriendsFragment : BaseBindingFragment<HomeFriendsFragmentBinding>() {
dialogManager.dismissDialog() dialogManager.dismissDialog()
it?.let { it?.let {
if (it.isNotEmpty()) { if (it.isNotEmpty()) {
NimP2PMessageActivity.startWithIgnoreChatLimit(context, it) NimP2PMessageActivity.start(context, it)
} }
} }
} }

View File

@@ -159,15 +159,6 @@ public class NimP2PMessageActivity extends NewBaseMessageActivity {
startReal(context, contactId, new Intent()); 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) { public static void start(Context context, String contactId, boolean isFromVoiceMatch) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra(Extras.EXTRA_ACCOUNT, contactId); intent.putExtra(Extras.EXTRA_ACCOUNT, contactId);

View File

@@ -127,7 +127,6 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
private RxPermissions rxPermissions; private RxPermissions rxPermissions;
private boolean isChat; private boolean isChat;
private String hintText; private String hintText;
private boolean ignoreChatLimit;
private Observer<List<MessageReceipt>> messageReceiptObserver = new Observer<List<MessageReceipt>>() { private Observer<List<MessageReceipt>> messageReceiptObserver = new Observer<List<MessageReceipt>>() {
@Override @Override
public void onEvent(List<MessageReceipt> messageReceipts) { public void onEvent(List<MessageReceipt> messageReceipts) {
@@ -222,7 +221,6 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
} }
private void parseIntent() { private void parseIntent() {
ignoreChatLimit = getArguments().getBoolean(Extras.EXTRA_IGNORE_CHAT_LIMIT, false);
sessionId = getArguments().getString(Extras.EXTRA_ACCOUNT); sessionId = getArguments().getString(Extras.EXTRA_ACCOUNT);
ChatterBoxHelper.reset(); ChatterBoxHelper.reset();
ChatterBoxHelper.sessionId = sessionId; ChatterBoxHelper.sessionId = sessionId;
@@ -241,9 +239,6 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
if (inputPanel == null) { if (inputPanel == null) {
inputPanel = new InputPanel(container, rootView, getActionList()); inputPanel = new InputPanel(container, rootView, getActionList());
inputPanel.setCustomization(customization); inputPanel.setCustomization(customization);
if (ignoreChatLimit) {
isChat = true;
}
inputPanel.setLimitLevel(isChat, hintText); inputPanel.setLimitLevel(isChat, hintText);
} else { } else {
inputPanel.reload(container, customization); inputPanel.reload(container, customization);
@@ -660,10 +655,6 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private void loadChatLimit(boolean sessionIsEmpty) { private void loadChatLimit(boolean sessionIsEmpty) {
if (ignoreChatLimit) {
Log.d(TAG, "#ignore");
return;
}
IMCustomModel.get().getPrivateChatLimit(sessionId).subscribe(((privateChatLimitInfo, throwable) -> { IMCustomModel.get().getPrivateChatLimit(sessionId).subscribe(((privateChatLimitInfo, throwable) -> {
if (isDestroyed()) { if (isDestroyed()) {
return; return;
@@ -680,6 +671,9 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
if (limitInfo == null) { if (limitInfo == null) {
return; return;
} }
if (inputPanel == null) {
return;
}
int model = limitInfo.getModel(); int model = limitInfo.getModel();
if (model == 2) { if (model == 2) {
isChat = limitInfo.isChat(); isChat = limitInfo.isChat();

View File

@@ -27,8 +27,6 @@ public interface Extras {
// 参数 // 参数
String EXTRA_ACCOUNT = "account"; String EXTRA_ACCOUNT = "account";
String EXTRA_TYPE = "type"; String EXTRA_TYPE = "type";
// 忽略限制
String EXTRA_IGNORE_CHAT_LIMIT = "ignore_chat_limit";
String EXTRA_ANCHOR = "anchor"; String EXTRA_ANCHOR = "anchor";
String EXTRA_CUSTOMIZATION = "customization"; String EXTRA_CUSTOMIZATION = "customization";